Skip to main content
POST
Create a payment order (v2)

Authorizations

x-api-key
string
header
required

API key for authentication (required)

x-merchant-id
string
header
required

Merchant ID for identifying the merchant (required)

Body

application/json
customer
object
required
amount
number
required

Payment amount (must be positive)

Required range: x > 0
Example:

100.5

currency
string
required

Three-letter currency code (ISO 4217)

Required string length: 3
Example:

"MXN"

externalId
string
required

External reference ID from merchant system (required)

Minimum string length: 1
Example:

"ORDER-12345"

pending
boolean
default:false

When set to true, creates the payment order in PENDING status without processing payment immediately. The payment can later be charged using the charge endpoint (POST /v2/payment-orders/{id}/charge). When pending is true, paymentMethod is not required.

allowPartials
boolean
default:false

When set to true, the order accepts multiple Payments via the addPayment endpoint (POST /v2/payment-orders/{id}/payments) until the order amount is fully covered. While the order is open, the merchant can use mixed payment methods (CARD, SPEI, CIE, PayCash) across the same order. A refund on any of those Payments re-activates the order back to PARTIALLY_PAID so a new Payment can fill the gap. Only honored when pending: true — orders with a synchronous payment method on creation are not split-tender.

paymentMethod
object

Payment method to use for the order. Required when pending is false (default). Not required when pending is true — in that case, the payment method is provided later via the charge endpoint.

description
string

Payment order description

Example:

"Payment for order #12345"

invoiceNumber
string | null

Merchant-provided invoice number; shown to customers instead of orderNumber when present

Maximum string length: 64
Example:

"INV-2026-001"

billingAddress
object

Billing address (required when paymentMethod.type is 'card')

deviceInformation
object

Device and browser information for fraud detection

metadata
object | null

Arbitrary JSON metadata to store with the payment order

Example:
isVirtualTerminal
boolean
default:false

Whether the payment originates from a Virtual Terminal. When true, the 3DS flow is skipped in the Decision Manager.

dueDate
string<date-time> | null

Optional due date for the payment order. Used for payment reminders. Must be an ISO 8601 date-time string.

Example:

"2026-04-15T00:00:00.000Z"

fiscalConfig
object

End customer's fiscal data, used to issue the CFDI when the order is stamped. All fields optional — taxId (RFC) can be added later via the manual stamp endpoint with fiscalConfig override.

lineItems
object[]

Line items that make up the order. The sum of quantity * unitPrice across all items must equal the order amount (with a 0.001 tolerance). Used to populate the CFDI conceptos when stamping.

Response

Payment order created successfully

id
string<uuid>
required

Payment order unique identifier

Example:

"123e4567-e89b-12d3-a456-426614174000"

amount
number
required

Total amount charged to the customer (subtotalAmount + surchargeAmount).

Example:

257.5

currency
string
required

Currency code

Example:

"MXN"

status
enum<string>
required

Payment order status

Available options:
PENDING,
PROCESSING,
REFERENCE_GENERATED,
AUTHORIZED,
PARTIALLY_AUTHORIZED,
ACTION_REQUIRED,
COMPLETED,
PARTIALLY_PAID,
CANCELLATION_REQUESTED,
CANCELLED,
FAILED,
REFUND_PROCESSING,
PARTIALLY_REFUNDED,
REFUNDED
Example:

"PENDING"

externalMerchantReference
string

External merchant reference ID

Example:

"ORDER-12345"

subtotalAmount
number

Merchandise subtotal — the amount agreed before any surcharge. Immutable after order creation.

Example:

250

surchargeAmount
number | null

Surcharge applied on top of subtotalAmount. Null when no surcharge applies.

Example:

7.5

surchargeRate
number | null

Snapshot of the merchant's surcharge rate (percent) at charge time. Null when no surcharge applies.

Example:

3

orderNumber
string

System-generated order number

Example:

"C25123101"

description
string

Payment order description

Example:

"Payment for order #12345"

metadata
object | null

Arbitrary JSON metadata stored with the payment order

Example:
dueDate
string<date-time> | null

Due date for the payment order

Example:

"2026-04-15T00:00:00.000Z"

createdAt
string<date-time>

Creation timestamp

Example:

"2025-10-20T10:00:00.000Z"

paymentMethod
object
allowPartials
boolean

Echoes the allowPartials flag from creation. When true, the order accepts additional Payments via the addPayment endpoint until it is fully covered.

Example:

true

amountPaid
number

Cumulative sum of captured amounts on this order. On split-tender orders that get partially refunded and re-paid, this can grow beyond amount because it is a historical ledger; use amountPending (or compute amountPaid - amountRefunded) to know the live balance.

Example:

200

amountPending
number

Outstanding amount left to cover, derived as max(0, amount - (amountPaid - amountRefunded)). Reaches 0 when the order is fully paid net of refunds.

Example:

50

amountRefunded
number

Cumulative sum of refunded amounts across the order's Payments. Like amountPaid, this is a historical ledger and is bounded per Payment by module-payment.

Example:

50

payment
object

The Payment that triggered this response (the one just created for the addPayment / charge call, or the original Payment for a regular create).

payments
object[]

All Payments associated with this order, ordered by creation time (oldest first), including the one in the payment field. Useful for split-tender clients that need to enumerate every Payment.

customer
object
payerAuthentication
object

3DS authentication details (when required)