API endpoint mapping
Create a payment request
- Charge API
- Payment Link API
Key changes
Key changes
- Amount is now a direct string field (not nested in
local_price) - Currency is specified directly (Payment Link API currently supports USDC)
- Network specification is now explicit (defaults to
base) - Redirect URLs have been renamed for clarity
namefield is removed; usedescriptioninstead- Idempotency is supported via
X-Idempotency-Keyheader
List payment requests
- Charge API
- Payment Link API
Key changes
Key changes
- Pagination uses
pageSizeandpageTokeninstead of Commerce’s cursor-based approach - Can filter by status (ACTIVE, DEACTIVATED, EXPIRED, COMPLETED)
- Response includes
nextPageTokenfor retrieving next page
Retrieve a specific payment request
- Charge API
- Payment Link API
Key changes
Key changes
- Use the payment link ID (24-character hexadecimal format)
- No support for retrieval by code (use ID only)
Cancel/deactivate a payment request
- Charge API
- Payment Link API
Key changes
Key changes
- Explicit deactivation endpoint available
- Deactivated payment links cannot accept further payments
- Status changes to
DEACTIVATED
Response schema mapping
Payment details
| Charge API Field | Payment Link API Field | Notes |
|---|---|---|
id | id | Format changed from UUID to 24-character hexadecimal |
code | N/A | Code not available in Payment Link API |
hosted_url | url | The shareable payment URL |
name | description | Name field replaced by description |
description | description | Same purpose |
pricing.local.amount | amount | Flattened structure |
pricing.local.currency | currency | Flattened structure |
| N/A | network | New field specifying blockchain network |
| N/A | address | New field with destination blockchain address |
| N/A | tokenAddress | New field with token contract address |
expires_at | expiresAt | Same purpose, RFC 3339 format |
metadata | metadata | Same purpose |
redirect_url | successRedirectUrl | Renamed for clarity |
cancel_url | failRedirectUrl | Renamed for clarity |
created_at | createdAt | Same purpose, RFC 3339 format |
| N/A | updatedAt | New field tracking last update |
timeline | status | Status now a single field instead of timeline array |
web3_data | N/A | Transaction details handled differently |
Status mapping
Understanding status transitions is crucial for order fulfillment:| Charge API Status | Payment Link API Status | Description |
|---|---|---|
| NEW | ACTIVE | Payment request is active and awaiting payment |
| SIGNED | ACTIVE | In Payment Link, signing happens within the payment flow |
| PENDING | (Check via transaction monitoring) | Payment detected, awaiting confirmation |
| COMPLETED | COMPLETED | Payment confirmed and finalized |
| EXPIRED | EXPIRED | Payment request expired without payment |
| FAILED | (Handled via monitoring) | Payment attempt failed |
| N/A | DEACTIVATED | Payment link manually deactivated |
Important considerations:
- Payment Link API focuses on the link status, not individual transaction status
- Monitor payments using the blockchain address provided in the response
- Consider integrating with webhooks or polling the address for transaction updates
- Once a payment is detected and confirmed, the status changes to
COMPLETED
Webhooks
Charge API webhooks
Commerce provides webhook events:charge:createdcharge:pendingcharge:confirmedcharge:failed
Payment Link API webhooks
Currently, Payment Link API does not have built-in webhook support. Consider these alternatives:- Polling: Periodically check payment link status via GET endpoint
- Blockchain Monitoring: Monitor the provided blockchain address for incoming transactions
- Transaction History: Use Coinbase Business API to monitor transaction history
Webhook support for Payment Link API may be added in future updates. Check the latest documentation for updates.
Node.js implementation examples
- Charge API
- Payment Link API