Skip to content

Cards

Defined in: src/team/client.gen.ts:8

new Cards(_core): Cards

Defined in: src/team/client.gen.ts:9

BrexCore

Cards

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.

{ three_domain_secure_enabled_preference?: "THREE_DOMAIN_SECURE_ENABLED" | "THREE_DOMAIN_SECURE_DISABLED" | null; } | null

string

"VIRTUAL" | "PHYSICAL"

"CARD" | "USER"

{ city?: string | null; country?: string | null; line1?: string | null; line2?: string | null; phone_number?: string | null; postal_code?: string | null; state?: string | null; } | null

{[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

{ 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

RequestOptions

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(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.

string

number | null

Format: int32

Description

Link expiry in number of days. Defaults to 30

string | null

Description

Message to send with the card details

string

Description

Email address to send card details to

string

Description

Sender name. Shows up in the subject of the email

RequestOptions

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

string

RequestOptions

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(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

string

RequestOptions

Promise<{ cvv: string; expiration_date: { month: number; year: number; }; holder_name: string; id: string; number: string; }>


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.

string | null

number | null

string | null

RequestOptions

PagePromise<{ items: object[]; next_cursor?: string | null; }>


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.

string

string | null

Description

Description for locking a card

"OTHER" | "CARD_DAMAGED" | "CARD_LOST" | "CARD_NOT_RECEIVED" | "DO_NOT_NEED_PHYSICAL_CARD" | "DO_NOT_NEED_VIRTUAL_CARD" | "FRAUD"

RequestOptions

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(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.

string

string | null

Description

Description for terminating a card

"OTHER" | "CARD_DAMAGED" | "CARD_LOST" | "CARD_NOT_RECEIVED" | "DO_NOT_NEED_PHYSICAL_CARD" | "DO_NOT_NEED_VIRTUAL_CARD" | "FRAUD"

RequestOptions

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(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.

string

RequestOptions

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(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.

string

{[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.

{ 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

RequestOptions

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; }>