Setup
Prerequisites
A Secret API Key
A Secret API Key
Sign up at portal.cdp.coinbase.com, then navigate to API Keys and select Create API key under the Secret API Keys tab.
- Enter an API key nickname (restrictions are optional)
- Click Create
- Secure your API Key ID and Secret in a safe location
A webhook URL
A webhook URL
You’ll need an HTTPS URL to receive webhook events. For quick testing, webhook.site gives free temporary URLs instantly.For production, use your own HTTPS endpoint.
CDP CLI
CDP CLI
The CDP CLI handles authentication and exposes webhook subscription endpoints as typed commands (
cdp data webhooks subscriptions create, list, update, delete). For raw HTTP, use cdp api.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 Onramp event types should be included to ensure you receive notifications for every Onramp transaction state change:
| Event type | Description |
|---|---|
onramp.transaction.created | New Onramp transaction created |
onramp.transaction.updated | Onramp transaction status changed |
onramp.transaction.success | Onramp transaction completed successfully |
onramp.transaction.failed | Onramp transaction failed |
| Event type | Description |
|---|---|
offramp.transaction.created | New Offramp transaction created |
offramp.transaction.updated | Offramp transaction status changed |
offramp.transaction.success | Offramp transaction completed successfully |
offramp.transaction.failed | Offramp transaction failed |
- 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:
Webhook signature verification
Use the standard CDP webhook verification flow — the same code works for all webhook event domains. See Verify signatures for the full step-by-step implementation.Next steps
Once your subscription is created, your endpoint will begin receiving webhook events for transactions!Sample transaction event payloads
Best practices
To ensure reliable webhook delivery:- Test endpoints locally before enabling subscriptions in production
- Handle concurrent requests - ensure your target URL can process multiple events simultaneously
- Process events asynchronously - return a
200response quickly and process the event in the background - Monitor webhook receiver health - track delivery success rates to your target URL
- Set up subscription monitoring - use a scheduled job (e.g., cron, systemd timer) to periodically call the List Subscriptions API and verify critical subscriptions have
isEnabled: true
Subscriptions may be automatically disabled if your endpoint experiences sustained delivery failures (e.g., high failure rates, endpoint unavailability, or throughput issues). If this happens, fix the underlying endpoint issue and use the Update Subscription API to re-enable.