Handling Transaction Errors (Connection Failure or HTTP 500)

If a transaction request fails due to:

  • A connection error
  • An HTTP 500 Internal Server Error
  • No response received

When an unexpected error occurs, do not assume the transaction has failed. Instead, always verify its status using the correlation ID linked to the request.


Step 1: Check Transaction Status

Use the following GraphQL query to check the status by correlation ID:

{
  transactions {
    all(first: 1, where: { correlationId: { values: ["<your-correlation-id>"] } }) {
      edges {
        node {
          status
          correlationId
          // ... others transaction fields you want
        }
      }
    }
  }
}

Replace <your-correlation-id> with the ID used in your original request (e.g. "1708528717991").


Step 2: Retry If Status Is PROCESSING

If the returned status is:

"PROCESSING"

You must retry the query 3 more times with a 20-second delay between each attempt:

  • ⏱ 1st retry → wait 20 seconds
  • ⏱ 2nd retry → wait 20 seconds
  • ⏱ 3rd retry → wait 20 seconds

This gives a total wait time of 60 seconds.


Step 3: Final Handling

If the status remains “PROCESSING” or is any value other than “COMPLETED” after 60 seconds:

  • Consider the transaction failed
  • Handle the failure appropriately:
    • Notify the user
    • Log the event for manual review
    • Optionally retry the transaction from the client side

Best Practices

  • Always log the correlation ID for each transaction.
  • Implement exponential backoff or fixed retry delay strategies in production.
  • Ensure the retry logic does not block the main user flow if possible.
  • For long-running operations, consider showing a loading or background processing indicator.