curl https://api.swiftpay.cx/api/webhooks/wh_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const endpointId = "wh_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/webhooks/${endpointId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const endpoint = await response.json();
console.log(
`Endpoint ${endpoint.data.id} is ${
endpoint.data.enabled ? "active" : "inactive"
}`
);
import requests
endpoint_id = 'wh_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/webhooks/{endpoint_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
endpoint = response.json()
status = 'active' if endpoint['data']['enabled'] else 'inactive'
print(f"Endpoint is {status}")
{
"success": true,
"data": {
"id": "wh_abc123",
"url": "https://yoursite.com/webhooks/swiftpay",
"events": [
"checkout.succeeded",
"checkout.failed",
"withdrawal.paid"
],
"enabled": true,
"description": "Production webhook handler",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:00:00Z"
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Webhook endpoint not found",
"requestId": "req_abc123"
}
}
Webhooks
Get Webhook Endpoint
Retrieve a specific webhook endpoint by ID
GET
/
api
/
webhooks
/
:id
curl https://api.swiftpay.cx/api/webhooks/wh_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const endpointId = "wh_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/webhooks/${endpointId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const endpoint = await response.json();
console.log(
`Endpoint ${endpoint.data.id} is ${
endpoint.data.enabled ? "active" : "inactive"
}`
);
import requests
endpoint_id = 'wh_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/webhooks/{endpoint_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
endpoint = response.json()
status = 'active' if endpoint['data']['enabled'] else 'inactive'
print(f"Endpoint is {status}")
{
"success": true,
"data": {
"id": "wh_abc123",
"url": "https://yoursite.com/webhooks/swiftpay",
"events": [
"checkout.succeeded",
"checkout.failed",
"withdrawal.paid"
],
"enabled": true,
"description": "Production webhook handler",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:00:00Z"
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Webhook endpoint not found",
"requestId": "req_abc123"
}
}
Get Webhook Endpoint
Retrieves the details of a specific webhook endpoint.Request
Bearer token with your API key
The unique identifier of the webhook endpoint
Response
Whether the request was successful
curl https://api.swiftpay.cx/api/webhooks/wh_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const endpointId = "wh_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/webhooks/${endpointId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const endpoint = await response.json();
console.log(
`Endpoint ${endpoint.data.id} is ${
endpoint.data.enabled ? "active" : "inactive"
}`
);
import requests
endpoint_id = 'wh_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/webhooks/{endpoint_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
endpoint = response.json()
status = 'active' if endpoint['data']['enabled'] else 'inactive'
print(f"Endpoint is {status}")
{
"success": true,
"data": {
"id": "wh_abc123",
"url": "https://yoursite.com/webhooks/swiftpay",
"events": [
"checkout.succeeded",
"checkout.failed",
"withdrawal.paid"
],
"enabled": true,
"description": "Production webhook handler",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:00:00Z"
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Webhook endpoint not found",
"requestId": "req_abc123"
}
}
The webhook signing secret is never returned after initial creation for
security reasons.
⌘I