Webhooks API Examples
Subscribe to receive pending transaction events for expenses made on Brex Card
-
Register subscription to
EXPENSE_PAYMENT_UPDATED
webhook event
POST "https://platform.brexapis.com/v1/webhooks"
Requires "openid" and "offline_access" scopes to register webhook subscription
Requires "expenses.card.readonly" scope and "CARD_ADMIN" role to receive "EXPENSE_PAYMENT_UPDATED" event
REQUEST
{
"event_types": ["EXPENSE_PAYMENT_UPDATED"],
"url": "https://your-webhook.url/"
}
RESPONSE
{
"id": "subscription-id",
"url": "https://your-webhook.url/",
"event_types": [
"EXPENSE_PAYMENT_UPDATED"
],
"status": "ACTIVE"
}
- Attempt a charge on any Brex card on the account and receive an event at the webhook url
WEBHOOK EVENT PAYLOAD
{
"event_type": "EXPENSE_PAYMENT_UPDATED",
"expense_id": "expense_cl3khzfnr00000k92bdjtmmes",
"payment_status": "PENDING",
"payment_type": "PURCHASE",
"company_id": "cuacc_ckwodfq7h000801q48qqsae5k",
"amount": {
"amount": 1030,
"currency": "string"
},
"payment_description": "Schrute Farms"
}