Skip to content

API reference

View as Markdown

Base URL and version

Call the API over HTTPS at https://api.tappay.mn. Send the TapPay-Version header with a version date such as 2026-09-27 to keep the behavior you built against. If you leave it out, TapPay uses the latest version.

Authentication

Send your key as Authorization: Bearer YOUR_SECRET_KEY. A secret key belongs on your server and works for every operation its scopes allow. A publishable key may be used in a browser and works only for the checkout script operations. Sandbox and production keys are separate, and a sandbox key never touches real money.

Idempotency

Every POST request needs an Idempotency-Key header with a unique value, for example a UUID. Repeating a request with the same key returns the first result instead of doing the work again. Reusing a key with a different body is rejected with a 409 error.

Request signing

When request signing is enabled for your key, each request also carries TapPay-Timestamp, TapPay-Nonce and TapPay-Signature. The signature is v1= plus the base64 HMAC-SHA256 of the canonical string METHOD, path with query, timestamp, nonce and the SHA-256 hex of the body, one per line. TapPay signs its webhooks the same way, as shown in the webhooks guide.

Responses

A successful response has success set to true and the result in data. List operations return a page of results with hasMore and a cursor to continue. Money amounts are strings, and times are ISO 8601 in UTC.

Errors

A failed response has success set to false and an error object with a code such as AUTH-058, a readable message, a messageKey and a traceId. Quote the traceId when you contact support. Every operation page lists the error codes it can return.