Webhooks
Overview
Webhooks enable notifications to be made for a variety of events within the CXTN API. To enable webhooks, contact us first.
Step 1. Activate Webhooks
To enable webhooks on the account call POST - Enable Webhooks
.
Step 2. Create a Webhook
To create a webhook:
- Call
POST - Create Webhook Endpoint
- Enter the corresponding
EventType
value. - Enter the
EndpointURL
to receive notifications.
Value | EventType | Active/Inactive | Event - Notification |
---|---|---|---|
0 | Trade | Inactive | null |
1 | Payment | Active | Payment Completed - Payment received by beneficiary. |
2 | AccountTransaction | Active | Funds received - Account credit received from sender. |
3 | Wallet | Inactive | null |
4 | Card | Inactive | null |
5 | Quote | Inactive | null |
6 | BulkPayments | Inactive | null |
REQUEST
curl --location 'https://caxapi-integration.azurewebsites.net/api//webhooks/endpoints' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"WebhookEventType": "Wallets",
"EndpointUrl": "https://webhook.site/9ed441e2-9890-86gb-p989-5678910111213"
}'
RESPONSE
{
"Content": {
"Model": {
"ApiStatusCode": 100,
"ApiStatus": "IsValid",
"ApiStatusDescription": "Valid Operation"
},
"ExpectedResponses": [
"IsValid"
]
},
"AuthorisedClientModel": {
"ClientId": "<clientid>",
"ClientRef": "<clientref>",
"ApiStatusCode": 100,
"ApiStatus": "IsValid",
"ApiStatusDescription": "Valid Operation"
},
"AuthorisedUserModel": {
"UserId": "<userid>",
"AppVersion": "20231117.1",
"TokenStartDate": "2023-11-21T00:00:00",
"TokenEndDate": "2023-12-21T00:00:00",
"LoginTimestamp": "2023-12-01T20:43:29.7267638",
"ApiLoginType": 1,
"ApiStatusCode": 100,
"ApiStatus": "IsValid",
"ApiStatusDescription": "Valid Operation"
}
}
Edit Webhook Endpoint
Individual endpoints can be edited to change the URL by calling the PUT - Edit Webhook Endpoint
and specifying the WebhookEventType
.
Toggle Webhook Endpoint Status
Individual webhooks can be set to 'Active', 'Inactive', or 'Paused' via the PUT - Update Webhook Endpoint Status
endpoint.
Deactivate Webhooks
To deactivate all webhooks call the PUT - DeActivate Webhook
endpoint.
Get Webhook Endpoints
To get a list of all webhooks, call GET - Retrieve Webhook Endpoints
.
Updated about 1 month ago