Exception Handling

Guides for handling exceptions in the remittance flow

When integrating with the ReadyRemit API, robust exception handling is crucial to ensure your application can gracefully handle unexpected scenarios. Exception handling not only helps in maintaining the stability and reliability of your application but also improves the user experience by providing clear and actionable error messages. This section of our documentation will guide you through the best practices for managing exceptions, common error codes, and techniques to implement effective error handling strategies. By following these guidelines, you can minimize downtime, debug issues more efficiently, and create a seamless interaction between your application and our API.

Timeout on Transfer Creation

On average, creating a Transfer through the ReadyRemit API using the Execute Transfer endpoint takes 4-5 seconds. It is unlikely, but if the Transfer creation processes for more than 60 seconds , an HTTP status code 504 Gateway Timeout will be returned. The response is returned as an error, but the transfer is still being processed in ReadyRemit and may still go through successfully. It is critical that you do not consider this as a failure. Instead, the Get Transfer Progress by Quote History ID endpoint can be used to poll for the status of the transfer execution.

When you retrieved a quote from ReadyRemit using the Get Quote endpoint, you received a quoteHistoryId which should have then been included in the call to Execute Transfer. This same ID can be used to check the status of a Transfer during the creation process using the Get Transfer Progress by Quote History ID.

curl --request GET \
     --url https://sandbox-api.readyremit.com/v1/transfers/progress/464be703-ef4b-4aec-bc3b-fa49ef9ad44d \
     --header 'accept: application/json'

The response from this API will be an object with 2 properties: transferId and transferRecordStatus.

{
  "transferId": null,
  "transferRecordStatus": "Initializing"
}

The transferId field will remain null until the Transfer has been created successfully. The transferRecordStatus field will have one of the following 4 values:

  • NotInProgress - The transfer creation process has not started. Likely a result of not calling the Execute Transfer endpoint.
  • Initializing - The transfer creation process is currently in progress.
  • Failed - The transfer failed while being initialized. A new transfer will need to be created.
  • Completed - The transfer has been successfully initiated.

🚧

Note

The Completed status does not indicate that the Transfer was successfully completed or that funds were delivered to the recipient, only that the transfer was initiated in the ReadyRemit system. This endpoint should only be used in the event of a timeout when creating a Transfer. Once the Transfer has been initiated and you have a transferId, the actual status of the transfer can be retrieved using the Get Transfer endpoint, or from the Transfer status updates webhook.

In the event of a 504 Gateway Timeout response during the Execute Transfer endpoint, we recommend polling the Get Transfer Progress by Quote History ID endpoint once per second for 60 seconds or until the transferRecordStatus returned is Failed or Completed.