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.jsononce to configure credentials.
Create a webhook subscription
- Review the configuration you’ll submit:
-
target.urlshould be your webhook endpoint that will receive the events -
You can also set a
headersobject intargetif 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:
- Create the webhook subscription with the CDP CLI:
Manage subscriptions
Use thesubscriptionId from the response to view, update, or delete the subscription.
List all subscriptions
update is a full replace — pass every field, including ones you aren’t changing:
Results are limited to the 50 most recent events, returned newest first. Example with filters:
Webhook signature verification
How it works
When you create a webhook subscription, the response includes a top-levelsecret. Use this value to verify that incoming webhooks are authentic.
Each webhook request includes an X-Hook0-Signature header containing:
tfield - the timestamphfield - list of headers included in the signaturev1field - the signature
Implementation
Here’s an example of how to verify webhook signatures:Node.js
Node.js