General Information
How it works
- The API is built on REST principles based on the JSON-API specification
- Requests must include the HTTP header Content-Type=application/json
- Response timeout: 1 minute
For requests with a body, you must pass the header:
Content-Type: application/json
Environments
Production
https:/api
Authentication
API access uses Bearer authentication based on a JWT token (hereafter, access token).
The access token is passed in every protected request in the HTTP header:
Authorization: Bearer <access_token>
You can obtain an access token in the merchant personal account:
- Get an invitation from your personal manager by email
- Follow the link in the email to set a password
- After creating a password, log in to the merchant personal account (https://merchant.wata.pro/login)
- In the "Terminals" section, click the terminal tile
- A settings panel will open on the right, where you can create tokens. You can create from 1 to 5 tokens
- Come up with a name and choose the token's lifetime. The access token lifetime is from 1 to 12 months
- After this period expires, requests to the API will start returning HTTP 401 status code. Make sure to set up a reminder to reissue the access token in the personal account in advance and replace it in your system.
Important:
- Store the access token in a secure place
- WATA does not store the access token in plain form
- An existing access token cannot be recovered
- If necessary, generate a new access token
- Choose the access token lifetime deliberately — from 1 to 12 months
- After expiration, the API will return HTTP
401.
Rate limiting
To ensure stable service operation and protect the API from polling load, a rate limit is applied to GET requests to the API.
The following requests are limited
GET api/v3/steam/order
GET api/v3/topup/orders
GET api/v3/vouchers/order
GET api/stars/order
GET api/v1/deposit/order
All other methods (POST, PUT, etc.) and endpoints are not limited
Limit size
- 1 GET request per 30 seconds
What happens when the limit is exceeded
- HTTP 429 (Too Many Requests) is returned
- The response indicates after how many seconds the request can be repeated
Recommendation
Use webhook notifications to receive updates. Polling requests are intended only for infrequent status checks or a fallback scenario
Webhook notifications
In the terminal you can specify a URL where webhook notifications will be sent when the payer pays the transaction (for Digital Goods + Acquiring) or when the order is fulfilled (for Digital Goods + Deposit).
For the webhook workflow and notification parameters, see the WATA Acquiring API documentation.
HTTP statuses
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request processed successfully |
| 400 | Bad request | The data in the request is invalid. Check the request, fix the data, and resend it |
| 401 | Unauthorized | No access token was provided, or the provided access token has expired. Refresh the access token |
| 403 | Forbidden | You do not have access to the requested endpoint |
| 500 | Server error | Please contact support with a description of the problem and the request body |
If a 400 code is received, a response with error details is returned in the response body.
Example response with error details:
Response 400
{
"error":{
"code":null,
"message":"Your request is invalid!",
"details":"The following errors were found during validation - 'Amount' must be filled.",
"data":{
},
"validationErrors":[
{
"message":"'Amount' must be filled.",
"members":[
"amount"
]
}
]
}
}
Error codes
| Code | Description |
|---|---|
| ORD_1001 | Order not found |
| ORD_1002 | Such an order already exists |
| ORD_1003 | Payment error, order amount (amount) is below the minimum |
| ORD_1004 | Order payment deadline has expired |
| ORD_1005 | Payment error, order amount (amount) exceeds the maximum |
| ORD_1006 | Payment error, please contact the store |
| ORD_1007 | Order is not in the pending confirmation status |
| PL_1001 | Incorrect payment link amount (the amount is too small or too large) |
| PL_1002 | Incorrect payment link currency (creating links in this currency is prohibited) |
| PL_1003 | The payment link is unavailable or has already been paid |
| STM_1001 | Steam top-up calculation error |
| STM_1002 | Steam account does not exist |
| STM_1003 | The payment amount must be between 100 RUB and 50,000 RUB |
| STM_1004 | Payment error, please contact the store |
| STR_1001 | The request contains errors, check that the data is correct |
| STR_1002 | User not found |
| STR_1003 | Incorrect number of Stars in the order (from 50 to 50,000 units) |
| STR_1004 | Error creating the order |
| TPP_1001 | Product not found |
| TPP_1002 | Incorrect fields passed for placing the order |
| TPP_1003 | Product is not available for purchase |
| TPP_1004 | User not found, check that the data is correct |
| VCR_1001 | Voucher not found |
| VCR_1002 | Incorrect Count for the voucher |
| VCR_1003 | Out of stock |