https://sandbox.cdp.coinbase.com
Prerequisites
Before you begin, you’ll need:CDP CLI
CDP CLI
Install the CDP CLI (requires Node.js 22+):Configure a Sandbox environment using your CDP Secret API Key JSON file from the CDP Portal:
TypeScript SDK
TypeScript SDK
Install the SDK (requires Node.js 22+):Export your API key credentials. Initialize the client pointed at Sandbox:
CdpClient reads them from the environment automatically:main.ts
A funded Sandbox account
A funded Sandbox account
See the Custodial Accounts Quickstart for setting up a Sandbox account with funds.Set the account ID:
1. Create a transfer to a crypto address
Send USDC from the funded account to an external on-chain address. In Sandbox, use these reserved addresses to test specific outcomes:
Send to the success address:
- CDP CLI
- TypeScript SDK
Example response
Example response
Reserved address failure responses
Use the same create-transfer payload as the success example and replace onlytarget.address to test deterministic Sandbox failures:
- Invalid target
- Invalid address
- Unsupported network
Address:
0x2222222222222222222222222222222222222222Expected response: HTTP 4002. Create a transfer to an email
Send USDC to a Coinbase user by email. In Sandbox, use these reserved test emails to avoid privacy issues with real addresses:
Send to the success email:
- CDP CLI
- TypeScript SDK
Reserved email failure responses
Use the reserved email addresses to exercise validation, synchronous execution, and asynchronous failure paths.- Invalid email target
- Execution failure
- Async failure
Use
sandboxinvalidtarget@domain.com with execute: true.Expected response: HTTP 4003. Create a fiat withdrawal to a payment method
Withdraw USD from the account to a bank-rail payment method (Fedwire, SWIFT, or SEPA). The rail is determined by the payment method itself. Sandbox auto-provisions mock payment methods on every entity. List them and pick one to use:- CDP CLI
- TypeScript SDK
4. Validate before executing
UsevalidateOnly: true to verify recipient details before committing a transfer. This is useful for preflight checks on user-entered addresses or emails:
- CDP CLI
- TypeScript SDK
200 response means the transfer would succeed. A 4xx response contains an errorType explaining why validation failed.
validateOnly and execute are mutually exclusive. Do not set both to true.5. Check transfer status
Poll the transfer to see its current status:- CDP CLI
- TypeScript SDK
6. Handle webhooks
In production, subscribe topayments.transfers.* events to receive real-time status updates rather than polling. See Webhooks for setup.
Events fired for a successful transfer:
payments.transfers.processing, transfer is executingpayments.transfers.completed, transfer succeeded
payments.transfers.processing, transfer is executingpayments.transfers.failed, transfer failed; inspectfailureReason
7. List transfers
View all transfers for your entity:- CDP CLI
- TypeScript SDK
Move to production
To run this flow on real rails, switch from the Sandbox base URL to the production base URL and use a production API key. Production transfers move real funds: crypto targets settle on-chain, email targets credit real Coinbase users, and payment method targets execute on Fedwire, SWIFT, or SEPA.What to read next
Transfers overview
Transfer types, fee quotes, travel rule, and lifecycle
Deposit Destinations
Receive inbound crypto into a custodial account
Webhooks
Subscribe to real-time transfer status events
REST API reference
Create, execute, list, and get transfers