Cards
Defined in: src/team/client.gen.ts:8
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Cards(
_core):Cards
Defined in: src/team/client.gen.ts:9
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Cards
Methods
Section titled “Methods”create()
Section titled “create()”create(
body,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:24
Create card
Creates a new card.
The spend_controls field is required when limit_type = CARD.
The mailing_address field is required for physical cards and is the shipping address used to send the card; it is not the same as the billing and mailing address used for online purchases.
The first 2 lines of this address must be under 60 characters long. Each user can only have up to 10 active physical cards.
For Empower accounts, this endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned.
If this is the case and you want to gain access to this endpoint, please contact Brex support.
POST /v2/cards — requires OAuth scope: cards
Sends an Idempotency-Key header: options.idempotencyKey, or an auto-generated UUID.
Parameters
Section titled “Parameters”card_attribute_preferences?
Section titled “card_attribute_preferences?”{ three_domain_secure_enabled_preference?: "THREE_DOMAIN_SECURE_ENABLED" | "THREE_DOMAIN_SECURE_DISABLED" | null; } | null
card_name
Section titled “card_name”string
card_type
Section titled “card_type”"VIRTUAL" | "PHYSICAL"
limit_type
Section titled “limit_type”"CARD" | "USER"
mailing_address?
Section titled “mailing_address?”{ city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null
metadata?
Section titled “metadata?”{[key: string]: string; } | null
Description
Set of key value pairs associated with this object. Please do not store any personally identifiable or sensitive information here. Limitations: maximum of 50 keys, keys cannot exceed 40 characters, values cannot exceed 500 characters.
object & object
spend_controls?
Section titled “spend_controls?”{ allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; parent_budget_id?: string | null; policy_id?: string | null; reason?: string | null; spend_duration: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_limit: { amount: number; currency: string | null; }; } | null
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>
emailNumber()
Section titled “emailNumber()”emailNumber(
id,body,options?):Promise<void>
Defined in: src/team/client.gen.ts:44
Create secure email to send card number
Creates a secure email to send card number, CVV, and expiration date of a card by ID to the specified email.
This endpoint is currently gated. If you would like to request access, please reach out to developer-support@brex.com
POST /v2/cards/{id}/secure_email — requires OAuth scope: cards.pan
Sends an Idempotency-Key header: options.idempotencyKey, or an auto-generated UUID.
Parameters
Section titled “Parameters”string
expiry_days?
Section titled “expiry_days?”number | null
Format: int32
Description
Link expiry in number of days. Defaults to 30
message?
Section titled “message?”string | null
Description
Message to send with the card details
recipient_email
Section titled “recipient_email”string
Description
Email address to send card details to
sender_name
Section titled “sender_name”string
Description
Sender name. Shows up in the subject of the email
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
get(
id,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:65
Get card
Retrieves a card by ID. Only cards with limit_type = CARD have spend_controls
GET /v2/cards/{id} — requires OAuth scope: cards, cards.readonly
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>
getNumber()
Section titled “getNumber()”getNumber(
id,options?):Promise<{cvv:string;expiration_date: {month:number;year:number; };holder_name:string;id:string;number:string; }>
Defined in: src/team/client.gen.ts:81
Get card number
Retrieves card number, CVV, and expiration date of a card by ID.
GET /v2/cards/{id}/pan — requires OAuth scope: cards.pan
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ cvv: string; expiration_date: { month: number; year: number; }; holder_name: string; id: string; number: string; }>
list()
Section titled “list()”list(
query?,options?):PagePromise<{items:object[];next_cursor?:string|null; }>
Defined in: src/team/client.gen.ts:101
List cards
Lists all cards by a user_id.
Only cards with limit_type = CARD have spend_controls
GET /v2/cards — requires OAuth scope: cards.readonly, cards
Await for a single page, or for await to iterate items across all pages.
Parameters
Section titled “Parameters”query?
Section titled “query?”cursor?
Section titled “cursor?”string | null
limit?
Section titled “limit?”number | null
user_id?
Section titled “user_id?”string | null
options?
Section titled “options?”Returns
Section titled “Returns”PagePromise<{ items: object[]; next_cursor?: string | null; }>
lock()
Section titled “lock()”lock(
id,body,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:118
Lock card
Locks an existing, unlocked card. And the card owner will receive a notification about it.
POST /v2/cards/{id}/lock — requires OAuth scope: cards
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
description?
Section titled “description?”string | null
Description
Description for locking a card
reason
Section titled “reason”"OTHER" | "CARD_DAMAGED" | "CARD_LOST" | "CARD_NOT_RECEIVED" | "DO_NOT_NEED_PHYSICAL_CARD" | "DO_NOT_NEED_VIRTUAL_CARD" | "FRAUD"
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>
terminate()
Section titled “terminate()”terminate(
id,body,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:144
Terminate card
Terminates an existing card. The card owner will receive a notification about it.
POST /v2/cards/{id}/terminate — requires OAuth scope: cards
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
description?
Section titled “description?”string | null
Description
Description for terminating a card
reason
Section titled “reason”"OTHER" | "CARD_DAMAGED" | "CARD_LOST" | "CARD_NOT_RECEIVED" | "DO_NOT_NEED_PHYSICAL_CARD" | "DO_NOT_NEED_VIRTUAL_CARD" | "FRAUD"
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>
unlock()
Section titled “unlock()”unlock(
id,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:170
Unlock card
Unlocks an existing card.
POST /v2/cards/{id}/unlock — requires OAuth scope: cards
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>
update()
Section titled “update()”update(
id,body,options?):Promise<{billing_address: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; };budget_id?:string|null;card_name:string;card_type?:"VIRTUAL"|"PHYSICAL"|null;expiration_date: {month:number;year:number; };has_been_transferred?:boolean;id:string;last_four:string;limit_type:"CARD"|"USER";mailing_address?: {city?:string|null;country?:string|null;line1?:string|null;line2?:string|null;phone_number?:string|null;postal_code?:string|null;state?:string|null; } |null;metadata?: {[key:string]:string; } |null;owner:object&object;spend_controls?: {allowed_merchant_details?:object[] |null;blocked_merchant_details?:object[] |null;lock_after_date?:string|null;reason?:string|null;spend_available?: {amount:number;currency:string|null; } |null;spend_duration?:"MONTHLY"|"QUARTERLY"|"YEARLY"|"ONE_TIME"|null;spend_limit?: {amount:number;currency:string|null; } |null; } |null;status?:"ACTIVE"|"TERMINATED"|"SHIPPED"|"LOCKED"|null; }>
Defined in: src/team/client.gen.ts:192
Update card
Update an existing vendor card
PUT /v2/cards/{id} — requires OAuth scope: cards
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
metadata?
Section titled “metadata?”{[key: string]: string; } | null
Description
Set of key value pairs associated with this object. Please do not store any personally identifiable or sensitive information here. Limitations: maximum of 50 keys, keys cannot exceed 40 characters, values cannot exceed 500 characters.
spend_controls?
Section titled “spend_controls?”{ allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ billing_address: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; }; budget_id?: string | null; card_name: string; card_type?: "VIRTUAL" | "PHYSICAL" | null; expiration_date: { month: number; year: number; }; has_been_transferred?: boolean; id: string; last_four: string; limit_type: "CARD" | "USER"; mailing_address?: { city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null; metadata?: {[key: string]: string; } | null; owner: object & object; spend_controls?: { allowed_merchant_details?: object[] | null; blocked_merchant_details?: object[] | null; lock_after_date?: string | null; reason?: string | null; spend_available?: { amount: number; currency: string | null; } | null; spend_duration?: "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null; spend_limit?: { amount: number; currency: string | null; } | null; } | null; status?: "ACTIVE" | "TERMINATED" | "SHIPPED" | "LOCKED" | null; }>