PaybytokenDocs
Webhooks
API reference · Webhook Endpoints

Create a Webhook Endpoint

Register a destination and receive its signing secret.

POST /api/v1/webhook_endpoints

curl https://api-prod.paybytoken.io/api/v1/webhook_endpoints \
  -X POST \
  -H "Authorization: Bearer $PAYBYTOKEN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://shop.example.com/webhooks/paybytoken",
    "enabled_events": ["payment_intent.succeeded"]
  }'
ParameterTypeRequiredDescription
urlstringyesHTTP(S) delivery URL. Live mode requires a safe public HTTPS destination.
enabled_eventsstring[]noExact events or wildcards. Defaults to ["*"].
{
  "id": "we_1ZbSVMF8KXuhmXpKPXkt",
  "account_id": "acct_merchant",
  "url": "https://shop.example.com/webhooks/paybytoken",
  "enabled_events": ["payment_intent.succeeded"],
  "enabled": true,
  "secret": "whsec_...",
  "created_at": "2026-07-29T09:30:00.000Z",
  "updated_at": "2026-07-29T09:30:00.000Z"
}

Store secret immediately. It is not returned by normal endpoint retrieval. See Fulfill orders with webhooks before processing live events.

Only one webhook endpoint can exist for the merchant account in each mode. Update the existing endpoint instead of creating a second destination.

API Workbench

Full Explorer

Open in new tab