Orders and refunds
Every sale is an order with its items, linked to its payments, refunds, and disputes, whoever sells.
Every sale becomes an order you can follow from checkout to refund in one place, with its items, its payments, and anything that happened after.
Orders
An order is the sale with its items. Pay.com creates one when a checkout session or a payment link is paid, including the first payment of a subscription. Each order links to its payments in Activity, and each payment links back to its order, so you can move between what was sold and how it was paid.
The order shows how it was paid in payment_method_details, from its charge. It has the payment method's type, and for a card, including one in a wallet, card with the brand, last4, exp_month, and exp_year. wallet names the wallet the card was in, such as apple_pay, or is null.
Fulfill an order when the order.paid webhook arrives. It's the proof of payment, and it carries the order's items. For access, features, and seats, use entitlements.
Retrieve an order with GET /v1/orders/{order_id}, or list a customer's orders with GET /v1/orders.
Mark an order shipped
When you ship an order's items, mark the order shipped in the Commerce tab, or send shipped_at with PATCH /v1/orders/{order_id}. The time can't be in the future or before the order was paid. Pay.com sends order.updated, and the order shows the time in shipped_at.
curl -X PATCH https://api.sandbox.pay.com/v1/orders/ord_691204561890402304 \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-d '{ "shipped_at": "2026-11-25T16:00:00.000Z" }'{
"id": "ord_691204561890402304",
"resource": "order",
"number": "CL-10478",
"status": "paid",
"shipped_at": "2026-11-25T16:00:00.000Z",
"created": "2026-11-25T10:30:00.000Z",
"test_mode": true
}To undo it, send shipped_at as null. An order with nothing that ships returns 422 with order_not_shippable. Orders come from checkout sessions and payment links, so shipped_at and metadata are the only fields you can change.
To find the orders left to ship, list orders with shipping set to not_shipped, which returns the orders with items that ship and no shipped_at yet. shipped returns the orders marked shipped. Orders with nothing that ships match neither.
Refunds
Refund an order from the order in the Commerce tab, or with POST /v1/orders/{order_id}/refund. It's the only way to refund an order. Calling POST /v1/refunds for an order's charge returns 422 with use_order_refund, so the order, its invoice, and its credit notes stay in sync.
Without a body, the request refunds what's left to refund. Send line_items to refund particular items with their tax, and include_shipping to refund the shipping with them, or send amount alone for part of the order. Amounts are in the smallest currency unit, so 2170 is $21.70 USD.
curl https://api.sandbox.pay.com/v1/orders/ord_691204561890402304/refund \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"line_items": [{ "line_item": "oli_691204561890402306", "quantity": 1 }],
"reason": "Arrived broken",
"reference": "refund-ord-0042"
}'{
"id": "rfnd_691298114536923136",
"resource": "refund",
"status": "succeeded",
"amount": 2170,
"currency": "usd",
"order": "ord_691204561890402304",
"charge": "chrg_685125114794084352",
"line_items": [{ "line_item": "oli_691204561890402306", "quantity": 1, "amount": 2170 }],
"amount_shipping": 0,
"credit_note": "cn_691298114536923199",
"reason": "Arrived broken",
"reference": "refund-ord-0042",
"created": "2026-11-26T09:12:40.000Z",
"test_mode": true
}The refund is the same object as the Pay.com API's refunds, so GET /v1/refunds/{id} finds it too. GET /v1/orders/{order_id}/refunds lists an order's refunds, oldest first. Pay.com sends the usual refund events and order.refunded with the updated order. When the order has an invoice, Pay.com issues a credit note, and the refund names it in credit_note. Everything else about refunds works as in Payments. See Refunds.
When a refund doesn't go through, the request returns one of these:
422withrefund_failed: the payment method refused the refund, and nothing was refunded.502withrefund_unconfirmed: the payment processor's answer didn't arrive. The refund shows aspendinguntil Pay.com confirms it. A retry with the same idempotency key returns the same answer, never a second refund.
Subscription renewals don't create orders, so you refund a renewal through its invoice, with POST /v1/invoices/{invoice_id}/refund. It refunds what's left, an amount, or particular lines, and issues the credit note. A renewal on an invoice another engine issued is refunded at that engine, and a payment your own system scheduled with POST /v1/refunds. See Refunds go through what billed them.
When Pay.com sells as the merchant of record:
- You can still issue a refund from the order, and Pay.com processes it.
- Pay.com's support can refund too, when a customer asks for one.
- Customers can ask for a refund in the customer portal.
Invoices and credit notes
Whether an order gets an invoice comes from its session's or payment link's invoice_creation, and defaults to your Commerce settings. A refund of an invoiced order issues a credit note. Invoices and credit notes show when Pay.com emailed them to the customer in sent_at. An invoice's hosted_invoice_url and invoice_pdf, and a credit note's credit_note_pdf, are null until Pay.com renders them.
Set how your invoices are numbered and what they show in the Commerce tab, or with PATCH /v1/commerce_settings. The sandbox and live have separate settings, and each key reads and changes its own environment's:
| Setting | What it sets |
|---|---|
invoicing.enabled | Whether orders get an invoice when the session doesn't say. |
invoicing.number_prefix, invoicing.next_number | The invoice series' prefix, such as CL-2026-, and the next number after it. |
invoicing.credit_note_prefix, invoicing.next_credit_note_number | The credit note series' prefix and next number. |
invoicing.footer | Text printed at the foot of every invoice and credit note, up to 500 characters. |
seller | The legal_name, address, tax_id, and email on your invoices and credit notes. Until you set them, they're your legal entity's. Customers' replies to invoice emails go to email. |
A next_number the series has already used returns 422 with number_in_use. Changes apply to orders, invoices, and credit notes from then on. Documents already issued keep the details they were issued with.
Disputes
A dispute appears on its order and in Fraud & Disputes → Disputes in the Pay.com dashboard. When Pay.com sells, Pay.com handles the dispute and its chargeback. When you sell, you respond to it the same way as in Payments. See Disputes.
A dispute on a subscription payment can also cancel or pause the subscription. See Disputes.
In your reports
Orders, order items by product, refunds, and disputes each have a report. See Reports and exports.