Skip to main content
Checkout webhooks provide your app with real-time payment status updates. By subscribing your webhook endpoint you will receive a notification every time a checkout status changes.
Checkout payment confirmation is asynchronous. After the customer pays, they may return to your successRedirectUrl while the checkout is still ACTIVE. Fulfill when you receive checkout.payment.success (or poll Get Checkout to a terminal status) — not on the redirect alone.

Setup

Prerequisites

You will need:
  • Your CDP API Key ID and secret
  • A webhook notification HTTPS URL
  • Install the CDP CLI and run cdp env live --key-file ./cdp_api_key.json once to configure credentials.

Create a webhook subscription

  1. Review the configuration you’ll submit:
Important configuration notes:
  • target.url should be your webhook endpoint that will receive the events
  • You can also set a headers object in target if your url requires specific headers. Pass it inline with 'target.headers:={"custom-header":"value"}'.
  • All Checkout event types should be included to ensure you receive notifications for every checkout state change:
  1. Create the webhook subscription with the CDP CLI:
Response:

Manage subscriptions

Use the subscriptionId from the response to view, update, or delete the subscription. List all subscriptions
View specified subscription details by subscription ID
Update subscription update is a full replace — pass every field, including ones you aren’t changing:
Delete subscription
List subscription events View delivery attempts for a subscription, including delivery status, retry count, and HTTP response details:
You can narrow results with the following optional query parameters: Results are limited to the 50 most recent events, returned newest first. Example with filters:

Webhook signature verification

Verify webhook signatures to ensure that requests are authentic. This protects your application from forged webhooks and potential security threats.

How it works

When you create a webhook subscription, the response includes a top-level secret. Use this value to verify that incoming webhooks are authentic. Each webhook request includes an X-Hook0-Signature header containing:
  • t field - the timestamp
  • h field - list of headers included in the signature
  • v1 field - the signature

Implementation

Here’s an example of how to verify webhook signatures:
Node.js
And in your application:
Node.js

Next steps

Once your subscription is created, your endpoint will begin receiving webhook events for checkouts!

Sample checkout event payloads