Skip to content

Webhooks API (0.1)

Brex uses webhooks to send real-time notifications when events happen in the accounts that you manage. Use webhook subscriptions to subscribe to different webhook events.

Download OpenAPI description
Languages
Servers
Production
https://api.brex.com
Staging (Note: This is not a sandbox. It will not work with customer tokens.)
https://api-staging.brex.com

Manage webhook subscriptions.

Operations

Manage webhook groups.

Operations
Schemas
Webhooks

Expense Payment Updated EventWebhook

Request

Expense activity on Brex Cards.

Security
OAuth2(Required scopes:
expenses.card.readonly
expenses.card
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
expense_idstringrequired

Unique ID associated with the expense.

versioninteger(int32)>= 0required

Version of this expense. This value starts at 1 and is incremented by 1 with every update.

Example: 1
payment_statusstring(ExpensePaymentStatus)required

PENDING:The transaction is yet to be captured. It may be approved, yet to be approved, or yet to be declined.

DECLINED: The transaction was declined.

Enum"PENDING""DECLINED"
payment_typestring(ExpensePaymentType)required

PURCHASE: A pending transaction for making a purchase.

REFUND: A pending transaction for a refund.

WITHDRAWAL: A pending transaction for a withdrawal.

DECLINED: A pending transaction that was declined and will not be completed.

Enum"PURCHASE""REFUND""WITHDRAWAL""DECLINED"
company_idstringrequired

This is the id returned in the Get Company endpoint. You can use the company_id to determine which access token to use when you get the details from our API endpoints.

purchased_atstring or null(date-time)

The time the purchase was made.

original_amountobject or null

Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700.

billing_amountobject or null

Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700.

card_idstringrequired

The ID of the card that is associated with the expense.

merchantobjectrequired

The merchant associated with the expense.

merchant.​raw_descriptorstringrequired

Merchant descriptor, it can be the merchant name.

merchant.​mccstringrequired

A four-digit number listed in ISO 18245 for retail financial services, e.g. 4121 for Taxicabs and Rideshares. Please refer to https://en.wikipedia.org/wiki/Merchant_category_code for more details.

merchant.​countrystringrequired

Merchant's country, in ISO 3166-1 alpha-3 format.

payment_status_reasonstring(PaymentStatusReason)required

The reason for the payment's status.

Enum"OTHER""APPROVED""EXCEEDED_BUDGET_LIMIT""BUDGET_EXPIRED""NO_BUDGET""BUDGET_NOT_YET_STARTED""BUDGET_CATEGORY_RESTRICTION""BUDGET_MERCHANT_RESTRICTION""SUSPECTED_FRAUD""EXCEEDED_GLOBAL_LIMIT"
payment_authorization_codestring or null

The authorization code of the associated card expense.

amountobject or nullDeprecated

Succeeded by the billing_amount field.

payment_descriptionstringDeprecatedrequired

Succeeded by the merchant::raw_descriptor field.

Responses

Return this code if the callback was received and processed successfully

Request

A referral was activated.

Security
OAuth2(Required scopes:
https://onboarding.brexapis.com/...
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
referral_idstringrequired

The referral ID

Responses

Return this code if the callback was received and processed successfully

Referral Application Status Changed EventWebhook

Request

A referral's application status changed.

Security
OAuth2(Required scopes:
https://onboarding.brexapis.com/...
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
referral_idstringrequired

The referral ID

applicationobject(ProductApplication)required

The product application details for the referral.

application.​cashstring(ApplicationStatus)required

Application status of a product.

NO_ACCOUNT - There is no active application, and the product account is not provisioned.

ACTIVE - The application is approved, and the product account is provisioned.

NOT_SUBMITTED - The application is started but not yet submitted.

INFORMATION_PENDING - The application is submitted and additional information is requested.

MANUAL_REVIEW - The application is under manual review.

PROCESSING - The application is submitted and is under review.

REJECTED - The application is rejected.

CLOSED - The product account is closed.

Enum"NO_ACCOUNT""ACTIVE""NOT_SUBMITTED""INFORMATION_PENDING""MANUAL_REVIEW""PROCESSING""REJECTED""CLOSED"

Responses

Return this code if the callback was received and processed successfully

Request

A referral was created.

Security
OAuth2(Required scopes:
https://onboarding.brexapis.com/...
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
referral_idstringrequired

The referral ID

Responses

Return this code if the callback was received and processed successfully

Request

Transfer failed events for both incoming and outgoing Brex Cash transactions.

Security
OAuth2(Required scopes:
transfers.readonly
transfers
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
transfer_idstringrequired

The transfer ID

payment_typestring(PaymentType)required

Only ACH, DOMESTIC_WIRE, CHEQUE, INTERNATIONAL_WIRE and BOOK_TRANSFER details can be retrieved from the Payments API.

Enum"ACH""DOMESTIC_WIRE""CHEQUE""INTERNATIONAL_WIRE""BOOK_TRANSFER""ACH_RETURN""WIRE_RETURN""CHEQUE_RETURN"
return_for_idstring or null

The original transaction ID that is returned when the payment type is ACH_RETURN, WIRE_RETURN and CHEQUE_RETURN.

company_idstringrequired

This is the id returned in the Get Company endpoint. You can use the company_id to determine which access token to use when you get the details from our API endpoints.

Responses

Return this code if the callback was received and processed successfully

Request

Transfer processed events for both incoming and outgoing Brex Cash transactions.

Security
OAuth2(Required scopes:
transfers.readonly
transfers
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
transfer_idstringrequired

The transfer ID

payment_typestring(PaymentType)required

Only ACH, DOMESTIC_WIRE, CHEQUE, INTERNATIONAL_WIRE and BOOK_TRANSFER details can be retrieved from the Payments API.

Enum"ACH""DOMESTIC_WIRE""CHEQUE""INTERNATIONAL_WIRE""BOOK_TRANSFER""ACH_RETURN""WIRE_RETURN""CHEQUE_RETURN"
return_for_idstring or null

The original transaction ID that is returned when the payment type is ACH_RETURN, WIRE_RETURN and CHEQUE_RETURN.

company_idstringrequired

This is the id returned in the Get Company endpoint. You can use the company_id to determine which access token to use when you get the details from our API endpoints.

Responses

Return this code if the callback was received and processed successfully

Request

Updates on Brex users.

Security
OAuth2(Required scopes:
users.readonly
users
)
Bodyapplication/jsonrequired
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
user_idstringrequired
company_idstringrequired
updated_attributesArray of strings(UserAttributes)required
Items Enum"STATUS""MANAGER_ID""DEPARTMENT_ID""LOCATION_ID"

Responses

Return this code if the callback was received and processed successfully

Accounting Record Ready for Export Events (Alpha)Webhook

Request

Accounting Record Ready for Export Events. When customer triggers an accounting export this event will be sent.

Security
OAuth2(Required scopes:
accounting.record.read
accounting.record.write
)
Bodyapplication/json
event_typestring(WebhookEventType)required
Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
accounting_record_idsArray of stringsrequired

Responses

Return this code if the callback was received and processed successfully