HTTP status codes
Grid uses standard HTTP status codes to indicate the success or failure of requests:Status Code | Meaning | When It Occurs |
---|---|---|
200 OK | Success | Request completed successfully |
201 Created | Resource created | New transaction, quote, or customer created |
202 Accepted | Accepted for processing | Async operation initiated (e.g., bulk CSV upload) |
400 Bad Request | Invalid input | Missing required fields or invalid parameters |
401 Unauthorized | Authentication failed | Invalid or missing API credentials |
403 Forbidden | Permission denied | Insufficient permissions or customer not ready |
404 Not Found | Resource not found | Customer, transaction, or quote doesn’t exist |
409 Conflict | Resource conflict | Quote already executed, external account already exists |
412 Precondition Failed | UMA version mismatch | Counterparty doesn’t support required UMA version |
422 Unprocessable Entity | Missing info | Additional counterparty information required |
424 Failed Dependency | Counterparty issue | Problem with external UMA provider |
500 Internal Server Error | Server error | Unexpected server issue (contact support) |
501 Not Implemented | Not implemented | Feature not yet supported |
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 amountTIMEOUT
- Transaction timed out
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: