Skip to main content
GET
https://api.swiftpay.cx
/
api
/
webhooks
/
events
curl "https://api.swiftpay.cx/api/webhooks/events?limit=10" \
  -H "Authorization: Bearer mp_live_your_api_key"
{
  "success": true,
  "data": {
    "events": [
      {
        "id": "evt_abc123",
        "eventId": "sess_xyz789",
        "eventType": "checkout.succeeded",
        "payload": {
          "id": "sess_xyz789",
          "amount": 10000,
          "currency": "USD"
        },
        "createdAt": "2024-01-15T10:30:00Z",
        "deliveries": [
          {
            "id": "del_123",
            "endpointId": "wh_abc123",
            "endpointUrl": "https://yoursite.com/webhooks",
            "status": "success",
            "attemptCount": 1,
            "maxAttempts": 5,
            "responseStatusCode": 200,
            "responseBody": "OK",
            "errorMessage": null,
            "createdAt": "2024-01-15T10:30:01Z",
            "lastAttemptAt": "2024-01-15T10:30:01Z",
            "nextRetryAt": null
          }
        ]
      }
    ]
  }
}

List Webhook Events

Returns a list of recent webhook events that have been delivered or attempted.

Request

Authorization
string
required
Bearer token with your API key
limit
integer
default:"50"
Number of results to return (1-100)

Response

success
boolean
Whether the request was successful
data
object
curl "https://api.swiftpay.cx/api/webhooks/events?limit=10" \
  -H "Authorization: Bearer mp_live_your_api_key"
{
  "success": true,
  "data": {
    "events": [
      {
        "id": "evt_abc123",
        "eventId": "sess_xyz789",
        "eventType": "checkout.succeeded",
        "payload": {
          "id": "sess_xyz789",
          "amount": 10000,
          "currency": "USD"
        },
        "createdAt": "2024-01-15T10:30:00Z",
        "deliveries": [
          {
            "id": "del_123",
            "endpointId": "wh_abc123",
            "endpointUrl": "https://yoursite.com/webhooks",
            "status": "success",
            "attemptCount": 1,
            "maxAttempts": 5,
            "responseStatusCode": 200,
            "responseBody": "OK",
            "errorMessage": null,
            "createdAt": "2024-01-15T10:30:01Z",
            "lastAttemptAt": "2024-01-15T10:30:01Z",
            "nextRetryAt": null
          }
        ]
      }
    ]
  }
}

Event Statuses

StatusDescription
pendingEvent queued for delivery
successSuccessfully delivered (received 2xx response)
failedAll retry attempts exhausted