Overview

While using the SDK, you may run into an error. Usually, this is caused by an invalid parameter in your implementation.

Here is an example of one error you may run into:

{ 
    "httpStatusCode": 401,
    "message": "Invalid destination provided",
    "info": { "unknowns": [ "moffdd" ] } 
}

This sections explains the error format and messages utilized by Connect.

API Error responses

HTTP status codes do not always provide sufficient information about the cause of an error. For more detailed programmatic handling of errors, responses contain additional JSON fields that describe the error.

Error format

Whenever an API request results in an error, the response will contain both a high-level error class specified by the code and a human-readable summary in the message.

{
   "message":"Insufficient funds."
}

 Extended error format

In some cases, there is extended information available for clients about why a request has failed. For example, failing to supply a value for a required field1 will result in the following error:

{ 
    "httpStatusCode": 401,
    "message": "Invalid destination provided",
    "info": { "unknowns": [ "moffdd" ] } 
}

List of API Error Codes

HTTP statusMessageDescription
400Request contains invalid parametersYou've provided an invalid parameter. Check info from the response to find out which one.
401Permission not establishedYou are trying to use a feature that requires a permission not yet granted to you by this user.
401Missing authorizationThe authorization token is missing or is no longer valid.
403Account wallet is lockedThis wallet can neither send nor receive. The user should reach support to unlock it.
409Request exceeds users global connect spend limit.The user has reached their Connect limit. Prompt the user to increase their Connect limit from within the HandCash app.
409Insufficient funds.The user account does not hold enough funds to process the transaction. Prompt the user to top up their account.
409Invalid destination providedThe handle, paymail, or address you provided is invalid. Ensure the destination you're providing is a valid one.
409This app didn't create the requested transactionYou are requesting a transaction made by a different app.
500Internal server errorHandCash has experienced an internal server error, and is unable to process your request.
503External service not availableWe are having difficulties connecting to an external service, and are unable to process your request.