Webhook events and delivery

Version 2026-11-16. Webhooks are flat JSON. Read event.type and event.orderNo directly; there is no data or object wrapper. Existing event names remain compatible.

Verify and acknowledge

Verify the exact raw body before JSON parsing. HMAC-SHA256 input is {timestamp}.{rawBody}, signed with the secret for the delivery environment. Header X-Mixpayer-Signature: t=SECONDS,v1=HEX. The SDK accepts a ±300-second timestamp tolerance by default; keep clocks synchronized.

Headers: X-Mixpayer-Event, X-Mixpayer-Delivery (stable event ID), X-Mixpayer-Environment. Store eventId idempotently before applying access changes. Acknowledge with any 2xx response quickly; do slow work asynchronously.

Retries

At most 5 delivery attempts, including the first. After failed attempts 1–4, retry delays are 1, 2, 4 and 8 minutes. The worker checks approximately every 20 seconds. Timeout is 12 seconds. Non-2xx responses, timeouts and transport errors retry; redirects are not followed. Delivery stops after 24 hours or after the fifth failure and is marked exhausted. Retries keep the same eventId and body, with a fresh signature timestamp. Delivery is at least once; event ordering is not guaranteed.

Match your order

Use requestId or metadata.appOrderId for your own order, and orderNo / orderId for Mixpayer. Subscription events also carry subscriptionId. Renewal events reference the latest paid order; when no new checkout exists, metadata and checkoutSessionId are inherited from the subscription’s original checkout. Sandbox uses livemode=false and environment=sandbox, its own webhook URL and its own signing secret.

payment.succeeded

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "payment.succeeded",
  "eventId": "payment.succeeded:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "amountMinor": 2900,
  "providerPaymentId": "sandbox_cs_example",
  "subscriptionId": 301
}
subscription.updated

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "subscription.updated",
  "eventId": "subscription.updated:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "subscriptionId": 301,
  "status": "active",
  "pendingPriceId": 23,
  "currentPeriodStart": "2026-11-16T08:00:00Z",
  "currentPeriodEnd": "2026-12-16T08:00:00Z",
  "trialEnd": "",
  "gracePeriodEnd": "",
  "cancelAtPeriodEnd": false
}
subscription.canceled

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "subscription.canceled",
  "eventId": "subscription.canceled:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "subscriptionId": 301,
  "status": "active",
  "pendingPriceId": 0,
  "currentPeriodStart": "2026-11-16T08:00:00Z",
  "currentPeriodEnd": "2026-12-16T08:00:00Z",
  "trialEnd": "",
  "gracePeriodEnd": "",
  "cancelAtPeriodEnd": true
}
subscription.renewed

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "subscription.renewed",
  "eventId": "subscription.renewed:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "subscriptionId": 301,
  "status": "active",
  "pendingPriceId": 0,
  "currentPeriodStart": "2026-12-16T08:00:00Z",
  "currentPeriodEnd": "2027-01-15T08:00:00Z",
  "trialEnd": "",
  "gracePeriodEnd": "",
  "cancelAtPeriodEnd": false
}
subscription.renewal_failed

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "subscription.renewal_failed",
  "eventId": "subscription.renewal_failed:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "subscriptionId": 301,
  "status": "past_due",
  "pendingPriceId": 0,
  "currentPeriodStart": "2026-11-16T08:00:00Z",
  "currentPeriodEnd": "2026-12-16T08:00:00Z",
  "trialEnd": "",
  "gracePeriodEnd": "2026-12-19T08:00:00Z",
  "cancelAtPeriodEnd": false
}
subscription.expired

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "subscription.expired",
  "eventId": "subscription.expired:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "subscriptionId": 301,
  "status": "expired",
  "pendingPriceId": 0,
  "currentPeriodStart": "2026-11-16T08:00:00Z",
  "currentPeriodEnd": "2026-12-16T08:00:00Z",
  "trialEnd": "",
  "gracePeriodEnd": "2026-12-19T08:00:00Z",
  "cancelAtPeriodEnd": false
}
refund.succeeded

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "refund.succeeded",
  "eventId": "refund.succeeded:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "refundId": 501,
  "subscriptionId": 301,
  "amountMinor": 2900,
  "reason": "Customer requested refund",
  "refundStatus": "succeeded",
  "refundedAmountMinor": 2900,
  "fullRefund": true,
  "subscriptionStatus": "active"
}
invoice.created

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "invoice.created",
  "eventId": "invoice.created:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "invoiceId": 601,
  "invoiceNo": "INV-EXAMPLE",
  "totalMinor": 2900
}
license.issued

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "license.issued",
  "eventId": "license.issued:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "licenseId": 701,
  "licenseKey": "lic_example_not_valid",
  "featureKey": "pro",
  "expiresAt": ""
}
dispute.opened

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "dispute.opened",
  "eventId": "dispute.opened:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "disputeId": 901,
  "amountMinor": 2900,
  "reason": "customer_dispute"
}
usage.billed

Illustrative test identifiers. Validate fields by type rather than hard-coded IDs.

{
  "type": "usage.billed",
  "eventId": "usage.billed:example",
  "schemaVersion": "2026-11-16",
  "createdAt": "2026-11-16T08:00:00Z",
  "environment": "sandbox",
  "livemode": false,
  "orderId": 8001,
  "orderNo": "20261116080000123456789012",
  "productId": 26,
  "priceId": 22,
  "customerId": "user_123",
  "orderAmountMinor": 2900,
  "currency": "USD",
  "checkoutSessionId": "cs_example",
  "requestId": "app-order-1001",
  "metadata": {
    "appOrderId": "1001",
    "plan": "pro"
  },
  "purchaseQuantity": 1,
  "unitAmountMinor": 2900,
  "volumeDiscountMinor": 0,
  "volumeDiscountPercent": 0,
  "entitlementUnits": 0,
  "recurringAmountMinor": 2900,
  "customAmountMinor": 0,
  "customGrantMode": "",
  "usageBillId": 801,
  "subscriptionId": 301,
  "meterCode": "api_calls",
  "quantity": 100,
  "amountMinor": 100,
  "periodStart": "2026-11-01T00:00:00Z",
  "periodEnd": "2026-12-01T00:00:00Z",
  "status": "draft"
}

Cancellation and refund semantics

A cancellation request sets cancelAtPeriodEnd=true; status can remain active while the paid period is valid. A second subscription.canceled event can indicate the actual period end with status=canceled. Only confirmed refund.succeeded means a refund completed; a refund request or failure is not a completed refund. Partial refunds must be considered separately from full access revocation.

Test every step

Open a sandbox checkoutUrl to test success, decline and cancellation. Call simulate-renewal on a sandbox subscription to generate a renewal payment and subscription.renewed. Call the refund API with a sandbox order to generate refund.succeeded without sending money or contacting a live provider. Query resources to reconcile after receiving or missing a notification.