Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/coinbase-api/llms.txt
Use this file to discover all available pages before exploring further.
CBCommerceClient is the REST client for Coinbase Commerce — Coinbase’s payment processing platform. Use it to accept crypto payments by generating payment charges, building hosted checkout pages, and querying payment event history for webhook reconciliation.
Coinbase Commerce uses a Commerce-specific API key — separate from the CDP API keys used by the trading clients. Commerce keys are created from the Coinbase Commerce dashboard, not from the standard API Key Management page.
Installation
Instantiation
- TypeScript
- JavaScript
Charges
A charge represents a single payment request for a specific amount. Once created, you redirect the buyer to Coinbase’s hosted payment page or use the charge details to build your own payment UI.| Method | Description |
|---|---|
createCharge(params) | Create a new payment charge |
getAllCharges() | List all charges |
getCharge(params) | Get a charge by code or ID |
Create a Charge
- TypeScript
- JavaScript
List & Retrieve Charges
Checkouts
A checkout is a reusable payment page configuration. Unlike a charge (one-time use), a checkout can generate multiple charges over time — useful for recurring payment buttons or product pages.| Method | Description |
|---|---|
createCheckout(params) | Create a reusable checkout session |
getAllCheckouts() | List all checkouts |
getCheckout(params) | Get a specific checkout by ID |
Create a Checkout
- TypeScript
- JavaScript
List & Retrieve Checkouts
Events
Coinbase Commerce fires webhook events as payment states change (e.g.charge:pending, charge:confirmed, charge:failed). The Events API lets you query these programmatically for reconciliation and debugging.
| Method | Description |
|---|---|
listEvents(headers) | List all events |
showEvent(params, headers) | Get details for a specific event |
Typical Payment Flow
Create a charge
Call
createCharge() with the amount, currency, and pricing_type. Store the returned charge id and code in your database against your order.Redirect the buyer
Send the buyer to
charge.data.hosted_url for Coinbase’s hosted payment page, or use the raw charge data to render your own UI.Receive webhooks
Coinbase Commerce will POST events to your webhook endpoint as the payment progresses through
pending → confirmed → resolved (or expired / failed).Pricing Types
pricing_type | Behaviour |
|---|---|
fixed_price | Buyer pays the exact local_price amount |
no_price | Open-ended (buyer chooses the amount — suitable for donations) |
Next Steps
Advanced Trade Client
Trading orders, portfolios, and futures
Coinbase App Client
Consumer wallet accounts and crypto prices