Charge a saved payment method
Charges a customer’s saved payment method without the customer being present. Send the customer, the paymentMethod, the amount and a description.
Changes in 2026-09-27This operation is not available in this version.
POST /api/v1/paymentsSince 2026-09-27
Authentication
Secret key (Bearer)
Headers
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
TapPay-Version | string | no | ||
TapPay-Timestamp | string | no | ||
TapPay-Nonce | string | no | ||
TapPay-Signature | string | no | ||
Idempotency-Key | string | yes |
Request body
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
customer | string | yes | ||
paymentMethod | string | yes | ||
amount | number | yes | ||
description | string | yes | ||
orderId | string | no | ||
terminalId | string (uuid) | no |
Response 201
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
success | boolean | yes | true | |
data | object | yes | ||
data.id | string | yes | ||
data.intentId | string | yes | ||
data.invoiceId | string | null | yes | ||
data.status | string | yes | PROCESSING, SUCCEEDED, FAILED, OVERPAID, AUTHORIZED, CANCELLED | |
data.amount | number | yes | ||
data.currency | string | yes | ||
data.channel | string | yes | QPAY, NODE_QR, WECHAT, CARD, R2P | |
data.payerWallet | object | null | yes | ||
data.payerWallet.code | string | yes | ||
data.payerWallet.name | string | yes | ||
data.payerWallet.logoUrl | string | null | yes | ||
data.payerWallet.type | string | yes | APP, WEB, WECHAT | |
data.sticker | object | null | yes | ||
data.sticker.serialNo | string | null | yes | ||
data.sticker.sqrRef | string | yes | ||
data.sticker.name | string | null | yes | ||
data.feeAmount | number | null | yes | ||
data.merchantNet | number | null | yes | ||
data.serviceFeeMerchant | number | yes | ||
data.serviceFeeCustomer | number | yes | ||
data.succeededAt | string | null | yes | ||
data.createdAt | string | yes | ||
data.fulfillment | object | null | yes | ||
data.fulfillment.status | string | yes | PENDING, IN_PROGRESS, COMPLETED, FAILED, CANCELLED | |
data.fulfillment.stage | string | null | yes | ||
data.fulfillment.message | string | null | yes | ||
data.fulfillment.updatedAt | string (date-time) | yes | ||
data.receipt | object | null | yes | ||
data.receipt.receipt | object | yes | ||
data.receipt.receipt.id | string (uuid) | yes | ||
data.receipt.receipt.status | string | yes | PENDING, REGISTERED, FAILED, RETURNED | |
data.receipt.receipt.issuer | string | yes | MERCHANT, NODE | |
data.receipt.receipt.receiptType | string | null | yes | B2C, B2B, SALES, null | |
data.receipt.receipt.ddtd | string | null | yes | ||
data.receipt.receipt.lottery | string | null | yes | ||
data.receipt.receipt.qrData | string | null | yes | ||
data.receipt.receipt.url | string | null | yes | ||
data.receipt.receipt.merchantReceiptNo | string | null | yes | ||
data.receipt.receipt.amount | string | null | yes | ||
data.receipt.receipt.vat | string | null | yes | ||
data.receipt.receipt.cityTax | string | null | yes | ||
data.receipt.receipt.issuedAt | string | null | yes | ||
data.receipt.receipt.returnedAt | string | null | yes | ||
data.receipt.receipt.failureReason | string | null | yes | ||
data.receipt.receipt.lines | array | null | yes | ||
data.receipt.receipt.attempts | integer | yes | ||
data.receipt.receipt.nextAttemptAt | string | null | yes | ||
data.receipt.receipt.recipientFallback | boolean | yes | ||
data.receipt.receipt.parts | array | null | yes | ||
data.receipt.history | array<object> | yes | ||
data.receipt.history[].id | string (uuid) | yes | ||
data.receipt.history[].status | string | yes | PENDING, REGISTERED, FAILED, RETURNED | |
data.receipt.history[].issuer | string | yes | MERCHANT, NODE | |
data.receipt.history[].receiptType | string | null | yes | B2C, B2B, SALES, null | |
data.receipt.history[].ddtd | string | null | yes | ||
data.receipt.history[].lottery | string | null | yes | ||
data.receipt.history[].qrData | string | null | yes | ||
data.receipt.history[].url | string | null | yes | ||
data.receipt.history[].merchantReceiptNo | string | null | yes | ||
data.receipt.history[].amount | string | null | yes | ||
data.receipt.history[].vat | string | null | yes | ||
data.receipt.history[].cityTax | string | null | yes | ||
data.receipt.history[].issuedAt | string | null | yes | ||
data.receipt.history[].returnedAt | string | null | yes | ||
data.receipt.history[].failureReason | string | null | yes | ||
data.receipt.history[].lines | array | null | yes | ||
data.receipt.history[].attempts | integer | yes | ||
data.receipt.history[].nextAttemptAt | string | null | yes | ||
data.receipt.history[].recipientFallback | boolean | yes | ||
data.receipt.history[].parts | array | null | yes | ||
data.ebarimt | object | null | yes | ||
data.ebarimt.id | string (uuid) | yes | ||
data.ebarimt.status | string | yes | PENDING, REGISTERED, FAILED, RETURNED | |
data.ebarimt.issuer | string | yes | MERCHANT, NODE | |
data.ebarimt.receiptType | string | null | yes | B2C, B2B, SALES, null | |
data.ebarimt.ddtd | string | null | yes | ||
data.ebarimt.lottery | string | null | yes | ||
data.ebarimt.qrData | string | null | yes | ||
data.ebarimt.url | string | null | yes | ||
data.ebarimt.merchantReceiptNo | string | null | yes | ||
data.ebarimt.amount | string | null | yes | ||
data.ebarimt.vat | string | null | yes | ||
data.ebarimt.cityTax | string | null | yes | ||
data.ebarimt.issuedAt | string | null | yes | ||
data.ebarimt.returnedAt | string | null | yes | ||
data.ebarimt.failureReason | string | null | yes | ||
data.ebarimt.lines | array | null | yes | ||
data.ebarimt.attempts | integer | yes | ||
data.ebarimt.nextAttemptAt | string | null | yes | ||
data.ebarimt.recipientFallback | boolean | yes | ||
data.ebarimt.parts | array | null | yes | ||
data.authorizationType | string | yes | FINAL, PREAUTH | |
data.preauthMode | string | null | yes | CHARGE_REFUND, HOLD, null | |
data.preauthStatus | string | null | yes | OPEN, FINALIZED, AUTO_FINALIZED, null | |
data.finalAmount | string | null | yes | ||
data.finalizeDueAt | string | null | yes | ||
data.authorizedAt | string | null | yes | ||
data.preauthRefundId | string | null | yes | ||
data.paymentMethodId | string | no | ||
data.customer | string | no | ||
data.failureCode | string | null | no | ||
data.declineRetryable | boolean | no | ||
data.ebarimtRecipient | object | null | yes | ||
data.ebarimtRecipient.type | string | yes | CITIZEN, ORG, NONE | |
data.ebarimtRecipient.register | string | null | yes | ||
data.ebarimtRecipient.tin | string | null | yes | ||
data.ebarimtRecipient.email | string | null | yes | ||
data.settlement | object | null | yes | ||
data.settlement.cycleId | string (uuid) | yes | ||
data.settlement.businessDate | string | yes | ||
data.settlement.seq | integer | yes | ||
data.settlement.status | string | yes | OPEN, RUNNING, CLOSED, CARRIED | |
data.settlement.credited | boolean | yes | ||
data.promotions | array<object> | no | ||
data.promotions[].promotionId | string (uuid) | yes | ||
data.promotions[].kind | string | yes | ||
data.promotions[].amount | number | yes |
Errors
| Code | Status | Message |
|---|---|---|
AUTH-001 | 401 | The API key is missing, invalid or revoked. |
EVT-206 | 401 | Production keys are not accepted in the sandbox. Use a sandbox key (sk_test_/pk_test_). |
EVT-207 | 401 | Sandbox keys are not accepted in production. Use a production key (sk_live_/pk_live_). |
AUTH-018 | 403 | The request came from an IP address that is not on the key's allowlist. |
AUTH-058 | 403 | The API key does not have the scope this operation requires. |
SIG-002 | 401 | The request timestamp is outside the allowed time window. |
SIG-003 | 401 | The request signature is missing or does not match. |
SIG-005 | 409 | This request nonce was already used. |
VAL-014 | 400 | The TapPay-Version header is not a known API version. |
BIZ-004 | 403 | The terminal is not active. |
BIZ-005 | 403 | The merchant account is not in a state that allows this request. |
VAL-002 | 400 | A required field or header is missing. |
VAL-010 | 409 | This Idempotency-Key was already used with a different request body. |
VAL-013 | 409 | A request with this Idempotency-Key is still being processed. |
VAL-001 | 400 | The request failed validation. |
VAL-005 | 400 | A date value is not valid. |
VAL-009 | 400 | A string value is longer than the allowed maximum. |
PAY-001 | 404 | The invoice was not found. |
PAY-012 | 409 | The payment intent is no longer open. |
PAY-017 | 422 | The amount is greater than the remaining amount to pay. |
PAY-027 | 409 | The invoice cannot be paid in its current state. |
PAY-031 | 422 | The customer was not found. |
BIZ-002 | 400 | The merchant's daily limit would be exceeded. |
BIZ-013 | 404 | The terminal was not found. |
SET-002 | 400 | A required platform setting is missing or unknown. |
SET-007 | 422 | The value violates a platform limit. |
FSC-013 | 500 | The fee could not be calculated because the destination cannot be resolved. |
PYO-207 | 422 | The split beneficiary is not active. |
EVT-202 | 422 | The test card number is not a known sandbox test card. |
AFP-001 | 409 | The payment intent is locked by another operation. |
RCR-002 | 422 | The customer request body is not valid. |
RCR-003 | 404 | The payment method was not found. |
RCR-004 | 422 | This kind of payment method is not available. |
RCR-012 | 422 | The provider credentials required for this payment are not configured. |
RCR-051 | 422 | Merchant-initiated payments are not enabled for this merchant. |
RCR-052 | 422 | The payment method requires action from the customer before it can be charged. |
RCR-053 | 422 | The payment method is not active. |
RCR-054 | 422 | The payment rail does not support merchant-initiated payments. |
RCR-055 | 422 | The mandate limit does not allow this charge. |
RCR-056 | 422 | The retry limit for this merchant-initiated payment has been reached. |
RCR-057 | 422 | The payment method's usage does not match this payment. |
SVC-044 | 422 | The merchant service configuration is not valid. |
PRE-002 | 422 | A field in the request is not allowed for pre-authorization payments. |
PRE-014 | 422 | The authorization type is not allowed for this payment. |
RCR-059 | 422 | The card token's scope does not allow this payment. |
curl -sS -X POST "https://api.tappay.mn/api/v1/payments" \
-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 '{"terminalId":"YOUR_TERMINAL_ID","customer":"CUSTOMER_ID","paymentMethod":"PAYMENT_METHOD_ID","amount":500,"description":"Monthly fee"}'import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const payment = await tappay.payments.create({
body: {
terminalId: 'YOUR_TERMINAL_ID',
customer: 'CUSTOMER_ID',
paymentMethod: 'PAYMENT_METHOD_ID',
amount: 500,
description: 'Monthly fee',
},
});
console.log(JSON.stringify(payment));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$payment = $tappay->payments->create([
'body' => [
'terminalId' => 'YOUR_TERMINAL_ID',
'customer' => 'CUSTOMER_ID',
'paymentMethod' => 'PAYMENT_METHOD_ID',
'amount' => 500,
'description' => 'Monthly fee',
],
]);
echo json_encode($payment);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
payment = client.payments.create({
"body": {
"terminalId": "YOUR_TERMINAL_ID",
"customer": "CUSTOMER_ID",
"paymentMethod": "PAYMENT_METHOD_ID",
"amount": 500,
"description": "Monthly fee",
},
})
print(json.dumps(payment)){
"success": true,
"data": {
"id": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e04",
"ebarimt": null,
"intentId": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e03",
"invoiceId": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e01",
"status": "SUCCEEDED",
"amount": 500,
"currency": "MNT",
"channel": "CARD",
"payerWallet": null,
"sticker": null,
"feeAmount": 8,
"merchantNet": 492,
"serviceFeeMerchant": 0,
"serviceFeeCustomer": 0,
"succeededAt": "2026-10-03T08:16:12.000Z",
"createdAt": "2026-10-03T08:16:12.000Z",
"fulfillment": null,
"receipt": null,
"authorizationType": "FINAL",
"preauthMode": null,
"preauthStatus": null,
"finalAmount": null,
"finalizeDueAt": null,
"authorizedAt": null,
"preauthRefundId": null,
"ebarimtRecipient": null,
"settlement": null
}
}
For the full flow, read the guide.