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 Code | Meaning | Possible reasons |
|---|---|---|
| 400 Bad Request | Invalid request body | Some of the inputs in the request body is invalid |
| 403 Forbidden | No privilleges | Missing or incorrect Basic auth |
| 404 Not Found | Path not found | Incorrect endpoint or object (user or order) UUID |
| 429 Request Throttled | Rate limited | Some resource is being abused |
Once an error is thrown, the server replies with an Error object, which consists on two properties:
| Key | Description | Type | Example |
|---|---|---|---|
| code | Programatically-identifiable error code | string | E_INVALID_CURRENCY |
| message | Human-readable error description | string | Invalid currency code: ABC |
{
"code": "E_INVALID_CURRENCY",
"message": "Invalid currency code: ABC"
}The possible global errors (for all endpoints) are:
| HTTP Status Code | Code | Description |
|---|---|---|
| 400 | E_SCHEMA_MISMATCH | The request body schema does not comply to the expected |
| 403 | E_AUTH_FAILED | The authentication failed |
| 429 | E_RATE_LIMITED | The requested resource is being abused |
Per-endpoint specific errors can be found on each endpoint's documentation.
Updated 9 months ago