docs

Create a webhook endpoint

Creates a new webhook endpoint. The response includes the signing secret which is only shown once. Store it securely to verify webhook signatures.

POST
/webhook-endpoints

Creates a new webhook endpoint. The response includes the signing secret which is only shown once. Store it securely to verify webhook signatures.

AuthorizationBearer <token>

API key for merchant integrations. Send as Authorization: Bearer <your key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/webhook-endpoints" \  -H "Content-Type: application/json" \  -d '{    "url": "https://example.com/webhooks",    "enabledEvents": [      "charge.succeeded",      "payment_intent.created"    ]  }'
{
  "id": "we_abc123def456",
  "object": "webhook_endpoint",
  "url": "https://example.com/webhooks",
  "description": "Production webhook",
  "status": "enabled",
  "enabledEvents": [
    "charge.succeeded",
    "payment_intent.created"
  ],
  "livemode": false,
  "secret": "whsec_abc123def456ghi789",
  "metadata": {
    "environment": "production"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
Empty