Skip to main content
Learn how to handle errors when working with payments and transactions in Grid. Proper error handling ensures a smooth user experience and helps you quickly identify and resolve issues.

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

Cause: Missing required fields or invalid data formatSolution: Check request parameters match API specification
Cause: Attempting to execute an expired quoteSolution: Create a new quote before executing
Cause: Internal account doesn’t have enough fundsSolution: Check balance before initiating transfer
Cause: Bank account details are invalid or incompleteSolution: Validate account details before submission

Transaction failure reasons

When a transaction fails, the failureReason field provides specific details:

Outgoing payment failures

Common outgoing failure reasons:
  • QUOTE_EXPIRED - Quote expired before execution
  • QUOTE_EXECUTION_FAILED - Error executing the quote
  • EXECUTION_FAILED_POST_DEBIT - Execution failed after debit; funds are refunded automatically
  • SETTLEMENT_FAILED - The settlement leg failed
  • FUNDING_AMOUNT_MISMATCH - Funding amount doesn’t match expected amount
  • TIMEOUT - Transaction didn’t complete within its processing window
  • MANUAL_REFUND - Transaction was refunded manually
  • LSP_OPERATIONAL_FAILURE - Lightspark-internal operational issue; contact Lightspark
  • PAYOUT_RETURNED - Receiving bank returned or reversed the payout
  • LIMIT_EXCEEDED - Payout exceeds a partner limit
  • ACCOUNT_CANNOT_RECEIVE - Recipient account can’t accept the payment
  • ACCOUNT_INVALID - Recipient account details are wrong or not found
  • COMPLIANCE_REJECTED - Payout partner rejected on compliance grounds

Incoming payment failures

Common incoming failure reasons:
  • PAYMENT_APPROVAL_TIMED_OUT - Webhook approval not received within 5 seconds
  • PAYMENT_APPROVAL_WEBHOOK_ERROR - Webhook returned an error
  • OFFRAMP_FAILED - Failed to convert and send funds to destination
  • QUOTE_EXPIRED - Quote expired during processing

Handling failures

Monitor transaction status

Retry logic for transient errors

Handle webhook failures

Error recovery strategies

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

Validate data on your side before making API requests to catch errors early:
Store transaction IDs to prevent duplicate submissions on retry:
Configure timeouts for long-running operations:

Next steps