Skip to content

Charge a saved payment method

View as Markdown

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-27

POST /api/v1/paymentsSince 2026-09-27

Authentication

Secret key (Bearer)

Headers

NameTypeRequiredValuesDescription
TapPay-Versionstringno
TapPay-Timestampstringno
TapPay-Noncestringno
TapPay-Signaturestringno
Idempotency-Keystringyes

Request body

NameTypeRequiredValuesDescription
customerstringyes
paymentMethodstringyes
amountnumberyes
descriptionstringyes
orderIdstringno
terminalIdstring (uuid)no

Response 201

NameTypeRequiredValuesDescription
successbooleanyestrue
dataobjectyes
data.idstringyes
data.intentIdstringyes
data.invoiceIdstring | nullyes
data.statusstringyesPROCESSING, SUCCEEDED, FAILED, OVERPAID, AUTHORIZED, CANCELLED
data.amountnumberyes
data.currencystringyes
data.channelstringyesQPAY, NODE_QR, WECHAT, CARD, R2P
data.payerWalletobject | nullyes
data.payerWallet.codestringyes
data.payerWallet.namestringyes
data.payerWallet.logoUrlstring | nullyes
data.payerWallet.typestringyesAPP, WEB, WECHAT
data.stickerobject | nullyes
data.sticker.serialNostring | nullyes
data.sticker.sqrRefstringyes
data.sticker.namestring | nullyes
data.feeAmountnumber | nullyes
data.merchantNetnumber | nullyes
data.serviceFeeMerchantnumberyes
data.serviceFeeCustomernumberyes
data.succeededAtstring | nullyes
data.createdAtstringyes
data.fulfillmentobject | nullyes
data.fulfillment.statusstringyesPENDING, IN_PROGRESS, COMPLETED, FAILED, CANCELLED
data.fulfillment.stagestring | nullyes
data.fulfillment.messagestring | nullyes
data.fulfillment.updatedAtstring (date-time)yes
data.receiptobject | nullyes
data.receipt.receiptobjectyes
data.receipt.receipt.idstring (uuid)yes
data.receipt.receipt.statusstringyesPENDING, REGISTERED, FAILED, RETURNED
data.receipt.receipt.issuerstringyesMERCHANT, NODE
data.receipt.receipt.receiptTypestring | nullyesB2C, B2B, SALES, null
data.receipt.receipt.ddtdstring | nullyes
data.receipt.receipt.lotterystring | nullyes
data.receipt.receipt.qrDatastring | nullyes
data.receipt.receipt.urlstring | nullyes
data.receipt.receipt.merchantReceiptNostring | nullyes
data.receipt.receipt.amountstring | nullyes
data.receipt.receipt.vatstring | nullyes
data.receipt.receipt.cityTaxstring | nullyes
data.receipt.receipt.issuedAtstring | nullyes
data.receipt.receipt.returnedAtstring | nullyes
data.receipt.receipt.failureReasonstring | nullyes
data.receipt.receipt.linesarray | nullyes
data.receipt.receipt.attemptsintegeryes
data.receipt.receipt.nextAttemptAtstring | nullyes
data.receipt.receipt.recipientFallbackbooleanyes
data.receipt.receipt.partsarray | nullyes
data.receipt.historyarray<object>yes
data.receipt.history[].idstring (uuid)yes
data.receipt.history[].statusstringyesPENDING, REGISTERED, FAILED, RETURNED
data.receipt.history[].issuerstringyesMERCHANT, NODE
data.receipt.history[].receiptTypestring | nullyesB2C, B2B, SALES, null
data.receipt.history[].ddtdstring | nullyes
data.receipt.history[].lotterystring | nullyes
data.receipt.history[].qrDatastring | nullyes
data.receipt.history[].urlstring | nullyes
data.receipt.history[].merchantReceiptNostring | nullyes
data.receipt.history[].amountstring | nullyes
data.receipt.history[].vatstring | nullyes
data.receipt.history[].cityTaxstring | nullyes
data.receipt.history[].issuedAtstring | nullyes
data.receipt.history[].returnedAtstring | nullyes
data.receipt.history[].failureReasonstring | nullyes
data.receipt.history[].linesarray | nullyes
data.receipt.history[].attemptsintegeryes
data.receipt.history[].nextAttemptAtstring | nullyes
data.receipt.history[].recipientFallbackbooleanyes
data.receipt.history[].partsarray | nullyes
data.ebarimtobject | nullyes
data.ebarimt.idstring (uuid)yes
data.ebarimt.statusstringyesPENDING, REGISTERED, FAILED, RETURNED
data.ebarimt.issuerstringyesMERCHANT, NODE
data.ebarimt.receiptTypestring | nullyesB2C, B2B, SALES, null
data.ebarimt.ddtdstring | nullyes
data.ebarimt.lotterystring | nullyes
data.ebarimt.qrDatastring | nullyes
data.ebarimt.urlstring | nullyes
data.ebarimt.merchantReceiptNostring | nullyes
data.ebarimt.amountstring | nullyes
data.ebarimt.vatstring | nullyes
data.ebarimt.cityTaxstring | nullyes
data.ebarimt.issuedAtstring | nullyes
data.ebarimt.returnedAtstring | nullyes
data.ebarimt.failureReasonstring | nullyes
data.ebarimt.linesarray | nullyes
data.ebarimt.attemptsintegeryes
data.ebarimt.nextAttemptAtstring | nullyes
data.ebarimt.recipientFallbackbooleanyes
data.ebarimt.partsarray | nullyes
data.authorizationTypestringyesFINAL, PREAUTH
data.preauthModestring | nullyesCHARGE_REFUND, HOLD, null
data.preauthStatusstring | nullyesOPEN, FINALIZED, AUTO_FINALIZED, null
data.finalAmountstring | nullyes
data.finalizeDueAtstring | nullyes
data.authorizedAtstring | nullyes
data.preauthRefundIdstring | nullyes
data.paymentMethodIdstringno
data.customerstringno
data.failureCodestring | nullno
data.declineRetryablebooleanno
data.ebarimtRecipientobject | nullyes
data.ebarimtRecipient.typestringyesCITIZEN, ORG, NONE
data.ebarimtRecipient.registerstring | nullyes
data.ebarimtRecipient.tinstring | nullyes
data.ebarimtRecipient.emailstring | nullyes
data.settlementobject | nullyes
data.settlement.cycleIdstring (uuid)yes
data.settlement.businessDatestringyes
data.settlement.seqintegeryes
data.settlement.statusstringyesOPEN, RUNNING, CLOSED, CARRIED
data.settlement.creditedbooleanyes
data.promotionsarray<object>no
data.promotions[].promotionIdstring (uuid)yes
data.promotions[].kindstringyes
data.promotions[].amountnumberyes

Errors

CodeStatusMessage
AUTH-001401The API key is missing, invalid or revoked.
EVT-206401Production keys are not accepted in the sandbox. Use a sandbox key (sk_test_/pk_test_).
EVT-207401Sandbox keys are not accepted in production. Use a production key (sk_live_/pk_live_).
AUTH-018403The request came from an IP address that is not on the key's allowlist.
AUTH-058403The API key does not have the scope this operation requires.
SIG-002401The request timestamp is outside the allowed time window.
SIG-003401The request signature is missing or does not match.
SIG-005409This request nonce was already used.
VAL-014400The TapPay-Version header is not a known API version.
BIZ-004403The terminal is not active.
BIZ-005403The merchant account is not in a state that allows this request.
VAL-002400A required field or header is missing.
VAL-010409This Idempotency-Key was already used with a different request body.
VAL-013409A request with this Idempotency-Key is still being processed.
VAL-001400The request failed validation.
VAL-005400A date value is not valid.
VAL-009400A string value is longer than the allowed maximum.
PAY-001404The invoice was not found.
PAY-012409The payment intent is no longer open.
PAY-017422The amount is greater than the remaining amount to pay.
PAY-027409The invoice cannot be paid in its current state.
PAY-031422The customer was not found.
BIZ-002400The merchant's daily limit would be exceeded.
BIZ-013404The terminal was not found.
SET-002400A required platform setting is missing or unknown.
SET-007422The value violates a platform limit.
FSC-013500The fee could not be calculated because the destination cannot be resolved.
PYO-207422The split beneficiary is not active.
EVT-202422The test card number is not a known sandbox test card.
AFP-001409The payment intent is locked by another operation.
RCR-002422The customer request body is not valid.
RCR-003404The payment method was not found.
RCR-004422This kind of payment method is not available.
RCR-012422The provider credentials required for this payment are not configured.
RCR-051422Merchant-initiated payments are not enabled for this merchant.
RCR-052422The payment method requires action from the customer before it can be charged.
RCR-053422The payment method is not active.
RCR-054422The payment rail does not support merchant-initiated payments.
RCR-055422The mandate limit does not allow this charge.
RCR-056422The retry limit for this merchant-initiated payment has been reached.
RCR-057422The payment method's usage does not match this payment.
SVC-044422The merchant service configuration is not valid.
PRE-002422A field in the request is not allowed for pre-authorization payments.
PRE-014422The authorization type is not allowed for this payment.
RCR-059422The 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.