Skip to main content
GET
/
api
/
webhooks
curl https://api.swiftpay.cx/api/webhooks \
  -H "Authorization: Bearer mp_live_your_api_key"
const response = await fetch("https://api.swiftpay.cx/api/webhooks", {
   headers: {
      Authorization: "Bearer mp_live_your_api_key",
   },
});

const webhooks = await response.json();

webhooks.data.forEach((endpoint) => {
   console.log(`${endpoint.id}: ${endpoint.url}`);
   console.log(`  Events: ${endpoint.events.join(", ")}`);
   console.log(`  Active: ${endpoint.isActive}`);
});
import requests

response = requests.get(
    'https://api.swiftpay.cx/api/webhooks',
    headers={'Authorization': 'Bearer mp_live_your_api_key'}
)

webhooks = response.json()

for endpoint in webhooks['data']:
    print(f"{endpoint['id']}: {endpoint['url']}")
    print(f"  Events: {', '.join(endpoint['events'])}")
    print(f"  Active: {endpoint['isActive']}")
{
  "success": true,
  "data": [
    {
      "id": "wh_abc123",
      "url": "https://yoursite.com/webhooks/swiftpay",
      "events": [
        "checkout.completed",
        "checkout.failed",
        "refund.completed"
      ],
      "isActive": true,
      "description": "Production webhook handler",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "wh_def456",
      "url": "https://staging.yoursite.com/webhooks",
      "events": ["*"],
      "isActive": false,
      "description": "Staging environment",
      "createdAt": "2024-01-10T08:00:00Z"
    }
  ]
}

List Webhook Endpoints

Returns a list of all webhook endpoints configured for your business.

Request

Authorization
string
required
Bearer token with your API key

Response

success
boolean
Whether the request was successful
data
array
Array of webhook endpoint objects
curl https://api.swiftpay.cx/api/webhooks \
  -H "Authorization: Bearer mp_live_your_api_key"
const response = await fetch("https://api.swiftpay.cx/api/webhooks", {
   headers: {
      Authorization: "Bearer mp_live_your_api_key",
   },
});

const webhooks = await response.json();

webhooks.data.forEach((endpoint) => {
   console.log(`${endpoint.id}: ${endpoint.url}`);
   console.log(`  Events: ${endpoint.events.join(", ")}`);
   console.log(`  Active: ${endpoint.isActive}`);
});
import requests

response = requests.get(
    'https://api.swiftpay.cx/api/webhooks',
    headers={'Authorization': 'Bearer mp_live_your_api_key'}
)

webhooks = response.json()

for endpoint in webhooks['data']:
    print(f"{endpoint['id']}: {endpoint['url']}")
    print(f"  Events: {', '.join(endpoint['events'])}")
    print(f"  Active: {endpoint['isActive']}")
{
  "success": true,
  "data": [
    {
      "id": "wh_abc123",
      "url": "https://yoursite.com/webhooks/swiftpay",
      "events": [
        "checkout.completed",
        "checkout.failed",
        "refund.completed"
      ],
      "isActive": true,
      "description": "Production webhook handler",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "wh_def456",
      "url": "https://staging.yoursite.com/webhooks",
      "events": ["*"],
      "isActive": false,
      "description": "Staging environment",
      "createdAt": "2024-01-10T08:00:00Z"
    }
  ]
}
The webhook signing secret is never returned in list responses. If you’ve lost your secret, create a new endpoint.