Security
Server-side calls only
Call the API from your server, not from the buyer's browser or mobile app. Agent credentials and tokens must not reach the buyer's device.
Storing credentials
- Store the agent email and password only on your server: in environment variables or a secrets manager.
- Do not write credentials,
accessTokenorrefreshTokento logs. - Use separate accounts for the test and production environments.
Access tokens
- Keep one valid
accessTokenon the server and refresh it viarefresh-tokenbeforeexpiresInruns out. - Do not log in again before every request.
- Got
401— refresh the token;refresh-tokenreturned400— log in again.
Brute-force protection
After 5 failed login attempts from one IP address within an hour, login from that address is blocked for an hour. During the block the server responds with 429 and a Retry-After header (in seconds). Do not retry login in a loop on a credentials error.
Repeated confirmation
Pass the Idempotency-Key header in confirm — unique for each confirmation, unchanged on retry. A repeated confirm for the same order does not create a second sale: if the order is already paid, the server returns it with the same tickets.
Ticket QR code
qrToken is the buyer's electronic ticket:
- deliver it only to the buyer — in an email, a PDF or an app;
- do not write it to open logs;
- do not pass it in a URL.
What to log
Store orderId, Idempotency-Key and the traceId from error responses — support can find the request by traceId.