Overview
Migrate from Commerce Charge API to the Checkouts API for improved reliability, simplified integration, modern authentication, and additional capabilities including settlement details. This guide covers the key changes and provides code examples to help you update your integration.Checkouts API requires a Coinbase Business account.
Migration summary
Migration summary
1
Update authentication
Switch from API key to JWT Bearer tokens
2
Change base URL
From
api.commerce.coinbase.com to business.coinbase.com/api/v1/checkouts3
Update request/response handling
New field names and flattened structure
4
Implement status monitoring
Use webhooks for real-time notifications or polling
5
Test thoroughly
New ID formats and status values require updates to your logic
Key differences
Checkouts API requires CDP API key authentication.
Status and field mappings
Migration checklist
1. Update authentication
- Create CDP API keys
- Implement JWT Bearer token generation
- Update API key storage and rotation procedures
- Test authentication with Checkouts API
2. Update API integration
- Update base URL to
https://business.coinbase.com/api/v1/checkouts - Modify request bodies to match new schema
- Update response parsing to handle new fields (
address,settlement,transactionHash) - Implement idempotency key generation for create requests
3. Handle status changes
- Map Charge statuses to Checkout statuses in your system
- Update order fulfillment logic for new status values
- Set up webhooks for real-time payment notifications (see Webhooks documentation)
- Update customer-facing status messages
4. Update payment flows
- Use
urlfield instead ofhosted_urlfor payment pages - Update redirect URL parameters
- Test full payment flow end-to-end
- Verify metadata is correctly passed through
5. Handle pagination
- Update list operations to use
pageSizeandpageToken - Implement
nextPageTokenhandling for multiple pages - Test pagination with large datasets
6. Test and validate
- Consider testing your integration with the sandbox environment
- Verify amount calculations (ensure proper decimal handling)
- Test expired checkout scenarios
- Test deactivation flow
- Verify metadata preservation
- Test redirect URLs
7. Monitor and observe
- Set up monitoring for API errors
- Track payment success rates
- Monitor checkout expiration rates
- Set up alerts for failed payments
What to read next
- API & Schema Mapping - Detailed endpoint and response comparisons with code examples
- FAQ - Common questions and troubleshooting