Step 1: set up budget webhooks
Before we start creating budgets, we're going to subscribe to the two budget-related webhook event types.
The first event type to subscribe to is BoxDebited
. This event is triggered when a budget is debited, whether that's due to an internal transfer of funds or an external payment.
SandboxProduction
curl -i -X POST 'https://api-sandbox.equalsmoney.com/v2/webhooks' \
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"webhookEventTypeName": "BoxDebited",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
curl -i -X POST 'https://api.equalsmoney.com/v2/webhooks' \
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"webhookEventTypeName": "BoxDebited",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
The second event type to subscribe to is BoxCredited
. This event is triggered when a budget is credited.
SandboxProduction
curl -i -X POST 'https://api-sandbox.equalsmoney.com/v2/webhooks' \
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"webhookEventTypeName": "BoxCredited",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
curl -i -X POST 'https://api.equalsmoney.com/v2/webhooks' \
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"webhookEventTypeName": "BoxCredited",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
info
For more information about webhooks and webhook event type structures, see the webhooks guide.