Changes the amount, lines, description or expiry of an invoice before it is paid. Send either amount or lines, and your settings decide which fields you can edit.
PATCH /api/v1/invoices/{id}Since 2026-09-27
Authentication Secret key (Bearer)
Headers Name Type Required Values Description TapPay-Versionstring no TapPay-Timestampstring no TapPay-Noncestring no TapPay-Signaturestring no Idempotency-Keystring yes
Path parameters Name Type Required Values Description idstring (uuid) yes
Query parameters Name Type Required Values Description terminalIdstring (uuid) no
Request body Name Type Required Values Description amountnumber no linesarray<object> no lines[].namestring yes lines[].quantitystring yes lines[].unitPricestring yes lines[].totalAmountstring yes lines[].classificationCodestring no lines[].measureUnitstring no lines[].taxProductCodestring no lines[].barCodestring no lines[].barCodeTypestring no GS1, ISBN , UNDEFINED descriptionstring no expiresAtstring no
Response 200 Name Type Required Values Description successboolean yes truedataobject yes data.idstring yes data.orderIdstring yes data.statusstring yes OPEN, PARTIALLY_PAID , PAID , EXPIRED , CANCELLED data.amountnumber yes data.amountPaidnumber yes data.amountReservednumber yes data.partialModestring yes NONE, AMOUNT , LINES data.merchantServiceIdstring | null yes data.currencystring yes data.descriptionstring | null yes data.allowedChannelsarray | null yes data.expiresAtstring yes data.paidAtstring | null yes data.createdAtstring yes data.terminalIdstring yes data.customerstring | null yes data.intentIdsarray<string> yes data.linesarray<object> yes data.lines[].seqinteger yes data.lines[].namestring yes data.lines[].quantitystring yes data.lines[].unitPricestring yes data.lines[].totalAmountstring yes data.lines[].quantityPaidstring yes data.lines[].quantityReservedstring yes data.intentsarray<object> yes data.intents[].idstring yes data.intents[].amountnumber yes data.intents[].statusstring yes OPEN, PROCESSING , SUCCEEDED , EXPIRED , CANCELLED data.intents[].expiresAtstring yes data.intents[].serviceFeenumber | null yes data.intents[].totalnumber yes data.fulfillmentobject | null yes data.fulfillment.statusstring yes PENDING, IN_PROGRESS , COMPLETED , FAILED , CANCELLED data.fulfillment.stagestring | null yes data.fulfillment.messagestring | null yes data.fulfillment.updatedAtstring (date-time) yes data.ebarimtIssuerstring | null yes MERCHANT, NONE , NODE , null
Errors Code Status Message AUTH-001401 The API key is missing, invalid or revoked. EVT-206401 Production keys are not accepted in the sandbox. Use a sandbox key (sk_test_/pk_test_). EVT-207401 Sandbox keys are not accepted in production. Use a production key (sk_live_/pk_live_). AUTH-018403 The request came from an IP address that is not on the key's allowlist. AUTH-058403 The API key does not have the scope this operation requires. SIG-002401 The request timestamp is outside the allowed time window. SIG-003401 The request signature is missing or does not match. SIG-005409 This request nonce was already used. VAL-014400 The TapPay-Version header is not a known API version. BIZ-004403 The terminal is not active. BIZ-005403 The merchant account is not in a state that allows this request. VAL-002400 A required field or header is missing. VAL-010409 This Idempotency-Key was already used with a different request body. VAL-013409 A request with this Idempotency-Key is still being processed. VAL-001400 The request failed validation. PAY-001404 The invoice was not found. PAY-002409 The invoice has already been paid. PAY-003410 The invoice has expired. PAY-004410 The invoice was cancelled. PAY-018422 The invoice lines are invalid or their total does not match the amount. PAY-037422 Editing this field is not allowed by your settings. PAY-038409 A payment for this invoice is in progress, so it cannot be edited. PAY-039422 Subscription invoices and payer-created intents cannot be edited. PAY-040422 Send either amount or lines, not both; with lines, the amount is their total. AFP-001409 The payment intent is locked by another operation. ORD-011409 The fulfillment of an order invoice is managed by the order. SET-007422 The value violates a platform limit.
cURL Node.js PHP Python Copy curl -sS -X PATCH "https://api.tappay.mn/api/v1/invoices/INVOICE_ID" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27" \
-H "Content-Type: application/json" \
-d '{"amount":1200,"description":"Order 1, large cup"}'Copy import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const invoice = await tappay.invoices.update({ id: 'INVOICE_ID', body: { amount: 1200, description: 'Order 1, large cup' } });
console.log(JSON.stringify(invoice));Copy <?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$invoice = $tappay->invoices->update(['id' => 'INVOICE_ID', 'body' => ['amount' => 1200, 'description' => 'Order 1, large cup']]);
echo json_encode($invoice);Copy import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
invoice = client.invoices.update({"id": "INVOICE_ID", "body": {"amount": 1200, "description": "Order 1, large cup"}})
print(json.dumps(invoice))
{
"success" : true ,
"data" : {
"id" : "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e01" ,
"orderId" : "order-1048" ,
"status" : "OPEN" ,
"amount" : 1200 ,
"amountPaid" : 0 ,
"amountReserved" : 1200 ,
"partialMode" : "NONE" ,
"merchantServiceId" : null ,
"currency" : "MNT" ,
"description" : "Order 1, large cup" ,
"allowedChannels" : null ,
"expiresAt" : "2026-10-03T08:45:00.000Z" ,
"paidAt" : null ,
"createdAt" : "2026-10-03T08:15:00.000Z" ,
"terminalId" : "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e05" ,
"customer" : null ,
"intentIds" : [
"0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e03"
],
"lines" : [],
"intents" : [
{
"id" : "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e03" ,
"amount" : 1200 ,
"serviceFee" : null ,
"total" : 1200 ,
"status" : "OPEN" ,
"expiresAt" : "2026-10-03T08:45:00.000Z"
}
],
"fulfillment" : null ,
"ebarimtIssuer" : "MERCHANT"
}
}
TapPay sends invoice.updated after the change.