HTTP status codes
Grid uses standard HTTP status codes to indicate the success or failure of requests:API error responses
All error responses include a structured format:Common error codes
INVALID_INPUT
INVALID_INPUT
Cause: Missing required fields or invalid data formatSolution: Check request parameters match API specification
QUOTE_EXPIRED
QUOTE_EXPIRED
Cause: Attempting to execute an expired quoteSolution: Create a new quote before executing
INSUFFICIENT_BALANCE
INSUFFICIENT_BALANCE
Cause: Internal account doesn’t have enough fundsSolution: Check balance before initiating transfer
INVALID_BANK_ACCOUNT
INVALID_BANK_ACCOUNT
Cause: Bank account details are invalid or incompleteSolution: Validate account details before submission
Transaction failure reasons
When a transaction fails, thefailureReason field provides specific details:
Outgoing payment failures
QUOTE_EXPIRED- Quote expired before executionQUOTE_EXECUTION_FAILED- Error executing the quoteFUNDING_AMOUNT_MISMATCH- Funding amount doesn’t match expected amount
Incoming payment failures
PAYMENT_APPROVAL_TIMED_OUT- Webhook approval not received within 5 secondsPAYMENT_APPROVAL_WEBHOOK_ERROR- Webhook returned an errorOFFRAMP_FAILED- Failed to convert and send funds to destinationQUOTE_EXPIRED- Quote expired during processing
Handling failures
Monitor transaction status
Retry logic for transient errors
Handle webhook failures
Error recovery strategies
- Quote Expiration
- Insufficient Balance
- Network Errors
Automatically create a new quote when one expires:
User-friendly error messages
Convert technical errors to user-friendly messages:Logging and monitoring
Implement comprehensive error logging:Best practices
Always validate before API calls
Always validate before API calls
Validate data on your side before making API requests to catch errors early:
Implement idempotency
Implement idempotency
Store transaction IDs to prevent duplicate submissions on retry:
Set appropriate timeouts
Set appropriate timeouts
Configure timeouts for long-running operations: