Skip to main content
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

Authorization
string
required
Bearer token with your API key
id
string
required
The unique identifier of the webhook endpoint

Response

success
boolean
Whether the request was successful
data
object
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.