Assumptions & Errors

Assumptions

Each time your customers want to deposit or withdraw, an Order must be created. Withdrawal orders are created on your side (by calling our Create Order endpoint) and whereas deposit orders are created on our side and you are notified using webhooks (see: ActiveDeposits). Buy orders (that exchange fiat to crypto) are previously created on your side (with the Create Order endpoint) since it needs to request a quote/exchange rate.

Users are created and KYC'ed: once you send basic user contact information, if such user never had any order created through AzPay, (s)he's going to be registered and the KYC information will be verified.

Currency may either be a fiat or a crypto currency. Depending on your agreement with us, you might or might not use crypto currencies.

Webhook is a URL that gets back-called in specified situations. There are different types of WebHooks and you may set each one of them to any URL (even in a different domain). The remote URL should reply with a non-error (2xx) HTTP status code. The response body is ignored.


Errors

This API works with standard HTTP errors.

HTTP Error CodeMeaningPossible reasons
400 Bad RequestInvalid request bodySome of the inputs in the request body is invalid
403 ForbiddenNo privillegesMissing or incorrect Basic auth
404 Not FoundPath not foundIncorrect endpoint or object (user or order) UUID
429 Request ThrottledRate limitedSome resource is being abused

Once an error is thrown, the server replies with an Error object, which consists on two properties:

KeyDescriptionTypeExample
codeProgramatically-identifiable error codestringE_INVALID_CURRENCY
messageHuman-readable error descriptionstringInvalid currency code: ABC
{
  "code": "E_INVALID_CURRENCY",
  "message": "Invalid currency code: ABC"
}

The possible global errors (for all endpoints) are:

HTTP Status CodeCodeDescription
400E_SCHEMA_MISMATCHThe request body schema does not comply to the expected
403E_AUTH_FAILEDThe authentication failed
429E_RATE_LIMITEDThe requested resource is being abused

Per-endpoint specific errors can be found on each endpoint's documentation.