Skip to content

CardExpenses

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

new CardExpenses(_core): CardExpenses

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

BrexCore

CardExpenses

get(expenseId, query?, options?): Promise<{ address?: { city?: string | null; coordinates?: { latitude: number; longitude: number; } | null; country?: string | null; line1?: string | null; line2?: string | null; postal_code?: string | null; state?: string | null; timezone?: string | null; } | null; approved_at?: string | null; billing_amount?: { amount: number; currency: string | null; } | null; billing_entity_id?: string | null; booking_id?: string | null; budget?: { id: string; name: string; } | null; budget_amount?: { amount: number; currency: string | null; } | null; budget_id?: string | null; category?: "GROCERY" | "TELEPHONY" | "OFFICE_SUPPLIES" | "PRIVATE_AIR_TRAVEL" | "CLOTHING" | "CAR_RENTAL" | "VEHICLE_EXPENSES" | "RESTAURANTS" | "GAMBLING" | "FLOWERS" | "ELECTRONICS" | "LEGAL_SERVICES" | "UTILITIES" | "FURNITURE" | "LAUNDRY" | "EVENT_EXPENSES" | "SHIPPING" | "OTHER_TRAVEL_EXPENSES" | "CHARITY" | "LODGING" | "FACILITIES_EXPENSES" | "SERVERS" | "CONFERENCES" | "FOOD_DELIVERY" | "RENT" | "AIRLINE_EXPENSES" | "OTHER_BUSINESS_EXPENSES" | "CORPORATE_INSURANCE" | "DIGITAL_GOODS" | "GENERAL_MERCHANDISE" | "MEDICAL" | "PARKING_EXPENSES" | "POLITICAL_DONATIONS" | "PUBLIC_TRANSPORTATION" | "ADVERTISING_AND_MARKETING" | "BARS_AND_NIGHTLIFE" | "SOFTWARE_NON_RECURRING" | "BANK_AND_FINANCIAL_FEES" | "BOOKS_AND_NEWSPAPERS" | "CONSULTANT_AND_CONTRACTOR" | "FEES_AND_LICENSES_AND_TAXES" | "GAS_AND_FUEL" | "MEMBERSHIPS_AND_CLUBS" | "RECURRING_SOFTWARE_AND_SAAS" | "RIDESHARE_AND_TAXI" | "TOLL_AND_BRIDGE_FEES" | "TRAINING_AND_EDUCATION" | "TRAVEL_WIFI" | null; completion_date?: string | null; custom_fields?: object[] | null; dashboard_url: string; department?: { id: string; name: string; } | null; department_id?: string | null; expense_line_items?: { address?: { city?: string | null | undefined; coordinates?: { latitude: number; longitude: number; } | null | undefined; country?: string | null | undefined; line1?: string | null | undefined; line2?: string | … 1 more … | undefined; postal_code?: string | … 1 more … | undefined; state?: string | … 1 mor…[] | null; expense_type?: "CARD" | "REIMBURSEMENT" | "BILLPAY" | "CLAWBACK" | "UNSET" | null; exported_at?: string | null; id: string; integration_billing_entity_id?: string | null; integration_spending_entity_id?: string | null; location?: { id: string; name: string; } | null; location_id?: string | null; memo?: string | null; merchant?: { country: string; mcc: string; raw_descriptor: string; } | null; merchant_id?: string | null; original_amount?: { amount: number; currency: string | null; } | null; payment?: { id: string; paymentInstrument: Omit<object & object & object, "type">; statusReason: "APPROVED" | "OTHER" | "EXCEEDED_BUDGET_LIMIT" | "BUDGET_EXPIRED" | "NO_BUDGET" | "BUDGET_NOT_YET_STARTED" | "BUDGET_CATEGORY_RESTRICTION" | "BUDGET_MERCHANT_RESTRICTION" | "SUSPECTED_FRAUD" | "EXCEEDED_GLOBAL_LIMIT" | "EXCEEDED_USER_LIMIT" | "EXCEEDED_CARD_LIMIT" | "INVALID_EXPIRATION_DATE" | "CARD_NOT_ACTIVE" | "INVALID_CARD_CREDENTIALS" | "INVALID_BILLING_ADDRESS" | "CARD_SUSPENDED" | "CARD_TERMINATED" | "CARD_EXPIRED" | "MCC_BLOCKED" | "USER_SUSPENDED" | "INVALID_PIN" | "INVALID_CVV" | "EXCEEDED_PIN_ATTEMPTS" | "INSIDE_SANCTIONED_COUNTRY" | "SOFT_EXPIRATION" | "TRANSFERRED_CARD_NEW_MERCHANT" | "EXCEEDED_ANCESTOR_BUDGET_LIMIT" | "EXCEEDED_BUDGET_TRANSACTION_LIMIT" | "TOS_BLOCKED" | "COMPLIANCE_BLOCKED"; } | null; payment_posted_at?: string | null; payment_status?: "NOT_STARTED" | "PROCESSING" | "CANCELED" | "DECLINED" | "CLEARED" | "REFUNDING" | "REFUNDED" | "CASH_ADVANCE" | "CREDITED" | "AWAITING_PAYMENT" | "SCHEDULED" | null; policy?: { id: string; name: string; } | null; purchased_amount?: { amount: number; currency: string | null; } | null; purchased_at?: string | null; receipts?: object[] | null; repayment?: { repayment_initiated_by?: { department_id?: string | null; first_name: string; id: string; last_name: string; location_id?: string | null; } | null; repayment_initiation_date?: string | null; } | null; review?: { approval_steps: object[] | null; compliance_status: string | null; } | null; spending_entity?: { 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; }; created_at: string; display_name: string; id: string; is_default?: boolean; status: "UNSUBMITTED" | "UNVERIFIED" | "IN_PROGRESS" | "VERIFIED" | "REJECTED"; } | null; spending_entity_id?: string | null; status?: "APPROVED" | "CANCELED" | "DRAFT" | "SUBMITTED" | "OUT_OF_POLICY" | "VOID" | "SPLIT" | "SETTLED" | null; submitted_at?: string | null; trip_id?: string | null; updated_at: string; usd_equivalent_amount?: { amount: number; currency: string | null; } | null; user?: { department_id?: string | null; first_name: string; id: string; last_name: string; location_id?: string | null; } | null; user_id?: string | null; }>

Defined in: src/expenses/client.gen.ts:19

Get a card expense

This endpoint is deprecated. Use the “Get an expense” (GET /v1/expenses/{id}) endpoint instead.

GET /v1/expenses/card/{expense_id} — requires OAuth scope: expenses.card.readonly, expenses.card

string

string[] | null

Description

Get additional details for the expense, e.g. merchant mcc code, by passing in expand[]=merchant. Query parameters include location, department, merchant, receipts.download_uris, user, budget, payment, spending_entity and policy.

Example

?expand[]=merchant&expand[]=location

boolean | null

Description

Load custom fields for the expense.

RequestOptions

Promise<{ address?: { city?: string | null; coordinates?: { latitude: number; longitude: number; } | null; country?: string | null; line1?: string | null; line2?: string | null; postal_code?: string | null; state?: string | null; timezone?: string | null; } | null; approved_at?: string | null; billing_amount?: { amount: number; currency: string | null; } | null; billing_entity_id?: string | null; booking_id?: string | null; budget?: { id: string; name: string; } | null; budget_amount?: { amount: number; currency: string | null; } | null; budget_id?: string | null; category?: "GROCERY" | "TELEPHONY" | "OFFICE_SUPPLIES" | "PRIVATE_AIR_TRAVEL" | "CLOTHING" | "CAR_RENTAL" | "VEHICLE_EXPENSES" | "RESTAURANTS" | "GAMBLING" | "FLOWERS" | "ELECTRONICS" | "LEGAL_SERVICES" | "UTILITIES" | "FURNITURE" | "LAUNDRY" | "EVENT_EXPENSES" | "SHIPPING" | "OTHER_TRAVEL_EXPENSES" | "CHARITY" | "LODGING" | "FACILITIES_EXPENSES" | "SERVERS" | "CONFERENCES" | "FOOD_DELIVERY" | "RENT" | "AIRLINE_EXPENSES" | "OTHER_BUSINESS_EXPENSES" | "CORPORATE_INSURANCE" | "DIGITAL_GOODS" | "GENERAL_MERCHANDISE" | "MEDICAL" | "PARKING_EXPENSES" | "POLITICAL_DONATIONS" | "PUBLIC_TRANSPORTATION" | "ADVERTISING_AND_MARKETING" | "BARS_AND_NIGHTLIFE" | "SOFTWARE_NON_RECURRING" | "BANK_AND_FINANCIAL_FEES" | "BOOKS_AND_NEWSPAPERS" | "CONSULTANT_AND_CONTRACTOR" | "FEES_AND_LICENSES_AND_TAXES" | "GAS_AND_FUEL" | "MEMBERSHIPS_AND_CLUBS" | "RECURRING_SOFTWARE_AND_SAAS" | "RIDESHARE_AND_TAXI" | "TOLL_AND_BRIDGE_FEES" | "TRAINING_AND_EDUCATION" | "TRAVEL_WIFI" | null; completion_date?: string | null; custom_fields?: object[] | null; dashboard_url: string; department?: { id: string; name: string; } | null; department_id?: string | null; expense_line_items?: { address?: { city?: string | null | undefined; coordinates?: { latitude: number; longitude: number; } | null | undefined; country?: string | null | undefined; line1?: string | null | undefined; line2?: string | … 1 more … | undefined; postal_code?: string | … 1 more … | undefined; state?: string | … 1 mor…[] | null; expense_type?: "CARD" | "REIMBURSEMENT" | "BILLPAY" | "CLAWBACK" | "UNSET" | null; exported_at?: string | null; id: string; integration_billing_entity_id?: string | null; integration_spending_entity_id?: string | null; location?: { id: string; name: string; } | null; location_id?: string | null; memo?: string | null; merchant?: { country: string; mcc: string; raw_descriptor: string; } | null; merchant_id?: string | null; original_amount?: { amount: number; currency: string | null; } | null; payment?: { id: string; paymentInstrument: Omit<object & object & object, "type">; statusReason: "APPROVED" | "OTHER" | "EXCEEDED_BUDGET_LIMIT" | "BUDGET_EXPIRED" | "NO_BUDGET" | "BUDGET_NOT_YET_STARTED" | "BUDGET_CATEGORY_RESTRICTION" | "BUDGET_MERCHANT_RESTRICTION" | "SUSPECTED_FRAUD" | "EXCEEDED_GLOBAL_LIMIT" | "EXCEEDED_USER_LIMIT" | "EXCEEDED_CARD_LIMIT" | "INVALID_EXPIRATION_DATE" | "CARD_NOT_ACTIVE" | "INVALID_CARD_CREDENTIALS" | "INVALID_BILLING_ADDRESS" | "CARD_SUSPENDED" | "CARD_TERMINATED" | "CARD_EXPIRED" | "MCC_BLOCKED" | "USER_SUSPENDED" | "INVALID_PIN" | "INVALID_CVV" | "EXCEEDED_PIN_ATTEMPTS" | "INSIDE_SANCTIONED_COUNTRY" | "SOFT_EXPIRATION" | "TRANSFERRED_CARD_NEW_MERCHANT" | "EXCEEDED_ANCESTOR_BUDGET_LIMIT" | "EXCEEDED_BUDGET_TRANSACTION_LIMIT" | "TOS_BLOCKED" | "COMPLIANCE_BLOCKED"; } | null; payment_posted_at?: string | null; payment_status?: "NOT_STARTED" | "PROCESSING" | "CANCELED" | "DECLINED" | "CLEARED" | "REFUNDING" | "REFUNDED" | "CASH_ADVANCE" | "CREDITED" | "AWAITING_PAYMENT" | "SCHEDULED" | null; policy?: { id: string; name: string; } | null; purchased_amount?: { amount: number; currency: string | null; } | null; purchased_at?: string | null; receipts?: object[] | null; repayment?: { repayment_initiated_by?: { department_id?: string | null; first_name: string; id: string; last_name: string; location_id?: string | null; } | null; repayment_initiation_date?: string | null; } | null; review?: { approval_steps: object[] | null; compliance_status: string | null; } | null; spending_entity?: { 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; }; created_at: string; display_name: string; id: string; is_default?: boolean; status: "UNSUBMITTED" | "UNVERIFIED" | "IN_PROGRESS" | "VERIFIED" | "REJECTED"; } | null; spending_entity_id?: string | null; status?: "APPROVED" | "CANCELED" | "DRAFT" | "SUBMITTED" | "OUT_OF_POLICY" | "VOID" | "SPLIT" | "SETTLED" | null; submitted_at?: string | null; trip_id?: string | null; updated_at: string; usd_equivalent_amount?: { amount: number; currency: string | null; } | null; user?: { department_id?: string | null; first_name: string; id: string; last_name: string; location_id?: string | null; } | null; user_id?: string | null; }>


list(query?, options?): PagePromise<{ items: object[]; next_cursor?: string | null; }>

Defined in: src/expenses/client.gen.ts:40

List card expenses

This endpoint is deprecated. Use the “List expenses” (GET /v1/expenses) endpoint instead.

GET /v1/expenses/card — requires OAuth scope: expenses.card.readonly, expenses.card Await for a single page, or for await to iterate items across all pages.

string[] | null

string | null

Description

The cursor to use for pagination. This is the next_cursor value returned from the previous response.

string[] | null

Description

Get additional details for the expense, e.g. merchant mcc code, by passing in expand[]=merchant. Query parameters include location, department, merchant, receipts.download_uris, user, budget, payment, spending_entity and policy.

Example

?expand[]=merchant&expand[]=location

number | null

Description

Controls the maximum number of expenses returned in the response, can’t be greater than 100

boolean | null

Description

Load custom fields for the expenses.

string[] | null

Description

Get itemized expenses belong to provided parent expenses ID(s).

string | null

Description

Shows only expenses with a payment_posted_at on or before this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-10T23:59:59.999

string | null

Description

Shows only expenses with a payment_posted_at on or after this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-01T23:59:59.999

("NOT_STARTED" | "PROCESSING" | "CANCELED" | "DECLINED" | "CLEARED" | "REFUNDING" | "REFUNDED" | "CASH_ADVANCE" | "CREDITED" | "AWAITING_PAYMENT" | "SCHEDULED")[] | null

string | null

Description

Shows only expenses with a purchased_at on or before this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-10T23:59:59.999

string | null

Description

Shows only expenses with a purchased_at on or after this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-01T23:59:59.999

string[] | null

("APPROVED" | "CANCELED" | "DRAFT" | "SUBMITTED" | "OUT_OF_POLICY" | "VOID" | "SPLIT" | "SETTLED")[] | null

string | null

Description

Shows only expenses with a updated_at on or before this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-10T23:59:59.999

string | null

Description

Shows only expenses with a updated_at on or after this date-time. This parameter is the date-time notation as defined by RFC 3339, section 5.6, e.g. 2022-11-12T23:59:59.999

Example

2023-01-01T23:59:59.999

string[] | null

Description

Get expenses belong to provided user(s).

RequestOptions

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


update(expenseId, body, options?): Promise<{ billing_amount?: { amount: number; currency: string | null; } | null; budget_id?: string | null; category?: "GROCERY" | "TELEPHONY" | "OFFICE_SUPPLIES" | "PRIVATE_AIR_TRAVEL" | "CLOTHING" | "CAR_RENTAL" | "VEHICLE_EXPENSES" | "RESTAURANTS" | "GAMBLING" | "FLOWERS" | "ELECTRONICS" | "LEGAL_SERVICES" | "UTILITIES" | "FURNITURE" | "LAUNDRY" | "EVENT_EXPENSES" | "SHIPPING" | "OTHER_TRAVEL_EXPENSES" | "CHARITY" | "LODGING" | "FACILITIES_EXPENSES" | "SERVERS" | "CONFERENCES" | "FOOD_DELIVERY" | "RENT" | "AIRLINE_EXPENSES" | "OTHER_BUSINESS_EXPENSES" | "CORPORATE_INSURANCE" | "DIGITAL_GOODS" | "GENERAL_MERCHANDISE" | "MEDICAL" | "PARKING_EXPENSES" | "POLITICAL_DONATIONS" | "PUBLIC_TRANSPORTATION" | "ADVERTISING_AND_MARKETING" | "BARS_AND_NIGHTLIFE" | "SOFTWARE_NON_RECURRING" | "BANK_AND_FINANCIAL_FEES" | "BOOKS_AND_NEWSPAPERS" | "CONSULTANT_AND_CONTRACTOR" | "FEES_AND_LICENSES_AND_TAXES" | "GAS_AND_FUEL" | "MEMBERSHIPS_AND_CLUBS" | "RECURRING_SOFTWARE_AND_SAAS" | "RIDESHARE_AND_TAXI" | "TOLL_AND_BRIDGE_FEES" | "TRAINING_AND_EDUCATION" | "TRAVEL_WIFI" | null; department_id?: string | null; id: string; location_id?: string | null; memo?: string | null; merchant_id?: string | null; original_amount?: { amount: number; currency: string | null; } | null; payment_status?: "NOT_STARTED" | "PROCESSING" | "CANCELED" | "DECLINED" | "CLEARED" | "REFUNDING" | "REFUNDED" | "CASH_ADVANCE" | "CREDITED" | "AWAITING_PAYMENT" | "SCHEDULED" | null; purchased_at?: string | null; status?: "APPROVED" | "CANCELED" | "DRAFT" | "SUBMITTED" | "OUT_OF_POLICY" | "VOID" | "SPLIT" | "SETTLED" | null; updated_at: string; }>

Defined in: src/expenses/client.gen.ts:58

Update an expense

Update an expense. Admin and bookkeeper have access to any expense, and regular users can only access their own.

PUT /v1/expenses/card/{expense_id} — requires OAuth scope: expenses.card

string

string | null

Description

Expense memo.

RequestOptions

Promise<{ billing_amount?: { amount: number; currency: string | null; } | null; budget_id?: string | null; category?: "GROCERY" | "TELEPHONY" | "OFFICE_SUPPLIES" | "PRIVATE_AIR_TRAVEL" | "CLOTHING" | "CAR_RENTAL" | "VEHICLE_EXPENSES" | "RESTAURANTS" | "GAMBLING" | "FLOWERS" | "ELECTRONICS" | "LEGAL_SERVICES" | "UTILITIES" | "FURNITURE" | "LAUNDRY" | "EVENT_EXPENSES" | "SHIPPING" | "OTHER_TRAVEL_EXPENSES" | "CHARITY" | "LODGING" | "FACILITIES_EXPENSES" | "SERVERS" | "CONFERENCES" | "FOOD_DELIVERY" | "RENT" | "AIRLINE_EXPENSES" | "OTHER_BUSINESS_EXPENSES" | "CORPORATE_INSURANCE" | "DIGITAL_GOODS" | "GENERAL_MERCHANDISE" | "MEDICAL" | "PARKING_EXPENSES" | "POLITICAL_DONATIONS" | "PUBLIC_TRANSPORTATION" | "ADVERTISING_AND_MARKETING" | "BARS_AND_NIGHTLIFE" | "SOFTWARE_NON_RECURRING" | "BANK_AND_FINANCIAL_FEES" | "BOOKS_AND_NEWSPAPERS" | "CONSULTANT_AND_CONTRACTOR" | "FEES_AND_LICENSES_AND_TAXES" | "GAS_AND_FUEL" | "MEMBERSHIPS_AND_CLUBS" | "RECURRING_SOFTWARE_AND_SAAS" | "RIDESHARE_AND_TAXI" | "TOLL_AND_BRIDGE_FEES" | "TRAINING_AND_EDUCATION" | "TRAVEL_WIFI" | null; department_id?: string | null; id: string; location_id?: string | null; memo?: string | null; merchant_id?: string | null; original_amount?: { amount: number; currency: string | null; } | null; payment_status?: "NOT_STARTED" | "PROCESSING" | "CANCELED" | "DECLINED" | "CLEARED" | "REFUNDING" | "REFUNDED" | "CASH_ADVANCE" | "CREDITED" | "AWAITING_PAYMENT" | "SCHEDULED" | null; purchased_at?: string | null; status?: "APPROVED" | "CANCELED" | "DRAFT" | "SUBMITTED" | "OUT_OF_POLICY" | "VOID" | "SPLIT" | "SETTLED" | null; updated_at: string; }>