Step 1: set up the card webhook
Now that we've created cards and they're ready to use, we're going to subscribe to the CardTransaction
webhook event type. This event is triggered when a card transaction occurs.
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": "CardTransaction",
"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": "CardTransaction",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
info
For more information about webhooks and webhook event type structures, see the webhooks guide.