Skip to Content
Docs
Orders

Update an order

PATCH/orders/{order_id}

Orders come from checkout sessions and payment links, so only metadata and shipped_at change. Set shipped_at when you ship an order's items, or null to undo it. Pay.com sends order.updated.

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.

Path parameters

order_idstringRequired

The order's ID (ord_).

Parameters

metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

shipped_atstring or null

When the items shipped. It can't be in the future or before the order was paid.

Returns

The order.

idstring
resourcestring
numberstring

The order number customers see, in your series, for example CL-10478.

statusstring

One of paid, partially_refunded or refunded.

disputedboolean

Whether a dispute is open on its charge.

currencystring

Three-letter ISO currency code, in lowercase.

amount_subtotalinteger
amount_shippinginteger
Show 23 more attributesShow fewer attributes
amount_taxinteger
amount_totalinteger
amount_refundedinteger
line_itemsarray of objects
Show 12 child attributesHide child attributes
idstring

The line item (oli_ on orders, csli_ on sessions).

productstring or null

null for the line made from amount and description.

pricestring or null
price_versioninteger or null
namestring
quantityinteger
unit_amountinteger
amount_subtotalinteger
amount_taxinteger
amount_totalinteger
shippableboolean
quantity_refundedinteger
shipping_detailsobject or null
Show 2 child attributesHide child attributes
Option 1object
Show 4 child attributesHide child attributes
namestring
phonestring or null
addressobject
Show 6 child attributesHide child attributes
line1string
line2string or null
citystring
statestring or null
postal_codestring
countrystring

Two-letter country code (ISO 3166-1 alpha-2).

rateobject
Show 4 child attributesHide child attributes
idstring or null

The rate (shr_), or null for one sent inline.

display_namestring
amountinteger
delivery_estimateobject
Show 2 child attributesHide child attributes
minimumobject
Show 2 child attributesHide child attributes
unitstring

One of business_day, day or week.

valueinteger
maximumobject
Show 2 child attributesHide child attributes
unitstring

One of business_day, day or week.

valueinteger
Option 2null
shipped_atstring or null

When you marked the order shipped, from the Commerce tab or with PATCH /v1/orders/{order_id}. null until then, and for an order with nothing that ships.

customer_detailsobject
Show 5 child attributesHide child attributes
emailstring or null
namestring or null
phonestring or null
addressobject or null

The billing address, at the level collected.

Show 2 child attributesHide child attributes
Option 1object
Show 6 child attributesHide child attributes
line1string
line2string or null
citystring
statestring or null
postal_codestring
countrystring

Two-letter country code (ISO 3166-1 alpha-2).

Option 2null
tax_idsarray of objects
Show 3 child attributesHide child attributes
typestring
valuestring
verificationstring

One of valid, invalid or unavailable.

taxobject
Show 5 child attributesHide child attributes
sourcestring

merchant for your own figures, pay_com for Pay.com's calculation (on your tax setup when you sell, and Pay.com's own when it sells), or none.

One of merchant, pay_com or none.

amountinteger
breakdownarray of objects

By jurisdiction, in the shape tax quotes return.

merchant_amountinteger or null

When Pay.com sells and you sent your own figures with this order or invoice: what they came to. Kept beside Pay.com's figures and never charged. Otherwise null.

merchant_breakdownarray of objects or null

The breakdown you sent, kept beside Pay.com's. Set with merchant_amount.

seller_of_recordobject

Who sells: you, or Pay.com as merchant of record. Fixed when the customer pays, and never changed on renewal.

Show 2 child attributesHide child attributes
typestring

pay_com comes with merchant of record.

One of merchant or pay_com.

entitystring

The selling legal entity (ent_).

customerstring
customer_reference_idstring
chargestring
payment_method_detailsobject

How the order was paid, from its charge.

Show 3 child attributesHide child attributes
typestring

The payment method type, as on the main API's charge.

cardobject or null

For a card, including one in a wallet.

Show 4 child attributesHide child attributes
brandstring
last4string
exp_monthinteger
exp_yearinteger
walletstring or null

The wallet the card was in, or null.

checkout_sessionstring or null
invoicestring or null
subscriptionstring or null

The subscription the order started.

refundsarray of strings

The refunds (rfnd_), oldest first.

receipt_urlstring or null

The order's receipt page on the hosted checkout: its checkout session's url, which shows the order as paid once the session is complete. The receipt email's View receipt opens it. null for an order without a checkout session.

referencestring or null
metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

createdstring

When the order was paid.

test_modeboolean

Errors

400
The request is invalid.
401
The API key is missing or wrong.
403
The key's permissions don't allow this route.
404
No such object in this workspace and environment.
422
The request is valid but can't be done. Codes include: - amount_mismatch: amount doesn't equal the line items' total. - price_inactive, product_inactive: an item can't be sold. - currency_mismatch: the items or rates use different currencies. - no_shipping_rate: an item ships and no active rate covers the session's currency. - checkout_not_open: the session is completed or expired. - order_not_refundable: the order is fully refunded, or under a dispute. - amount_exceeds_refundable: more than what's left to refund. - quantity_exceeds_refundable: more of an item than was sold and not yet refunded. - order_not_shippable: shipped_at was sent for an order with nothing that ships. - shipping_rate_inactive: a rate in shipping_options is archived. - tax_exceeds_amount: inclusive tax figures are more than an item's amount. - refund_failed: the payment method refused the refund. Nothing was refunded. - custom_css_not_approved: the draft's changed custom CSS isn't approved yet. - default_profile: your default design profile can't be archived. - profile_not_published: the design profile has nothing published yet, so sessions and links can't use it and it can't be your default. - profile_archived: the design profile is archived, so new sessions and links can't use it and it can't be your default. - display_name_required: the draft to publish has no display_name. - low_contrast: white text on colors.accent, or colors.text on colors.background, is under 4.5:1. - number_in_use: the next number is one the series has already used. - tax_rate_required: a subscription sent with your own tax figures has a tax_breakdown entry without a percentage_decimal or a flat_amount, so it can't be applied to renewals. - seller_engine_conflict: the request names an external engine for a sale that can resolve to Pay.com as seller. - engine_not_allowed_for_seller: the engine can't run a subscription this seller sells. - processor_not_allowed_for_seller: Pay.com sells only on accounts it controls, and the processor isn't one of them. - engine_capability_missing: the engine or its connection can't do what the request needs. - connection_not_ready: the engine's connection isn't connected, or needs action. - product_refused: a product failed review for merchant of record, and you can't sell it yourself in this request. Subscription and seller refusals come at creation, never at renewal.
Was this page helpful?