Pay: webhooks

Create a webhook endpoint

POST/v1/webhook_endpoints

https:// only, checked against private, local and cloud-metadata addresses. The signing secret (whsec_…) is returned once; an idempotent replay returns secret: null. Signature: X-Signature: sha256=HMAC(secret, "{X-Timestamp}.{raw body}"), as for Alerts webhooks. At most 10 active endpoints per environment (webhook_endpoint_limit).

Authentication
API key (Authorization: Bearer)
Required scope
pay:write
  • Safe to retry with the Idempotency-Key header: see Idempotency.

Headers#

  • Idempotency-Keystringrequired

    Required on every Pay POST; makes it safe to retry for 24 hours. Scoped to the key's environment.

    1 to 255 characters

Request body#

  • urlstringrequired
    at most 2048 characters
  • event_typesarray of string

    Empty or absent: all events.

    Values invoice.created invoice.confirming invoice.paid invoice.underpaid invoice.overpaid invoice.expired invoice.paid_late invoice.canceled invoice.reverted invoice.held sweep.succeeded sweep.failed refund.succeeded refund.pending merchant.payout_change_requested merchant.payout_changed merchant.frozen merchant.kyb_updated

Responses#

201Endpoint created; secret shown once.
Object fields
  • idstring · uuid
  • objectstring
    Values webhook_endpoint
  • environmentstring
    Values test live
  • urlstring
  • event_typesarray of string
    Values invoice.created invoice.confirming invoice.paid invoice.underpaid invoice.overpaid invoice.expired invoice.paid_late invoice.canceled invoice.reverted invoice.held sweep.succeeded sweep.failed refund.succeeded refund.pending merchant.payout_change_requested merchant.payout_changed merchant.frozen merchant.kyb_updated
  • statusstring
    Values enabled disabled
  • created_atstring · date-time
  • disabled_atstring · date-timenullable
  • secretstringnullable
4xx · 5xxError.

Standard error format: see Errors.