Skip to content

Төлбөрийн баримт илгээх

Markdown-аар харах

Таны баримтыг ebarimt бүртгэлтэй эсвэл бүртгэлгүйгээр төлбөрт хавсаргана. Баримтын amount-ыг, ebarimt гаргасан бол түүний ddtd, сугалааны дугаарыг илгээнэ.

Өөрчлөлт 2026-09-27

POST /api/v1/payments/{id}/receiptХувилбар 2026-09-27

Нэвтрэлт

Secret key (Bearer)

Header

НэрТөрөлЗаавалУтгаТайлбар
TapPay-Versionstringүгүй
TapPay-Timestampstringүгүй
TapPay-Noncestringүгүй
TapPay-Signaturestringүгүй
Idempotency-Keystringтийм

Замын параметр

НэрТөрөлЗаавалУтгаТайлбар
idstring (uuid)тийм

Хүсэлтийн бие

НэрТөрөлЗаавалУтгаТайлбар
receiptKindstringтиймWITH_EBARIMT, WITHOUT_EBARIMT
receiptTypestringүгүйB2C, B2B, SALES
ddtdstringүгүй
lotterystringүгүй
qrDatastringүгүй
urlstringүгүй
merchantReceiptNostringүгүй
amountstringтийм
vatstringүгүй
cityTaxstringүгүй
issuedAtstringтийм
linesarray<object>үгүй
lines[].namestringтийм
lines[].quantitystringтийм
lines[].unitPricestringтийм
lines[].totalAmountstringтийм
lines[].classificationCodestringүгүй
lines[].measureUnitstringүгүй
lines[].taxProductCodestringүгүй
lines[].barCodestringүгүй
lines[].barCodeTypestringүгүйGS1, ISBN, UNDEFINED

Хариу 201

НэрТөрөлЗаавалУтгаТайлбар
successbooleanтиймtrue
dataobjectтийм
data.receiptobjectтийм
data.receipt.idstring (uuid)тийм
data.receipt.statusstringтиймPENDING, REGISTERED, FAILED, RETURNED
data.receipt.issuerstringтиймMERCHANT, NODE
data.receipt.receiptTypestring | nullтиймB2C, B2B, SALES, null
data.receipt.ddtdstring | nullтийм
data.receipt.lotterystring | nullтийм
data.receipt.qrDatastring | nullтийм
data.receipt.urlstring | nullтийм
data.receipt.merchantReceiptNostring | nullтийм
data.receipt.amountstring | nullтийм
data.receipt.vatstring | nullтийм
data.receipt.cityTaxstring | nullтийм
data.receipt.issuedAtstring | nullтийм
data.receipt.returnedAtstring | nullтийм
data.receipt.failureReasonstring | nullтийм
data.receipt.linesarray | nullтийм
data.receipt.attemptsintegerтийм
data.receipt.nextAttemptAtstring | nullтийм
data.receipt.recipientFallbackbooleanтийм
data.receipt.partsarray | nullтийм
data.historyarray<object>тийм
data.history[].idstring (uuid)тийм
data.history[].statusstringтиймPENDING, REGISTERED, FAILED, RETURNED
data.history[].issuerstringтиймMERCHANT, NODE
data.history[].receiptTypestring | nullтиймB2C, B2B, SALES, null
data.history[].ddtdstring | nullтийм
data.history[].lotterystring | nullтийм
data.history[].qrDatastring | nullтийм
data.history[].urlstring | nullтийм
data.history[].merchantReceiptNostring | nullтийм
data.history[].amountstring | nullтийм
data.history[].vatstring | nullтийм
data.history[].cityTaxstring | nullтийм
data.history[].issuedAtstring | nullтийм
data.history[].returnedAtstring | nullтийм
data.history[].failureReasonstring | nullтийм
data.history[].linesarray | nullтийм
data.history[].attemptsintegerтийм
data.history[].nextAttemptAtstring | nullтийм
data.history[].recipientFallbackbooleanтийм
data.history[].partsarray | nullтийм

Алдаа

КодStatusМессеж
AUTH-001401API key байхгүй, буруу эсвэл хүчингүй болсон байна.
EVT-206401Production key sandbox-д хүлээн авахгүй. Sandbox key (sk_test_/pk_test_) ашиглана уу.
EVT-207401Sandbox key production-д хүлээн авахгүй. Production key (sk_live_/pk_live_) ашиглана уу.
AUTH-018403Хүсэлт түлхүүрийн зөвшөөрөгдсөн IP жагсаалтад ороогүй хаягаас ирсэн.
AUTH-058403API key-д энэ үйлдэлд шаардлагатай scope байхгүй байна.
SIG-002401Хүсэлтийн цагийн тэмдэг зөвшөөрөгдсөн хугацааны гадна байна.
SIG-003401Хүсэлтийн гарын үсэг байхгүй эсвэл таарахгүй байна.
SIG-005409Энэ хүсэлтийн nonce өмнө нь ашиглагдсан байна.
VAL-014400TapPay-Version header нь мэдэгдэх API хувилбар биш байна.
BIZ-004403Terminal идэвхгүй байна.
BIZ-005403Мерчантын данс энэ хүсэлтийг зөвшөөрөх төлөвт байхгүй байна.
VAL-002400Заавал байх талбар эсвэл header дутуу байна.
VAL-010409Энэ Idempotency-Key өөр хүсэлтийн биетэй өмнө нь ашиглагдсан байна.
VAL-013409Энэ Idempotency-Key-тэй хүсэлт боловсруулагдаж байна.
VAL-001400Хүсэлт шалгалтад тэнцсэнгүй.
curl -sS -X POST "https://api.tappay.mn/api/v1/payments/PAYMENT_ID/receipt" \
  -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 '{"receiptKind":"WITH_EBARIMT","receiptType":"B2C","ddtd":"DDTD-EXAMPLE-0001","merchantReceiptNo":"rcpt-'"$(uuidgen)"'","amount":"1000","vat":"90.91","issuedAt":"2026-10-03T10:00:00Z","lines":[{"name":"Order 1","quantity":"1","unitPrice":"1000","totalAmount":"1000"}]}'
import { TapPay } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const receipt = await tappay.receipts.submit({
  id: 'PAYMENT_ID',
  body: {
    receiptKind: 'WITH_EBARIMT',
    receiptType: 'B2C',
    ddtd: 'DDTD-EXAMPLE-0001',
    merchantReceiptNo: `rcpt-${crypto.randomUUID()}`,
    amount: '1000',
    vat: '90.91',
    issuedAt: '2026-10-03T10:00:00Z',
    lines: [
      {
        name: 'Order 1',
        quantity: '1',
        unitPrice: '1000',
        totalAmount: '1000',
      },
    ],
  },
});
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->submit([
    'id' => 'PAYMENT_ID',
    'body' => [
        'receiptKind' => 'WITH_EBARIMT',
        'receiptType' => 'B2C',
        'ddtd' => 'DDTD-EXAMPLE-0001',
        'merchantReceiptNo' => 'rcpt-' . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)) . '',
        'amount' => '1000',
        'vat' => '90.91',
        'issuedAt' => '2026-10-03T10:00:00Z',
        'lines' => [
            [
                'name' => 'Order 1',
                'quantity' => '1',
                'unitPrice' => '1000',
                'totalAmount' => '1000',
            ],
        ],
    ],
]);
echo json_encode($receipt);
import json
import uuid
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
receipt = client.receipts.submit({
    "id": "PAYMENT_ID",
    "body": {
        "receiptKind": "WITH_EBARIMT",
        "receiptType": "B2C",
        "ddtd": "DDTD-EXAMPLE-0001",
        "merchantReceiptNo": "rcpt-" + str(uuid.uuid4()) + "",
        "amount": "1000",
        "vat": "90.91",
        "issuedAt": "2026-10-03T10:00:00Z",
        "lines": [
            {
                "name": "Order 1",
                "quantity": "1",
                "unitPrice": "1000",
                "totalAmount": "1000",
            },
        ],
    },
})
print(json.dumps(receipt))
{
  "success": true,
  "data": {
    "receipt": {
      "id": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e07",
      "status": "REGISTERED",
      "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": null,
      "failureReason": null,
      "lines": [
        {
          "name": "Order 1",
          "quantity": "1",
          "unitPrice": "1000",
          "totalAmount": "1000"
        }
      ],
      "attempts": 0,
      "nextAttemptAt": null,
      "recipientFallback": false,
      "parts": null
    },
    "history": []
  }
}

Бүтэн урсгалыг гарын авлагаас үзнэ үү.