curl --request PATCH \
--url https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>' \
--data '
{
"amount": 25000,
"description": "Updated payment for order #12345",
"customerId": "123e4567-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}"
payload = {
"amount": 25000,
"description": "Updated payment for order #12345",
"customerId": "123e4567-e89b-12d3-a456-426614174000"
}
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-merchant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 25000,
description: 'Updated payment for order #12345',
customerId: '123e4567-e89b-12d3-a456-426614174000'
})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 25000,
'description' => 'Updated payment for order #12345',
'customerId' => '123e4567-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-merchant-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}"
payload := strings.NewReader("{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["x-merchant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"externalId": "ORDER-123",
"refundedAmount": 0,
"amount": 100.5,
"currency": "USD",
"status": "PENDING",
"payments": [
{
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"status": "PENDING_CAPTURE",
"paymentMethodType": "SPEI",
"amount": "200.99",
"refundedAmount": "0.00",
"currency": "USD",
"paymentMethodId": "<string>",
"lastFailedEventReason": "Insufficient funds",
"lastFailedEventAt": "2025-05-19T18:14:32.424Z",
"createdAt": "2025-05-19T18:14:32.424Z",
"updatedAt": "2025-05-19T18:14:32.523Z",
"billingFirstName": "<string>",
"billingLastName": "<string>",
"billingPhoneNumber": "<string>",
"billingEmail": "jsmith@example.com",
"billingAddressLine1": "<string>",
"billingAddressLine2": "<string>",
"billingCity": "<string>",
"billingState": "<string>",
"billingPostalCode": "<string>",
"billingCountry": "<string>",
"paymentEvents": [
{
"id": "evt-123",
"action": "AUTHORIZATION",
"status": "SUCCESS",
"createdAt": "2025-05-19T18:14:32.424Z",
"amount": "100.50",
"currency": "USD",
"reason": null
}
]
}
],
"subtotalAmount": 100000,
"surchargeAmount": 5000,
"surchargeRate": 5,
"amountPaid": 50000,
"amountPending": 55000,
"allowPartials": false,
"invoiceType": "PUE",
"invoiceStatus": "INVOICED",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"complements": [
{
"id": "9c8b7a6d-5e4f-3c2b-1a0f-9e8d7c6b5a4d",
"paymentId": "a0b0c9d4-6ce9-40e4-873a-e234c1d93639",
"amount": 25000,
"status": "EMITTED",
"paymentEventId": "20912eee-6047-40c7-97b4-48501bb36ef4",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"fiscalInvoiceId": "6a710705bd1842a3122c70ff",
"pdfKey": "invoices/mch_test_001/order-uuid/rep-payment-uuid.pdf",
"emittedAt": "2026-08-06T05:37:35.760Z",
"createdAt": "2026-08-06T05:37:30.100Z"
}
],
"creditNotes": [
{
"id": "9c8b7a6d-5e4f-3c2b-1a0f-9e8d7c6b5a4d",
"paymentId": "a0b0c9d4-6ce9-40e4-873a-e234c1d93639",
"amount": 25000,
"status": "EMITTED",
"paymentEventId": "20912eee-6047-40c7-97b4-48501bb36ef4",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"fiscalInvoiceId": "6a710705bd1842a3122c70ff",
"pdfKey": "invoices/mch_test_001/order-uuid/rep-payment-uuid.pdf",
"emittedAt": "2026-08-06T05:37:35.760Z",
"createdAt": "2026-08-06T05:37:30.100Z"
}
],
"invoiceSummary": {
"capturedCount": 4,
"emittedRepCount": 3,
"pendingRepCount": 0,
"failedRepCount": 1,
"refundEventCount": 1,
"emittedCreditNoteCount": 1,
"pendingCreditNoteCount": 0,
"failedCreditNoteCount": 0,
"isFullyStamped": false
},
"orderNumber": "C25123101",
"invoiceNumber": "INV-2026-001",
"description": "Payment for order #123",
"metadata": {
"orderId": "ORD-123",
"source": "web"
},
"billingAddressLine": "123 Main St",
"billingCity": "New York",
"billingState": "NY",
"billingPostalCode": "10001",
"billingCountry": "US",
"customer": {
"externalId": "CUST-123",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"active": true,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
},
"dueDate": "2026-04-15T00:00:00.000Z",
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"paymentMethod": {
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"type": "CARD",
"cardDetails": {
"id": "<string>",
"type": "CREDIT",
"bin": "411111",
"last4": "1111",
"brand": "VISA",
"country": "US",
"issuerBank": "CHASE",
"expMonth": 12,
"expYear": 2025,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"speiDetails": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clabe": "123456789012345678",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"cieDetails": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "CIE0000000001",
"convenio": "0123456789",
"clabe": "012345678901234567",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"message": "Invalid api key"
}{
"message": "Merchant not found"
}{
"message": "Error message"
}{
"message": "Error message"
}Update a pending payment order
Updates an existing payment order, identified by its unique ID or external ID. Only allowed while the order is in PENDING status; otherwise a 422 is returned. All body fields are optional, but at least one must be provided. Provided fields overwrite the stored values; omitted fields are left unchanged.
curl --request PATCH \
--url https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>' \
--data '
{
"amount": 25000,
"description": "Updated payment for order #12345",
"customerId": "123e4567-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}"
payload = {
"amount": 25000,
"description": "Updated payment for order #12345",
"customerId": "123e4567-e89b-12d3-a456-426614174000"
}
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-merchant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 25000,
description: 'Updated payment for order #12345',
customerId: '123e4567-e89b-12d3-a456-426614174000'
})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 25000,
'description' => 'Updated payment for order #12345',
'customerId' => '123e4567-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-merchant-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}"
payload := strings.NewReader("{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v2/payment-orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["x-merchant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25000,\n \"description\": \"Updated payment for order #12345\",\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"externalId": "ORDER-123",
"refundedAmount": 0,
"amount": 100.5,
"currency": "USD",
"status": "PENDING",
"payments": [
{
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"status": "PENDING_CAPTURE",
"paymentMethodType": "SPEI",
"amount": "200.99",
"refundedAmount": "0.00",
"currency": "USD",
"paymentMethodId": "<string>",
"lastFailedEventReason": "Insufficient funds",
"lastFailedEventAt": "2025-05-19T18:14:32.424Z",
"createdAt": "2025-05-19T18:14:32.424Z",
"updatedAt": "2025-05-19T18:14:32.523Z",
"billingFirstName": "<string>",
"billingLastName": "<string>",
"billingPhoneNumber": "<string>",
"billingEmail": "jsmith@example.com",
"billingAddressLine1": "<string>",
"billingAddressLine2": "<string>",
"billingCity": "<string>",
"billingState": "<string>",
"billingPostalCode": "<string>",
"billingCountry": "<string>",
"paymentEvents": [
{
"id": "evt-123",
"action": "AUTHORIZATION",
"status": "SUCCESS",
"createdAt": "2025-05-19T18:14:32.424Z",
"amount": "100.50",
"currency": "USD",
"reason": null
}
]
}
],
"subtotalAmount": 100000,
"surchargeAmount": 5000,
"surchargeRate": 5,
"amountPaid": 50000,
"amountPending": 55000,
"allowPartials": false,
"invoiceType": "PUE",
"invoiceStatus": "INVOICED",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"complements": [
{
"id": "9c8b7a6d-5e4f-3c2b-1a0f-9e8d7c6b5a4d",
"paymentId": "a0b0c9d4-6ce9-40e4-873a-e234c1d93639",
"amount": 25000,
"status": "EMITTED",
"paymentEventId": "20912eee-6047-40c7-97b4-48501bb36ef4",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"fiscalInvoiceId": "6a710705bd1842a3122c70ff",
"pdfKey": "invoices/mch_test_001/order-uuid/rep-payment-uuid.pdf",
"emittedAt": "2026-08-06T05:37:35.760Z",
"createdAt": "2026-08-06T05:37:30.100Z"
}
],
"creditNotes": [
{
"id": "9c8b7a6d-5e4f-3c2b-1a0f-9e8d7c6b5a4d",
"paymentId": "a0b0c9d4-6ce9-40e4-873a-e234c1d93639",
"amount": 25000,
"status": "EMITTED",
"paymentEventId": "20912eee-6047-40c7-97b4-48501bb36ef4",
"fiscalUuid": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
"fiscalInvoiceId": "6a710705bd1842a3122c70ff",
"pdfKey": "invoices/mch_test_001/order-uuid/rep-payment-uuid.pdf",
"emittedAt": "2026-08-06T05:37:35.760Z",
"createdAt": "2026-08-06T05:37:30.100Z"
}
],
"invoiceSummary": {
"capturedCount": 4,
"emittedRepCount": 3,
"pendingRepCount": 0,
"failedRepCount": 1,
"refundEventCount": 1,
"emittedCreditNoteCount": 1,
"pendingCreditNoteCount": 0,
"failedCreditNoteCount": 0,
"isFullyStamped": false
},
"orderNumber": "C25123101",
"invoiceNumber": "INV-2026-001",
"description": "Payment for order #123",
"metadata": {
"orderId": "ORD-123",
"source": "web"
},
"billingAddressLine": "123 Main St",
"billingCity": "New York",
"billingState": "NY",
"billingPostalCode": "10001",
"billingCountry": "US",
"customer": {
"externalId": "CUST-123",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"active": true,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
},
"dueDate": "2026-04-15T00:00:00.000Z",
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"paymentMethod": {
"id": "856b4a29-a7e5-4726-87d4-77e55d5ecfbf",
"type": "CARD",
"cardDetails": {
"id": "<string>",
"type": "CREDIT",
"bin": "411111",
"last4": "1111",
"brand": "VISA",
"country": "US",
"issuerBank": "CHASE",
"expMonth": 12,
"expYear": 2025,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"speiDetails": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clabe": "123456789012345678",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"cieDetails": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "CIE0000000001",
"convenio": "0123456789",
"clabe": "012345678901234567",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"message": "Invalid api key"
}{
"message": "Merchant not found"
}{
"message": "Error message"
}{
"message": "Error message"
}Authorizations
API key for authentication (required)
Merchant ID for identifying the merchant (required)
Path Parameters
Payment order unique identifier or external ID
1Body
Request body for updating a payment order. Only allowed while the order is in PENDING status. All fields are optional, but at least one must be provided. Any omitted field is left unchanged.
New order amount (positive integer, in the smallest currency unit). Since a pending order carries no surcharge yet, the subtotal is set to the same value.
x > 025000
Three-letter currency code (ISO 4217)
3"MXN"
Payment order description
500"Updated payment for order #12345"
Merchant-provided invoice number; shown to customers instead of orderNumber when present
64"INV-2026-001"
Merchant's own reference for the order
255"REF-12345"
Arbitrary JSON metadata to store with the payment order
{ "orderId": "ORD-123", "source": "web" }
Replaces the order's line items in full. When provided, all existing line items are removed and recreated.
1Show child attributes
Show child attributes
Due date for the payment order. Used for payment reminders. Must be an ISO 8601 date-time string; pass null to clear it.
"2026-04-15T00:00:00.000Z"
ID of an existing customer to link to the order. When provided, it is assigned to the order as-is.
1"123e4567-e89b-12d3-a456-426614174000"
Response
Payment order updated successfully
Unique payment order ID
"856b4a29-a7e5-4726-87d4-77e55d5ecfbf"
External payment order ID from merchant system
"ORDER-123"
Total refunded amount across all payments (in cents)
0
Payment amount
100.5
Three-letter currency code (ISO 4217)
"USD"
Payment order status
PENDING, PROCESSING, REFERENCE_GENERATED, AUTHORIZED, PARTIALLY_AUTHORIZED, ACTION_REQUIRED, COMPLETED, PARTIALLY_PAID, CANCELLATION_REQUESTED, CANCELLED, FAILED, REFUND_PROCESSING, PARTIALLY_REFUNDED, REFUNDED List of payments for a payment order, Note: this information is only available on the order details endpoint
Show child attributes
Show child attributes
Pre-surcharge subtotal in minor units. Equals amount when no surcharge applies. Null on legacy orders predating subtotal tracking.
100000
Surcharge component of amount in minor units, or null when none. On split-tender orders this grows as each partial's surcharge lands and shrinks on refund.
5000
Snapshot of the merchant's surcharge rate (percent) captured at order creation, or null when no surcharge applies.
5
Cumulative sum of captured amounts across this order's Payments (in minor units). Historical ledger — on re-activable orders that get partially refunded and re-paid, this can exceed amount. Use amountPending for live balance.
50000
Outstanding amount left to cover net of refunds (in minor units). Computed as max(0, amount - (amountPaid - amountRefunded)). Reaches 0 when the order is fully paid net of any refunds — the only live-balance field on the snapshot.
55000
True when the order accepts multiple Payments via POST /v2/payment-orders/{id}/payments. Set at creation time.
false
CFDI invoice type derived from the flow. PUE for legacy 1:1 orders (single CFDI). PPD for split-tender orders (parent + REP per capture + credit note per refund). Null when the order is not fiscal.
PUE, PPD "PUE"
Overall CFDI status. For PPD this reflects the parent CFDI; use invoiceSummary for per-REP / per-credit-note granularity.
PENDING, INVOICED, FAILED "INVOICED"
SAT UUID (folio fiscal) of the parent CFDI. Present once invoiceStatus = INVOICED.
"b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6"
PPD-only: emitted REP complements (Recibos Electrónicos de Pago). One row per successfully-stamped Payment. Always present as an array (empty [] for PUE / non-fiscal orders).
Show child attributes
Show child attributes
PPD-only: emitted Notas de Crédito. One row per successfully-stamped refund event. Always present as an array (empty [] for PUE / non-fiscal orders).
Show child attributes
Show child attributes
PPD-only: aggregated stamping progress. Undefined for PUE and non-fiscal orders — the UI should treat its absence as 'not a PPD order'.
Show child attributes
Show child attributes
Unique order number generated by the system
"C25123101"
Merchant-provided invoice number; shown to customers instead of orderNumber when present
64"INV-2026-001"
Payment description
"Payment for order #123"
Arbitrary JSON metadata stored with the payment order
{ "orderId": "ORD-123", "source": "web" }
Billing address line
"123 Main St"
Billing city
"New York"
Billing state
"NY"
Billing postal code
"10001"
Billing country code
"US"
Show child attributes
Show child attributes
Due date for the payment order. Used for payment reminder notifications.
"2026-04-15T00:00:00.000Z"
Payment order creation timestamp
"2024-03-20T10:00:00Z"
Payment order last update timestamp
"2024-03-20T10:00:00Z"
Show child attributes
Show child attributes