Get a POS access token
Exchanges the POS client id and client secret for a short-lived Bearer token with the client_credentials grant. Every other POS call sends this token in Authorization, the POS API key in X-API-Key, and a request signature.
Changes in 2026-09-27This operation is not available in this version.
POST /api/pos/v1/auth/token
Authentication
Secret key (Bearer)
Request body
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
grant_type | string | yes | client_credentials | |
client_id | string | yes | ||
client_secret | string | yes |
Response 200
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
access_token | string | yes | ||
token_type | string | yes | Bearer | |
expires_in | integer | yes | ||
terminal_source | string | yes | REGISTERED, REQUEST |
Errors
| Code | Status | Message |
|---|---|---|
POS-001 | 401 | The POS client id or client secret is invalid. |
curl -sS -X POST "https://sandbox-api.tappay.mn/api/pos/v1/auth/token" \
-H "Content-Type: application/json" \
-d '{"grant_type":"client_credentials","client_id":"YOUR_POS_CLIENT_ID","client_secret":"YOUR_POS_CLIENT_SECRET"}'PosClient gets and refreshes this token for you — the example shows the raw HTTP call.
const res = await fetch('https://sandbox-api.tappay.mn/api/pos/v1/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: 'YOUR_POS_CLIENT_ID',
client_secret: 'YOUR_POS_CLIENT_SECRET',
}),
});
console.log(await res.text());PosClient gets and refreshes this token for you — the example shows the raw HTTP call.
<?php
$body = json_encode([
'grant_type' => 'client_credentials',
'client_id' => 'YOUR_POS_CLIENT_ID',
'client_secret' => 'YOUR_POS_CLIENT_SECRET',
]);
$ch = curl_init('https://sandbox-api.tappay.mn/api/pos/v1/auth/token');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
]);
echo curl_exec($ch);PosClient gets and refreshes this token for you — the example shows the raw HTTP call.
import json, urllib.request, uuid
req = urllib.request.Request(
'https://sandbox-api.tappay.mn/api/pos/v1/auth/token',
data=json.dumps({
'grant_type': 'client_credentials',
'client_id': 'YOUR_POS_CLIENT_ID',
'client_secret': 'YOUR_POS_CLIENT_SECRET',
}).encode(),
method='POST',
headers={
'Content-Type': 'application/json',
},
)
print(urllib.request.urlopen(req).read().decode()){
"access_token": "YOUR_POS_ACCESS_TOKEN",
"token_type": "Bearer",
"expires_in": 3600,
"terminal_source": "REGISTERED"
}
In the sandbox use the terminal T-SANDBOX-POS of the merchant M-SANDBOX-POS. For the full flow, read the POS terminal guide.