API Errors
The Payment APIs uses conventional HTTP response codes to indicate the success or failure of an API request. In general:-
Codes in the
2xxrange indicate success -
Codes in the
4xxrange indicate an error that failed given the information provided (e.g., a required parameter was omitted) -
Codes in the
5xxrange indicate an error on CDP’s backend servers.5xxerrors are not a guarantee of failure; there’s always the chance that the operation may have succeeded in our back-end. Therefore, your application should treat the operation’s status as unknown.
errorType: A machine-readable error codeerrorMessage: A human-readable message providing more detailcorrelationId: A unique identifier for the request that can help with debuggingerrorLink: A link to detailed documentation about the specific error type
HTTP 400
Authorization expired
Returned when an authorization attempt is made after the payment session’s authorization deadline has passed. Create a new payment session with a later authorization deadline. Example error response:Capture expired
Returned when a capture attempt is made after the payment session’s capture deadline has passed. The payment session can no longer be captured. Example error response:Client closed request
This error occurs when the client closes the connection before the server can send a response. Common causes:- The client timed out waiting for the server response
- The client application was terminated during a pending request
- Network interruption caused the client connection to drop
- Increase client-side timeout settings if applicable
- Implement retry logic with exponential backoff for long-running queries
- Consider optimizing the request to reduce server processing time
Invalid request
This error occurs when the request is malformed or contains invalid data, including issues with the request body, query parameters, path parameters, or headers. Steps to resolve:- Check all required fields and parameters are present
- Ensure request body (if applicable) follows the correct schema
- Verify all parameter formats match the API specification:
- Query parameters
- Path parameters
- Request headers
- Validate any addresses, IDs, or other formatted strings meet requirements
- Missing required parameters
- Invalid parameter types or formats
- Malformed JSON in request body
- Invalid enum values
Transfer-specific validation errors
The following transfer validation scenarios returnerrorType: "invalid_request". Use the errorMessage field to identify the specific case.
| Scenario | Example errorMessage |
|---|---|
| Source account ID is malformed | "source is invalid." |
| Target account ID is malformed | "target is invalid." |
| Source account does not exist | "source not found." |
| Target account does not exist | "target not found." |
| Asset not supported at source | "source is not supported." |
| Asset not supported at target | "target is not supported." |
| Target email address is malformed | "target has an invalid email format." |
| Target onchain address is invalid for network | "The recipient address is invalid for the selected network." |
| Asset not supported for this transfer route | "Transfer asset pair is not supported." |
| Insufficient balance | "Insufficient funds to complete this transfer." |
| Asset mismatch between request fields | "Currency mismatch in request." |
| Metadata has too many keys | "Metadata has too many keys. Up to 10 key/value pairs are permitted." |
| Metadata key exceeds length limit | "Metadata key is too long. Each key must be less than or equal to 40 characters." |
| Metadata value exceeds length limit | "Metadata value is too long. Each value must be less than or equal to 500 characters." |
| Travel rule fields missing | "Travel rule information is incomplete. Missing fields: ..." |
| Recipient address not in account allowlist | "Your coinbase account allowlist does not include this address. Please update your allowlist at https://www.coinbase.com/settings/allowlist" |
Payment required
This error occurs when an x402 payment is required to access the requested resource. Steps to resolve:- Include a valid x402 payment header in your request
- Ensure the payment meets the resource’s pricing requirements
Settlement failed
This error occurs when an x402 payment was verified but settlement on-chain failed. Steps to resolve:- Retry the request with a new payment
- Ensure the payment asset has sufficient balance for settlement
Request canceled
This error occurs when the client cancels an in-progress request before it completes. Steps to resolve:- Check client-side timeout configurations
- Review request cancellation logic in your code
- Consider increasing timeout thresholds for long-running operations
- Implement request tracking to identify premature cancellations
Timed out
This error occurs when a request exceeds the maximum allowed processing time. Steps to resolve:- Break down large requests into smaller chunks (if applicable)
- Implement retry logic with exponential backoff
- Use streaming endpoints for large data sets
Recipient allowlist violation
This error occurs when the user is not allowed to receive funds at this address, according to their coinbase account allowlist. Steps to resolve:- Either disable the allowlist or add the wallet address at https://www.coinbase.com/settings/allowlist
- Wait approximately 2 days for updates to take effect.
Recipient allowlist pending
This error occurs when the user is not allowed to receive funds at this address, because changes to their coinbase account allowlist are pending. Steps to resolve:- Wait approximately 2 days for updates to take effect.
Refund expired
Returned when a refund attempt is made after the payment session’s refund deadline has passed. The payment session can no longer be refunded. Example error response:Mfa already enrolled
This error occurs when attempting to enroll in an MFA method that the user has already enrolled in. Steps to resolve:- Check if the user is already enrolled in the MFA method before initiating enrollment
- To update or reset MFA, remove the existing enrollment first (if supported)
- Use a different MFA method if multiple options are available
Mfa invalid code
This error occurs when the MFA code provided is incorrect or has already been used. Steps to resolve:- Verify the user entered the correct code from their authenticator app
- Ensure the code is current (TOTP codes expire after 30 seconds)
- Check that the device time is synchronized correctly
- Ask the user to generate a new code and try again
- Typing errors in the 6-digit code
- Using an expired TOTP code
- Device clock drift on user’s authenticator app
- Attempting to reuse a previously submitted code
Mfa flow expired
This error occurs when the MFA enrollment or verification session has expired. Steps to resolve:- Restart the MFA enrollment or verification flow
- Complete the flow within the allowed time window (typically 5 minutes)
- Ensure the user doesn’t leave the flow idle for extended periods
Mfa required
This error occurs when attempting to perform a sensitive operation that requires MFA verification, but the user has not completed MFA verification. Steps to resolve:- Initiate the MFA verification flow using the
/mfa/verify/{mfaMethod}/initendpoint - Prompt the user to enter their MFA code
- Submit the verification using the
/mfa/verify/{mfaMethod}/submitendpoint - Use the returned access token with MFA claim for the sensitive operation
- Retry the original request with the new MFA-verified token
- Transactions Sign/Send
- Key export
- Account management actions (when configured)
Mfa not enrolled
This error occurs when attempting to verify MFA for a user who has not enrolled in any MFA method. Steps to resolve:- Check if the user has enrolled in MFA before attempting verification
- Guide the user through MFA enrollment first using the
/mfa/enroll/{mfaMethod}/initendpoint - Complete enrollment before requiring MFA verification
Source account invalid
This error occurs when the source account specified in the transfer request is invalid or malformed. Steps to resolve:- Verify the account ID format is correct (e.g.,
account_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) - Ensure the account ID belongs to your CDP entity
- Verify the account ID exists by calling
GET /v2/accounts/{accountId}orGET /v2/accounts
- Malformed account ID
- Typo in the account ID
Target account invalid
This error occurs when the target account specified in the transfer request is invalid or malformed. Steps to resolve:- Verify the account ID format is correct (e.g.,
account_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) - Ensure the account exists and can receive funds
- Verify the account ID exists by calling
GET /v2/accounts/{accountId}orGET /v2/accounts
- Malformed account ID
- Typo in the account ID
Source account not found
This error occurs when the source account specified in the transfer does not exist. Steps to resolve:- Verify the account ID exists by calling
GET /v2/accounts/{accountId}orGET /v2/accounts
Target account not found
This error occurs when the target account specified in the transfer does not exist. Steps to resolve:- Verify the account ID exists by calling
GET /v2/accounts/{accountId}orGET /v2/accounts
Source asset not supported
This error occurs when the asset specified in the transfer source is not supported for this transfer type. Steps to resolve:- Check the list of supported assets for the source account type
- Verify the asset symbol is correctly specified (e.g.,
usdc,usdt)
- Unsupported asset for the transfer route
- Incorrect asset symbol
Target asset not supported
This error occurs when the asset specified in the transfer target is not supported for this transfer type. Steps to resolve:- Check the list of supported assets for the target
- Verify the asset symbol is correctly specified (e.g.,
usdc,usdt) - Ensure the target can receive this asset type
- Asset not supported by the target
- Unsupported conversion between source and target assets
Target email invalid
This error occurs when the email address specified as the transfer target is invalid. Steps to resolve:- Verify the email address format is valid (e.g.,
user@example.com) - Check for typos in the email address
- Ensure the email domain is valid
- Invalid email format
- Missing @ symbol or domain
- Typo in the email address
Target onchain address invalid
This error occurs when the onchain address specified as the transfer target is invalid for the specified network. Steps to resolve:- Ensure the network is supported for the transfer type
- Verify the address format matches the target network
- Ensure you haven’t mixed up addresses from different networks
- Network not supported for the transfer type
- Address format doesn’t match network
- Address from a different blockchain network
Transfer amount invalid
This error occurs when the transfer amount is invalid. Steps to resolve:- Ensure the amount is a positive number and greater than $1 USD equivalent amount
- Verify the amount format is a valid decimal string (e.g.,
"100.50") - Check the number of decimal places for the asset
- Zero or negative amount
- Too many decimal places for the asset
- Amount below minimum threshold ($1 USD equivalent amount)
Transfer asset not supported
This error occurs when the asset specified for the transfer is not supported. Steps to resolve:- Check the list of supported assets for transfers
- Verify the asset symbol is correctly specified
- Ensure the asset is supported for the transfer route (source → target)
- Asset not supported for transfers
- Incorrect asset symbol
Insufficient balance
This error occurs when the source account does not have enough funds to complete the transfer including fees. Steps to resolve:- Check the source account balance
- Ensure the balance covers both the transfer amount and any fees
- Consider using
amountType: "source"to transfer the maximum available amount minus fees - Add funds to the source account if needed
- Transfer amount exceeds available balance
- Not accounting for transfer fees
- Pending transactions reducing available balance
Metadata too many entries
This error occurs when the transfer metadata contains more entries than allowed. Steps to resolve:- Reduce the number of metadata entries (maximum 10 allowed)
- Consolidate related data into fewer keys
- Store additional data externally and reference it with a single metadata entry
- Maximum entries: 10
Metadata key too long
This error occurs when a metadata key exceeds the maximum allowed length. Steps to resolve:- Shorten the metadata key to 40 characters or less
- Use abbreviations or shorter naming conventions
- Consider using a key-value structure where the value contains the longer identifier
- Maximum key length: 40 characters
Metadata value too long
This error occurs when a metadata value exceeds the maximum allowed length. Steps to resolve:- Shorten the metadata value to 500 characters or less
- Store longer data externally and reference it with a shorter identifier
- Consider compressing or encoding the data if appropriate
- Maximum value length: 500 characters
Travel rules field missing
This error occurs when required travel rule fields are missing from the transfer request. Steps to resolve:- Include the
travelRuleobject in your transfer request - Supply the required missing fields prompted by the error message
- Review the travel rule requirements for your jurisdiction
Asset mismatch
This error occurs when the assets specified in the transfer are incompatible or don’t match expected values. Steps to resolve:- Ensure the
assetfield matches either the source or target asset - Verify that the source and target assets are compatible for conversion (if different)
- Check that the asset symbols are correctly specified
- Transfer asset doesn’t match source or target
- Attempting an unsupported asset conversion
- Typo in asset symbols
Order quote expired
This error occurs when attempting to execute an order whose quote has expired. Steps to resolve:- Create a new order with
execute: falseto get an updated quote. - Execute the new order before the quote expires (check the
expiresAtfield). - Alternatively, create a new order with
execute: trueto skip the quote step and execute immediately.
Order already filled
This error occurs when attempting to cancel or modify an order that has already been filled. Steps to resolve:- Check the current status of the order using
GET /v2/orders/{orderId}. - A filled order cannot be canceled or re-executed.
Order already canceled
This error occurs when attempting to cancel or execute an order that has already been canceled. Steps to resolve:- Check the current status of the order using
GET /v2/orders/{orderId}. - Create a new order if you still want to trade.
Account not ready
This error occurs when an operation is attempted on an account that is still being provisioned. Steps to resolve:- Wait a few moments and retry the request
- If the error persists, the account may still be completing setup — retry with exponential backoff
Insufficient liquidity
This error occurs when no swap route is available for the requested token pair or amount. Steps to resolve:- Try a smaller
fromAmount— large orders may exceed available liquidity - Try a different token pair
- Retry after a short delay; liquidity conditions change with market activity
Insufficient allowance
This error occurs when the taker has not approved the Permit2 contract to spend thefromToken
on their behalf. ERC-20 swaps require a Permit2 allowance. Native ETH swaps do not.
Steps to resolve:
- Submit an ERC-20
approvetransaction on thefromTokencontract, granting the Permit2 contract (0x000000000022D473030F116dDEE9F6B43aC78BA3) an allowance of at leastfromAmount - Wait for the approval transaction to be confirmed on-chain
- Retry the swap
Transaction simulation failed
This error occurs when the pre-broadcast simulation of the swap transaction predicted a revert. No transaction was submitted and no gas was spent. Common causes:- The on-chain price moved past the
slippageBpstolerance between the price estimate and execution - Taker balance changed between the price estimate and execution
- Retry immediately — prices change quickly and a new quote may succeed
- Increase
slippageBpsif retries continue to fail (e.g. from 100 to 200) - For large swaps, consider splitting into smaller amounts to reduce price impact
HTTP 401
Unauthorized
This error occurs when authentication fails. Steps to resolve:- Verify your CDP API credentials:
- Check that your API key is valid
- Check that your Wallet Secret is properly configured
- Validate JWT token:
- Not expired
- Properly signed
- Contains required claims
- Check request headers:
- Authorization header present
- X-Wallet-Auth header included when required
HTTP 402
Payment method required
This error occurs when a payment method is required to complete the requested operation but none is configured or available. Steps to resolve:- Add a valid payment method to your account using the CDP Portal
- Ensure your payment method is valid and not expired
- No payment method configured on the account
- Payment method is expired
Payment required
This error occurs when an x402 payment is required to access the requested resource. Steps to resolve:- Include a valid x402 payment header in your request
- Ensure the payment meets the resource’s pricing requirements
HTTP 403
Forbidden
This error occurs when you don’t have permission to access the resource. Steps to resolve:- Verify your permissions to access the resource
- Ensure that you are the owner of the requested resource
HTTP 404
Not found
This error occurs when the resource specified in your request doesn’t exist or you don’t have access to it. Steps to resolve:- Verify the resource ID/address/account exists
- Check your permissions to access the resource
- Ensure you’re using the correct network/environment
- Confirm the resource hasn’t been deleted
- Mistyped addresses
- Accessing resources from the wrong CDP project
- Resource was deleted or hasn’t been created yet
HTTP 409
Already exists
This error occurs when trying to create a resource that already exists. Steps to resolve:- Check if the resource exists before creation
- Use GET endpoints to verify resource state
- Use unique identifiers/names for resources
HTTP 422
Idempotency error
This error occurs when an idempotency key is reused with different parameters. Steps to resolve:- Generate a new UUID v4 for each unique request
- Only reuse idempotency keys for exact request duplicates
- Track used keys within your application
Travel rules recipient violation
This error occurs when the user is not allowed to receive funds at this address, because it violates travel rules. Steps to resolve:- Ensure your desired transfer is not blocked by local travel regulations.
HTTP 429
Rate limit exceeded
This error occurs when you’ve exceeded the API rate limits. Steps to resolve:- Implement exponential backoff
- Cache responses where possible
- Wait for rate limit window to reset
HTTP 500
Internal server error
This indicates an unexpected error that occurred on the CDP servers. Important: If you encounter this error, please note that your operation’s status should be treated as unknown by your application, as it could have been a success within the CDP back-end. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- Your correlation ID
- Timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
HTTP 502
Bad gateway
This error occurs when the CDP API is unable to connect to the backend service. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- The timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
HTTP 503
Service unavailable
This error occurs when the CDP API is temporarily unable to handle requests due to maintenance or high load. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- The timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
Network Errors
Network errors occur when there is a problem establishing or maintaining a connection to the CDP API at the network layer. These errors are distinct from API service errors - they indicate that your request never reached the CDP API or was blocked before it could be processed.Understanding Network Errors
When you encounter a network error via the CDP SDK, you’ll receive aNetworkError object with:
statusCode: Always 0 (indicating no HTTP response was received)errorType: Specific type of network errorerrorMessage: Human-readable descriptionnetworkDetails: Additional information including:code: Technical error codemessage: Original error messageretryable: Whether the operation should be retried
Types of Network Errors
1. IP Blocked (network_ip_blocked)
Your IP address has been blocked at the gateway level.
Common causes:
- Geographic restrictions.
- Rate limiting at infrastructure level.
- Security policies or DDoS protection.
- Corporate firewall/proxy restrictions.
- Verify you’re not accessing from a restricted region.
- Check if you’re behind a VPN or proxy that might be blocked.
- Contact CDP support on Discord if you believe this is in error.
- This error is not retryable.
2. Connection Failed (network_connection_failed)
Unable to establish a connection to the CDP API.
Common causes:
- CDP API is temporarily unavailable. Check the CDP Status Page for any ongoing issues.
- Network connectivity issues.
- Firewall blocking outbound HTTPS connections.
- Incorrect API endpoint configuration.
- Check your internet connection.
- Verify firewall settings allow HTTPS traffic to
api.cdp.coinbase.com. - Ensure you’re using the correct API endpoint.
- This error is retryable. Retry the request with exponential backoff.
3. Timeout (network_timeout)
The request took too long and was terminated.
Common causes:
- Network congestion.
- Slow internet connection.
- Increase timeout settings if consistently timing out.
- This error is retryable. Retry the request with exponential backoff.
4. DNS Failure (network_dns_failure)
Unable to resolve the CDP API domain name.
Common causes:
- DNS configuration issues.
- Network connectivity problems.
- DNS server unavailable.
- Incorrect API endpoint URL.
- Check your DNS settings.
- Verify network connectivity with
nslookup api.cdp.coinbase.com. - Try using a different DNS server (e.g., 8.8.8.8).
- Ensure the API URL is correct.
- This error is not retryable until DNS is fixed.
Handling Network Errors in Code
Best Practices
- Implement Retry Logic: For retryable errors, use exponential backoff:
- Log Network Errors: Always log network errors with full details for debugging.
- Monitor Patterns: Track network errors to identify patterns (time of day, specific operations, etc.).
- Have Fallback Strategies: Consider implementing fallback mechanisms for critical operations.
Troubleshooting Checklist
- Verify internet connectivity.
- Check if you’re behind a proxy or VPN.
- Ensure firewall allows HTTPS traffic to
api.cdp.coinbase.com. - Verify you’re not in a restricted geographic region.
- Check DNS resolution:
nslookup api.cdp.coinbase.com. - Test with
curlor similar:curl -I https://api.cdp.coinbase.com/platform. - Check if the issue is consistent or intermittent.
Getting Help
If you continue to experience network errors after following this guide:-
Collect error details including:
- Full error message and type.
- Network details from the error.
- Time and frequency of occurrence.
- Your network configuration (proxy, VPN, region).
- Contact CDP support on Discord with this information.
- Check the CDP Status Page for any ongoing issues.