Төлбөрийн баримт буцаах
Төлбөрийн баримтыг, жишээ нь буцаалтын дараа, буцаасан гэж тэмдэглэнэ. Нэг дуудлагаар солих баримтыг хамт хавсаргаж болно.
Өөрчлөлт 2026-09-27Энэ operation энэ хувилбарт байхгүй.
POST /api/v1/payments/{id}/receipt/returnХувилбар 2026-09-27
Нэвтрэлт
Secret key (Bearer)
Header
| Нэр | Төрөл | Заавал | Утга | Тайлбар |
|---|---|---|---|---|
TapPay-Version | string | үгүй | ||
TapPay-Timestamp | string | үгүй | ||
TapPay-Nonce | string | үгүй | ||
TapPay-Signature | string | үгүй | ||
Idempotency-Key | string | тийм |
Замын параметр
| Нэр | Төрөл | Заавал | Утга | Тайлбар |
|---|---|---|---|---|
id | string (uuid) | тийм |
Хүсэлтийн бие
| Нэр | Төрөл | Заавал | Утга | Тайлбар |
|---|---|---|---|---|
returnedAt | string | үгүй | ||
replacement | object | үгүй | ||
replacement.receiptKind | string | тийм | WITH_EBARIMT, WITHOUT_EBARIMT | |
replacement.receiptType | string | үгүй | B2C, B2B, SALES | |
replacement.ddtd | string | үгүй | ||
replacement.lottery | string | үгүй | ||
replacement.qrData | string | үгүй | ||
replacement.url | string | үгүй | ||
replacement.merchantReceiptNo | string | үгүй | ||
replacement.amount | string | тийм | ||
replacement.vat | string | үгүй | ||
replacement.cityTax | string | үгүй | ||
replacement.issuedAt | string | тийм | ||
replacement.lines | array<object> | үгүй | ||
replacement.lines[].name | string | тийм | ||
replacement.lines[].quantity | string | тийм | ||
replacement.lines[].unitPrice | string | тийм | ||
replacement.lines[].totalAmount | string | тийм | ||
replacement.lines[].classificationCode | string | үгүй | ||
replacement.lines[].measureUnit | string | үгүй | ||
replacement.lines[].taxProductCode | string | үгүй | ||
replacement.lines[].barCode | string | үгүй | ||
replacement.lines[].barCodeType | string | үгүй | GS1, ISBN, UNDEFINED |
Хариу 201
| Нэр | Төрөл | Заавал | Утга | Тайлбар |
|---|---|---|---|---|
success | boolean | тийм | true | |
data | object | тийм | ||
data.receipt | object | тийм | ||
data.receipt.id | string (uuid) | тийм | ||
data.receipt.status | string | тийм | PENDING, REGISTERED, FAILED, RETURNED | |
data.receipt.issuer | string | тийм | MERCHANT, NODE | |
data.receipt.receiptType | string | null | тийм | B2C, B2B, SALES, null | |
data.receipt.ddtd | string | null | тийм | ||
data.receipt.lottery | string | null | тийм | ||
data.receipt.qrData | string | null | тийм | ||
data.receipt.url | string | null | тийм | ||
data.receipt.merchantReceiptNo | string | null | тийм | ||
data.receipt.amount | string | null | тийм | ||
data.receipt.vat | string | null | тийм | ||
data.receipt.cityTax | string | null | тийм | ||
data.receipt.issuedAt | string | null | тийм | ||
data.receipt.returnedAt | string | null | тийм | ||
data.receipt.failureReason | string | null | тийм | ||
data.receipt.lines | array | null | тийм | ||
data.receipt.attempts | integer | тийм | ||
data.receipt.nextAttemptAt | string | null | тийм | ||
data.receipt.recipientFallback | boolean | тийм | ||
data.receipt.parts | array | null | тийм | ||
data.history | array<object> | тийм | ||
data.history[].id | string (uuid) | тийм | ||
data.history[].status | string | тийм | PENDING, REGISTERED, FAILED, RETURNED | |
data.history[].issuer | string | тийм | MERCHANT, NODE | |
data.history[].receiptType | string | null | тийм | B2C, B2B, SALES, null | |
data.history[].ddtd | string | null | тийм | ||
data.history[].lottery | string | null | тийм | ||
data.history[].qrData | string | null | тийм | ||
data.history[].url | string | null | тийм | ||
data.history[].merchantReceiptNo | string | null | тийм | ||
data.history[].amount | string | null | тийм | ||
data.history[].vat | string | null | тийм | ||
data.history[].cityTax | string | null | тийм | ||
data.history[].issuedAt | string | null | тийм | ||
data.history[].returnedAt | string | null | тийм | ||
data.history[].failureReason | string | null | тийм | ||
data.history[].lines | array | null | тийм | ||
data.history[].attempts | integer | тийм | ||
data.history[].nextAttemptAt | string | null | тийм | ||
data.history[].recipientFallback | boolean | тийм | ||
data.history[].parts | array | null | тийм |
Алдаа
| Код | Status | Мессеж |
|---|---|---|
AUTH-001 | 401 | API key байхгүй, буруу эсвэл хүчингүй болсон байна. |
EVT-206 | 401 | Production key sandbox-д хүлээн авахгүй. Sandbox key (sk_test_/pk_test_) ашиглана уу. |
EVT-207 | 401 | Sandbox key production-д хүлээн авахгүй. Production key (sk_live_/pk_live_) ашиглана уу. |
AUTH-018 | 403 | Хүсэлт түлхүүрийн зөвшөөрөгдсөн IP жагсаалтад ороогүй хаягаас ирсэн. |
AUTH-058 | 403 | API key-д энэ үйлдэлд шаардлагатай scope байхгүй байна. |
SIG-002 | 401 | Хүсэлтийн цагийн тэмдэг зөвшөөрөгдсөн хугацааны гадна байна. |
SIG-003 | 401 | Хүсэлтийн гарын үсэг байхгүй эсвэл таарахгүй байна. |
SIG-005 | 409 | Энэ хүсэлтийн nonce өмнө нь ашиглагдсан байна. |
VAL-014 | 400 | TapPay-Version header нь мэдэгдэх API хувилбар биш байна. |
BIZ-004 | 403 | Terminal идэвхгүй байна. |
BIZ-005 | 403 | Мерчантын данс энэ хүсэлтийг зөвшөөрөх төлөвт байхгүй байна. |
VAL-002 | 400 | Заавал байх талбар эсвэл header дутуу байна. |
VAL-010 | 409 | Энэ Idempotency-Key өөр хүсэлтийн биетэй өмнө нь ашиглагдсан байна. |
VAL-013 | 409 | Энэ Idempotency-Key-тэй хүсэлт боловсруулагдаж байна. |
VAL-001 | 400 | Хүсэлт шалгалтад тэнцсэнгүй. |
curl -sS -X POST "https://api.tappay.mn/api/v1/payments/PAYMENT_ID/receipt/return" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{"returnedAt":"2026-10-03T11:00:00Z"}'import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const receipt = await tappay.receipts.createReturn({ id: 'PAYMENT_ID', body: { returnedAt: '2026-10-03T11:00:00Z' } });
console.log(JSON.stringify(receipt));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$receipt = $tappay->receipts->createReturn(['id' => 'PAYMENT_ID', 'body' => ['returnedAt' => '2026-10-03T11:00:00Z']]);
echo json_encode($receipt);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
receipt = client.receipts.create_return({"id": "PAYMENT_ID", "body": {"returnedAt": "2026-10-03T11:00:00Z"}})
print(json.dumps(receipt)){
"success": true,
"data": {
"receipt": {
"id": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e07",
"status": "RETURNED",
"issuer": "MERCHANT",
"receiptType": "B2C",
"ddtd": "DDTD-EXAMPLE-0001",
"lottery": null,
"qrData": null,
"url": null,
"merchantReceiptNo": "rcpt-4f2a9c1b7e30",
"amount": "1000",
"vat": "90.91",
"cityTax": null,
"issuedAt": "2026-10-03T10:00:00.000Z",
"returnedAt": "2026-10-03T11:00:00.000Z",
"failureReason": null,
"lines": [
{
"name": "Order 1",
"quantity": "1",
"unitPrice": "1000",
"totalAmount": "1000"
}
],
"attempts": 0,
"nextAttemptAt": null,
"recipientFallback": false,
"parts": null
},
"history": []
}
}
Бүтэн урсгалыг гарын авлагаас үзнэ үү.