---
title: "Add a webhook destination, active at once (its secrets are shown in the console only)"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.recette.maeck.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a webhook destination, active at once (its secrets are shown in the console only)

Path: API de l'orchestrateur de paiement › merchant webhooks

`POST /v1/webhook-endpoints`

url: a public https address (domain name, port 443, no credentials), otherwise 422 WEBHOOK_URL_NOT_ALLOWED. The destination is active at once and each sending is signed. The signing secret and the token of the Webhook-Token header are never returned by the API: a person takes them in the console, once (tokenVersion is null until then). The key also needs the right to read what is sent: payments:read (every event carries its payment), with alerts:read for the alerts, chargebacks:read for the chargebacks and apps:read for the applications. Added with a test key (testOnly): events of test payments only. With an actor of type mcp_agent: pending_confirmation, nothing is sent until a person confirms in the console. The address may carry a query (?token=…): sealed at once, never returned (url keeps the host and the path, urlHasQuery tells it). recap (off, hour or day): webhook transactions.recap with the payments of the period, page by page. The owners of the company are told by e-mail of each new destination. At most 5 destinations per company. A key bound to one site asks for the events of this site only.

## Authentication

- `cmsHmac`, apiKey, in header, header `Authorization`

## Header parameters

- `Idempotency-Key` (`post/v1/webhook-endpoints.header.Idempotency-Key`; string, required) — Mandatory on every POST. Same key and same request: the stored answer is replayed (Idempotent-Replayed: true); another request: IDEMPOTENCY_KEY_REUSED; still running: IDEMPOTENCY_IN_PROGRESS (409, Retry-After).
  - pattern: `^(?!alert:|external:)[A-Za-z0-9_.:-]{8,255}$`
- `Api-Version` (`post/v1/webhook-endpoints.header.Api-Version`; string, optional) — Version of the API: absent, the current version answers; an unknown value is refused (API_VERSION_UNSUPPORTED, 400). Every other answer gives the version that produced it.
  - one of `"2026-11-18"` · default: `"2026-11-18"`

## Request body

_Required._

- `url` (`post/v1/webhook-endpoints.url`; string, required)
  - maxLength: `2048` · minLength: `1`
- `eventTypes` (`post/v1/webhook-endpoints.eventTypes`; array of string, required)
  - one of `"payment.succeeded"`, `"payment.failed"`, `"payment.requires_action"`, `"payment.refunded"`, `"payment.refund_failed"`, `"payment.voided"`, `"payment.review_required"`, `"post_purchase.succeeded"`, `"post_purchase.failed"`, `"chargeback.alert"`, `"renewal.declined"`, `"renewal.retry_scheduled"`, `"renewal.retry_failed"`, `"renewal.stopped"`, `"renewal.recovered"`, `"renewal.paused"`, `"chargeback_alert.received"`, `"chargeback_alert.action_required"`, `"chargeback_alert.refunded"`, `"chargeback_alert.refund_failed"`, `"chargeback_alert.declined"`, `"chargeback_alert.network_resolved"`, `"chargeback_alert.closed"`, `"chargeback.opened"`, `"chargeback.updated"`, `"chargeback.won"`, `"chargeback.lost"`, `"card_verification.requires_action"`, `"card_verification.succeeded"`, `"card_verification.failed"`, `"card_verification.released"`, `"card_verification.release_failed"`, `"mid.updated"`, `"mid.charges_moved"`, `"apple_pay_certificate.activated"`, `"apple_pay_certificate.expiring"`, `"apple_pay_certificate.expired"`, `"apple_pay_certificate.retired"`, `"card_entry.attestation_expiring"`, `"card_entry.attestation_expired"`, `"security.sensitive_change"`, `"application.activated"`, `"application.deactivated"`, `"card_import.started"`, `"card_import.completed"`, `"card_import.failed"`, `"card_import.canceled"`
- `actor` (`post/v1/webhook-endpoints.actor`; object, required)
  - `type` (`post/v1/webhook-endpoints.actor.type`; string, required)
    - one of `"engine_user"`, `"mcp_agent"`, `"system"`
  - `id` (`post/v1/webhook-endpoints.actor.id`; string, required)
    - pattern: `^[A-Za-z0-9_.:@-]{1,128}$`
  - `label` (`post/v1/webhook-endpoints.actor.label`; string, optional)
    - maxLength: `200` · minLength: `1` · pattern: `^[^\p{Cc}]*$`
- `siteRef` (`post/v1/webhook-endpoints.siteRef`; string, optional)
  - maxLength: `64` · minLength: `1`
- `recap` (`post/v1/webhook-endpoints.recap`; string, optional)
  - one of `"off"`, `"hour"`, `"day"` · default: `"off"`

## Example request

```json
{
  "url": "string",
  "eventTypes": [
    "payment.succeeded"
  ],
  "siteRef": "string",
  "recap": "off",
  "actor": {
    "type": "engine_user",
    "id": "string",
    "label": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/v1/webhook-endpoints' \
  --header 'Authorization: <Authorization>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --data '
{
  "url": "string",
  "eventTypes": [
    "payment.succeeded"
  ],
  "siteRef": "string",
  "recap": "off",
  "actor": {
    "type": "engine_user",
    "id": "string",
    "label": "string"
  }
}
'
```

### TypeScript

```typescript
const url = '<base-url>/v1/webhook-endpoints';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    Authorization: '<Authorization>'
  },
  body: JSON.stringify({
    url: 'string',
    eventTypes: ['payment.succeeded'],
    siteRef: 'string',
    recap: 'off',
    actor: {type: 'engine_user', id: 'string', label: 'string'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/v1/webhook-endpoints"

payload = {
    "url": "string",
    "eventTypes": ["payment.succeeded"],
    "siteRef": "string",
    "recap": "off",
    "actor": {
        "type": "engine_user",
        "id": "string",
        "label": "string"
    }
}
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "Authorization": "<Authorization>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Default Response

#### Example

```json
{
  "endpointId": "string",
  "url": "string",
  "urlHasQuery": true,
  "eventTypes": [
    "payment.succeeded"
  ],
  "status": "pending_confirmation",
  "siteRef": "string",
  "host": "string",
  "testOnly": true,
  "recap": "off",
  "secretVersion": -9007199254740991,
  "tokenVersion": -9007199254740991,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
```

- `endpointId` (`post/v1/webhook-endpoints.response.201.endpointId`; string, required)
- `url` (`post/v1/webhook-endpoints.response.201.url`; string, required)
- `urlHasQuery` (`post/v1/webhook-endpoints.response.201.urlHasQuery`; boolean, required)
- `eventTypes` (`post/v1/webhook-endpoints.response.201.eventTypes`; array of string, required)
  - one of `"payment.succeeded"`, `"payment.failed"`, `"payment.requires_action"`, `"payment.refunded"`, `"payment.refund_failed"`, `"payment.voided"`, `"payment.review_required"`, `"post_purchase.succeeded"`, `"post_purchase.failed"`, `"chargeback.alert"`, `"renewal.declined"`, `"renewal.retry_scheduled"`, `"renewal.retry_failed"`, `"renewal.stopped"`, `"renewal.recovered"`, `"renewal.paused"`, `"chargeback_alert.received"`, `"chargeback_alert.action_required"`, `"chargeback_alert.refunded"`, `"chargeback_alert.refund_failed"`, `"chargeback_alert.declined"`, `"chargeback_alert.network_resolved"`, `"chargeback_alert.closed"`, `"chargeback.opened"`, `"chargeback.updated"`, `"chargeback.won"`, `"chargeback.lost"`, `"card_verification.requires_action"`, `"card_verification.succeeded"`, `"card_verification.failed"`, `"card_verification.released"`, `"card_verification.release_failed"`, `"mid.updated"`, `"mid.charges_moved"`, `"apple_pay_certificate.activated"`, `"apple_pay_certificate.expiring"`, `"apple_pay_certificate.expired"`, `"apple_pay_certificate.retired"`, `"card_entry.attestation_expiring"`, `"card_entry.attestation_expired"`, `"security.sensitive_change"`, `"application.activated"`, `"application.deactivated"`, `"card_import.started"`, `"card_import.completed"`, `"card_import.failed"`, `"card_import.canceled"`
- `status` (`post/v1/webhook-endpoints.response.201.status`; string, required)
  - one of `"pending_confirmation"`, `"active"`, `"disabled"`
- `siteRef` (`post/v1/webhook-endpoints.response.201.siteRef`; string | null, required)
- `host` (`post/v1/webhook-endpoints.response.201.host`; string, required)
- `testOnly` (`post/v1/webhook-endpoints.response.201.testOnly`; boolean, required)
- `recap` (`post/v1/webhook-endpoints.response.201.recap`; string, required)
  - one of `"off"`, `"hour"`, `"day"`
- `secretVersion` (`post/v1/webhook-endpoints.response.201.secretVersion`; any of, required)
  - any of the following: `integer`, `null`
- `tokenVersion` (`post/v1/webhook-endpoints.response.201.tokenVersion`; any of, required)
  - any of the following: `integer`, `null`
- `createdAt` (`post/v1/webhook-endpoints.response.201.createdAt`; string, required)
  - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
- `updatedAt` (`post/v1/webhook-endpoints.response.201.updatedAt`; string, required)
  - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`

### default

Problem: the stable code is in code, see x-error-catalog.

#### Example

```json
{
  "type": "string",
  "title": "string",
  "status": 400,
  "code": "AMOUNT_LIMIT_EXCEEDED",
  "detail": "string",
  "requestId": "string",
  "retryable": true,
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `type` (`post/v1/webhook-endpoints.response.default.type`; string, required)
- `title` (`post/v1/webhook-endpoints.response.default.title`; string, required)
- `status` (`post/v1/webhook-endpoints.response.default.status`; integer, required)
  - maximum: `599` · minimum: `400`
- `code` (`post/v1/webhook-endpoints.response.default.code`; string, required)
  - one of `"AMOUNT_LIMIT_EXCEEDED"`, `"AMOUNT_MISMATCH"`, `"API_VERSION_UNSUPPORTED"`, `"AUTH_IP_NOT_ALLOWED"`, `"AUTH_KEY_INVALID"`, `"AUTH_MALFORMED"`, `"AUTH_NONCE_REPLAYED"`, `"AUTH_SCOPE_FORBIDDEN"`, `"AUTH_SIGNATURE_INVALID"`, `"AUTH_TIMESTAMP_OUT_OF_WINDOW"`, `"BAD_REQUEST"`, `"CAMPAIGN_MISMATCH"`, `"CARD_BRAND_UNSUPPORTED"`, `"CARD_CVC_INVALID"`, `"CARD_EXPIRED"`, `"CARD_EXPIRY_INVALID"`, `"CARD_HOLDER_INVALID"`, `"CARD_NOT_ACCEPTED"`, `"CARD_NUMBER_INVALID"`, `"CARD_REF_INVALID"`, `"CARD_REF_USED"`, `"CARD_TOKEN_REVOKED"`, `"CARD_VERIFICATION_NOT_AVAILABLE"`, `"CONFLICT"`, `"CONNECTOR_ACCOUNT_MISMATCH"`, `"CONNECTOR_AUTH_FAILED"`, `"CONNECTOR_CAPABILITY_MISSING"`, `"CONNECTOR_DISABLED"`, `"CONNECTOR_ERROR"`, `"CONNECTOR_UNAVAILABLE"`, `"CUSTOMER_DATA_REQUIRED"`, `"IDEMPOTENCY_IN_PROGRESS"`, `"IDEMPOTENCY_KEY_INVALID"`, `"IDEMPOTENCY_KEY_MISSING"`, `"IDEMPOTENCY_KEY_REUSED"`, `"INTERNAL_ERROR"`, `"LIVE_MODE_DISABLED"`, `"METHOD_NOT_ALLOWED"`, `"MID_PAUSED"`, `"MID_TRANSFER_NOT_POSSIBLE"`, `"NOT_FOUND"`, `"ORIGIN_NOT_ALLOWED"`, `"PAGE_CARD_ENTRY_DISABLED"`, `"PAYLOAD_TOO_LARGE"`, `"PAYMENT_INVALID_STATE"`, `"PAYMENT_IN_PROGRESS"`, `"PAYMENT_METHOD_NOT_ALLOWED"`, `"POST_PURCHASE_LIMIT_REACHED"`, `"POST_PURCHASE_STEP_DONE"`, `"POST_PURCHASE_TOKEN_INVALID"`, `"POST_PURCHASE_WINDOW_CLOSED"`, `"PROCESSOR_NOT_ENABLED"`, `"RATE_LIMITED"`, `"REFUND_EXCEEDS_CAPTURED"`, `"REFUND_NOT_SUPPORTED"`, `"RENEWAL_ALREADY_PAID"`, `"RENEWAL_RETRY_NOT_ALLOWED"`, `"RENEWAL_RETRY_TOO_EARLY"`, `"REQUEST_ORIGIN_FORBIDDEN"`, `"RISK_VELOCITY_LIMIT"`, `"SANDBOX_ONLY"`, `"SERVER_CARD_ENTRY_DISABLED"`, `"SERVICE_UNAVAILABLE"`, `"SESSION_EXPIRED"`, `"SESSION_INVALID_STATE"`, `"SESSION_LIMIT_REACHED"`, `"SESSION_SECRET_INVALID"`, `"SITE_DISABLED"`, `"SITE_UNKNOWN"`, `"TEST_CARD_REQUIRED"`, `"TEST_KEY_LIVE_REQUEST"`, `"UNSUPPORTED_CURRENCY"`, `"UNSUPPORTED_MEDIA_TYPE"`, `"VALIDATION_FAILED"`, `"VOID_NOT_SUPPORTED"`, `"WALLET_AMOUNT_MISMATCH"`, `"WALLET_MERCHANT_VALIDATION_FAILED"`, `"WALLET_NOT_AVAILABLE"`, `"WALLET_TOKEN_INVALID"`, `"WEBHOOK_URL_NOT_ALLOWED"`, `"ZERO_AMOUNT_REQUIRES_AUTHORIZE_ONLY"`
- `requestId` (`post/v1/webhook-endpoints.response.default.requestId`; string, required)
- `retryable` (`post/v1/webhook-endpoints.response.default.retryable`; boolean, required)
- `detail` (`post/v1/webhook-endpoints.response.default.detail`; string, optional)
- `errors` (`post/v1/webhook-endpoints.response.default.errors`; array of object, optional)
  - `path` (`post/v1/webhook-endpoints.response.default.errors.path`; string, required)
  - `code` (`post/v1/webhook-endpoints.response.default.errors.code`; string, required)
  - `message` (`post/v1/webhook-endpoints.response.default.errors.message`; string, required)


Source: https://docs.recette.maeck.xyz/api/webhook-endpoints/create/index.md
