Response Codes

To convey the status of each response, HostCap uses conventional HTTP response codes to indicate success or failure. In general, codes in the 2xx range indicate success. Codes in the 4xx range indicate an error (e.g. required parameters, failed request etc.). Codes in the 5xx range indicate a server error occurred

Error Response

Below is the expected structure for an error response;

{
  "code": "INSUFFICIENT_PERMISSIONS",
  "message": "Access without required permissions is forbidden"
}

The code in the response body indicates the specific reason for the error response.

The expected codes for the HTTP error response codes are;

400

  • INSUFFICIENT_FUNDS
  • CURRENCY_MISMATCH
  • KYC_INCOMPLETE
  • CURRENCY_NOT_SUPPORTED
  • BAD_REQUEST
  • DUPLICATE_TRANSACTION
  • ACCOUNT_RESTRICTED

403

  • WALLET_ASSET_LOCKED
  • INSUFFICIENT_PERMISSIONS
  • FORBIDDEN

404

  • RESOURCE_NOT_FOUND

500

  • SERVER_ERROR

Response Codes

Below is a list of expected response codes;

Status CodeResponse TypeDescription
200SuccessfulRequest was complete successfully with a response.
201CreatedResource was created successfully.
400Bad RequestInvalid request parameter.
403ForbiddenYou do not have sufficient authorization to access the request resource.
Your token is either unavailable, expired, or does not have the permission required to access the requested resource.
404Not FoundThe requested resource does not exist.
500Server ErrorThe server being unable to correctly process a request.
This is a relatively uncommon response. Please email: [email protected].
503Service UnavailableA third party service failure.
This is a relatively uncommon response. Please email: [email protected].