Step 2: set up recipient webhooks
Next, we're going to subscribe to the two recipient-related webhooks.
The first event type to subscribe to is RecipientCreated
. This event is triggered when a recipient is created in both sandbox and production.
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": "RecipientCreated",
"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": "RecipientCreated",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
The second event type to subscribe to is RecipientDeleted
. This event is triggered when a recipient is deleted in both sandbox and production.
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": "RecipientDeleted",
"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": "RecipientDeleted",
"accountId": "{accountId}",
"url": "{webhookUrl}",
"enabled": true
}'
info
For more information about webhooks and webhook event type structures, see the webhooks guide.