Search Documentation
Search for a documentation page...
Orders API
REST API endpoints for browsing and managing orders.
Order visibility. A request made for a person – through an OAuth app or the AI Assistant – only reaches the orders that person's role may see: orders outside it are missing from lists and answer
404on every/orders/:idendpoint. API keys see every order.
List Orders
Returns a paginated list of orders, sorted by creation date (newest first).
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 10 | Orders per page (1-100) |
offset | number | 0 | Orders to skip |
workstation | string | – | Only orders queued at this workstation (id), or unassigned for orders at none |
customStatus | string | – | Only orders in this custom status (its key); a group includes its sub-statuses. An unknown key is a 400. |
bin | string | – | archive lists only archived orders, trash only trashed ones. Without it, every order except trashed ones is listed, archived ones included. |
Response
Each order also carries:
customStatus– the store's own workflow status on top ofstatus:{ key, name, color, isDefault }.nameisnullfor a default the merchant hasn't renamed (show the order status's own name then). See List Order Statuses.archivedAt/trashedAt– when the order was put in the Archive or Trash bin,nullotherwise.
Get Order
Returns the full order with line items, customer info, shipping address, and payment details. With the orders:read scope it also carries customStatus, archivedAt and trashedAt, like the list; an archived or trashed order is still returned here. Storefront callers (order:lookup) never get these fields: custom status names are for the merchant's team only.
The orderData snapshot is a copy of the cart, so each lineItems[].productVariant in it arrives with the merchant-private fields blanked — cost, digital, externalId, supplierAliases, reservedQuantity and unavailableQuantity. This endpoint also reads orders that are not paid yet (bank transfer, cash on delivery), so a paid download's files are never in the response; the buyer receives them as encrypted links once the payment is recorded. See Merchant-private fields.
Response
Cash on delivery
An order placed with cash on delivery (paymentProvider: "cashOnDelivery") is created unpaid: the courier collects the money and the merchant marks it paid afterwards. While the payment is still outstanding, paymentInstructions carries the merchant's note for the shopper, so a storefront can repeat it on its own order page:
It turns null once the payment is recorded (orderData.paymentCollectedAt is set), when the merchant has left no instructions, and on every order paid by any other provider.
Language
locale is the language version of the store the order was placed on (en-US, pl-PL, …), copied from the cart at checkout. Every email about the order renders in it. null for orders placed before the storefront reported a language, imports and orders created in the admin — those fall back to the store's default storefront language.
Prices and tax
Every money field in an order's orderData snapshot is net, exactly like the live catalog's. Gross twins are returned alongside them, so a storefront prints a past order the same way it prints a cart:
| Net field | Gross twin |
|---|---|
orderData.lineItems[].productVariant.price | …productVariant.priceGross |
orderData.shipping.price | orderData.shipping.priceGross |
The line variants carry the full set of twins described in Prices and tax (originalPriceGross, calculatedPriceGross, and so on). They are computed from the tax rate frozen into the snapshot — each line from its own product's rate, delivery from the shipping method's — never from the product's current rate, which may have changed since. shipping.priceGross is the listed delivery charge; whether the order actually earned free delivery is already settled in the order's totals.
Both GET /api/v1/orders and GET /api/v1/orders/:id return them.
Update Order
Updates an order's fulfillment status and/or tracking information, or corrects the contact email the order was placed with.
Request Body
| Field | Type | Description |
|---|---|---|
status | string | processing, shipped, delivered, or canceled |
trackingNumber | string | Shipping carrier tracking number. Only for orders fulfilled outside the platform – orders whose shipping method links a carrier addon (gls, inpost, dpd, fedex) are rejected with 409. Use the Shipment API for carrier-managed orders. |
email | string | Contact email for this order – where its notifications (shipped, delivered) are sent. Allowed at any status. |
workstationId | string | null | Queue the order at a workstation, or null for unassigned. Counts as a manual choice, so the assignment rules never move it afterwards. Growth plan; 404 for an unknown workstation, 409 for one that takes no orders. |
customStatus | string | Move the order to a custom status (its key). A status linked to an order status changes status too, with the same emails and events; an unlinked one only relabels the order. Can't be sent with status (400). 404 for an unknown key; 409 when the order status can't move there (a reservation, a refunded order, or a cancelled one whose stock went back). |
archived | boolean | true archives the order (it leaves the admin's default list), false takes it out of the archive. |
trashed | boolean | true moves the order to Trash: it leaves order lists, counts, analytics, exports and customer stats, but can still be read by id. false restores it. Nothing is ever deleted. |
The response echoes the order's email alongside id, status, trackingNumber, shipment, billingAddress and shippingAddress. When customStatus, archived or trashed is sent, it adds customStatus, archivedAt and trashedAt.
Contact Email
email corrects this order only. The customer record and any shopper account keep their own address, so a typo caught after checkout can be fixed without touching the customer's profile.
Two cases are rejected with 409:
- The order has no customer attached – there is nothing to email, so correct its addresses instead.
- A KSeF e-invoice has already been filed for the order – the filed invoice is the record of the buyer.
Customer Notifications
Only two statuses email the buyer, and a real transition into one of them sends the same email the admin dashboard triggers:
status | Customer email |
|---|---|
shipped | order_shipped |
delivered | order_delivered |
processing | None |
canceled | None |
processing and canceled still record the status change and fire the store events, but they notify nobody – there is no customer template for them. The shipped and delivered emails only go out when the store has that email event enabled at /manage/emails, and they carry the order's tracking number and link when one is known, whether it came with this request or was stored earlier. Retrying the same status update does not re-send the notification.
Order Statuses
| API Status | Internal Status | Description |
|---|---|---|
processing | processing | Being prepared |
shipped | shipped | In transit |
delivered | completed | Delivered to customer |
canceled | cancelled | Cancelled |
List Order Statuses
The store's custom order statuses: the merchant's own two-level workflow (groups such as Verification, Picking or At courier, each with optional sub-statuses) on top of every order's status. Requires the orders:read scope. Statuses are managed in the admin under Settings → Order statuses.
- Every order status has a default custom status. Its
keyis the order status itself (paid,shipped, …),defaultFornames it, andidisnulluntil the merchant edits it. - A status with an
effectiveLinkchanges the order'sstatusto it when an order is moved there. A sub-status without its ownlinkedStatususes its group's. nameisnullfor a default that keeps the order status's own name.- When an order's status changes some other way (a payment, a carrier, a refund), a linked custom status that no longer matches falls back to the new status's default.
Create Shipment
Creates a carrier shipment for the order. The carrier is resolved from the order's shipping method (its linked shipping addon) – you don't specify the carrier in the request. The store's environment (live/test) determines whether the carrier's sandbox or production API is used.
Request Body
All fields are optional. The request body can be empty – every field has a server-side default or returns a 422 explaining what's missing.
InPost Fields
An InPost order ships to a Paczkomat locker, unless its shipping method has the courier type: then it ships by InPost courier to the buyer's shipping address. Locker fields on a courier order (and parcel on a locker order) return 400.
| Field | Type | Description |
|---|---|---|
template | string | Locker orders: locker size small, medium, or large (maps to gabaryt A/B/C). Omit to use dimension-based suggestion, then the store's fallbackTemplate. Fails with 422 if neither is available. |
targetPoint | string | Locker orders: InPost locker code (e.g. KRA012). Defaults to the buyer's checkout selection. |
parcel | object | Courier orders: { lengthCm, widthCm, heightCm, weightKg }, the packed parcel's size in cm (up to 350 × 240 × 240) and weight in kg (0.01–50). Omit to use the product variants' dimensions and weights; fails with 422 when any are missing. |
sendingMethod | string | How the parcel is handed to InPost. Locker orders: parcel_locker (drop-off at a locker, default) or dispatch_order (courier pickup). Courier orders: dispatch_order (default) or pop (drop-off at a PaczkoPunkt). |
GLS Fields
| Field | Type | Description |
|---|---|---|
weightKg | number | Parcel weight in kg (0.01–50). Defaults to the sum of the order's shippable variant weights. |
date | string | Pickup/drop date (YYYY-MM-DD). Defaults to the next working day. |
pointId | string | GLS parcel-shop id (e.g. GLS_PL-12345). Defaults to the buyer's checkout selection; required for parcel-shop rates. |
FedEx Fields
FedEx ships by courier to addresses in Poland, with the FedEx service of the order's delivery method. The label is ready at once; 422 names what FedEx can't take (an address abroad, a missing phone number, an address line over 35 characters).
| Field | Type | Description |
|---|---|---|
weightKg | number | Parcel weight in kg (0.01–68). Defaults to the sum of the order's shippable variant weights (1 kg when none has a weight). |
sizeCm | object | Optional { lengthCm, widthCm, heightCm }. |
pickupAddressId | string | The store pickup address the parcel leaves from (Pickup Locations). Defaults to the FedEx addon's defaultPickupAddressId. |
handover | string | courier (default: FedEx collects the parcel on your regular pickup) or dropoff (you take it to a FedEx location). |
Cash on delivery (GLS and DPD)
GLS and DPD shipments accept these fields to collect cash from the buyer. Amounts are in PLN minor units.
| Field | Type | Description |
|---|---|---|
cod | boolean | Omit to collect the order total when the order is an unpaid cash-on-delivery order. false ships without COD. true fails with 422 when the order has no cash to collect. |
codAmount | integer | Amount to collect in minor units. Defaults to the order total and cannot exceed it. For DPD, cod: false cannot be combined with codAmount (400). |
DPD collects cash by courier and at DPD Pickup points that take COD, never at lockers. When the cash cannot be collected, nothing is sent to the carrier and the response is 422 with code: "cod_refused", a reason and a hint describing what to change (for example, pass the pointId of a Pickup point that takes COD, or record the payment first).
Passing fields that belong to the other carrier returns 400 – e.g. sending weightKg for an InPost order is rejected.
Response (201)
InPost:
An InPost courier shipment answers "delivery": "courier" with parcel and parcelSource (explicit or suggested) instead of template and templateSource.
GLS:
Error Responses
| Status | Description |
|---|---|
400 | Invalid request data, carrier-mismatched fields, locker fields on an InPost courier order (or the reverse), or a sending method that delivery kind doesn't offer |
404 | Order not found |
409 | Order already has a shipment, or shipping method has no supported carrier |
422 | Missing required carrier data (e.g. no locker code or template for an InPost locker order, no parcel size and weight or no street address for an InPost courier order) |
502 | Carrier API error |
Get Shipment
Returns the current shipment status for an order.
Response (200)
InPost:
GLS:
Error Responses
| Status | Description |
|---|---|
404 | Order not found or order has no shipment |
409 | Shipping method has no supported carrier |
502 | Carrier API error (InPost only – GLS uses locally persisted state) |
Delete Shipment
Deletes the shipment for an order. Supported for GLS (while the consignment is in the preparing box) and FedEx (cancelled at FedEx until it has the parcel; the order can then get a new label). InPost shipments must be cancelled in the InPost Parcel Manager.
Response (200)
Error Responses
| Status | Description |
|---|---|
404 | Order not found or order has no shipment |
409 | InPost shipments cannot be deleted through this API, or the GLS shipment is no longer deletable |
502 | GLS or FedEx API error, e.g. FedEx no longer cancels a parcel it already has |
Get Shipment Label
Downloads the shipping label as a file. Returns the raw file (PDF, ZPL, or EPL) with appropriate Content-Type and Content-Disposition headers.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | pdf | InPost only: pdf, zpl, or epl. GLS uses the store-wide labelMode setting (change via PUT /api/v1/addons/gls). A FedEx label is the file stored when the shipment was made, in the labelFormat of that moment. Passing format for a GLS or FedEx order returns 400. |
Error Responses
| Status | Description |
|---|---|
400 | Invalid query parameters, or format used with GLS |
404 | Order not found or order has no shipment |
409 | InPost label not ready yet (poll GET .../shipment until labelReady is true), or shipping method has no supported carrier |
502 | Carrier API error |
Customer Orders
Returns orders for a specific customer, paginated.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Orders per page (1-100) |
offset | number | 0 | Orders to skip |
Response
Get Order History
Everything that happened to one order, newest first: status changes with the previous status, edits with each field's old and new value, packing scans and workstation assignments, payments, refunds and chargebacks, comments and issues. Requires the orders:read scope.
Every entry names who did it in actor:
actor.kind | Who |
|---|---|
user | A team member; name is their current name |
customer | The shopper (placing or paying for the order) |
rule | A store rule, such as a workstation rule |
integration | An outside system, named by source: baselinker, allegro, stripe, paypal, inpost, api, … |
system | Your Next Store itself |
assistant | The AI Assistant |
actor.viaSupport is true when Your Next Store support did it while signed in as a team member.
kind is event for history entries, comment for team comments and issue for problems such as a label that failed. Address and email values in changes are replaced with a placeholder when the API key's member has no access to customer details.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
category | string | All | Only one history: status, shipping, change, pick_pack, payment, document or other |
limit | number | 50 | Entries per page (1-200) |
before | string | None | Only entries older than this time. Pass the previous page's meta.nextBefore |
Response
An edit lists its changes, one per field:
List Refunds
Returns the refunds recorded against an order, newest first.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Refunds per page (1-100) |
offset | number | 0 | Refunds to skip |
Response
Create Refund
Issues a refund against the order's original payment. The order's own payment provider decides how it is processed: PayNow orders refund through PayNow, everything else through Stripe. Providers this API cannot refund on your behalf are refused with a 400 – see Payment Providers below.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Refund amount in cents (smallest currency unit) |
reason | string | Yes | One of requested_by_customer, damaged_or_defective, duplicate, fraudulent, order_error, other |
reasonNote | string | No | Additional detail about the reason |
refundType | string | Yes | full or partial |
refundApplicationFee | boolean | No | Refund the Stripe application fee. Defaults to false. |
restockItems | boolean | No | Return refunded items to stock. Defaults to true. |
lineItems | array | No | Per-item breakdown for partial refunds with item tracking |
shippingAmount | number | No | Portion of amount that refunds shipping, in cents. Must not exceed amount. |
Each lineItems entry takes lineItemIndex (position in the order), productVariantId, quantity, and amount in cents.
Restocking is bounded by the order itself. A line is restocked up to the quantity the order contains for that variant – asking for more restocks only the ordered quantity – and a line naming a variant the order does not contain is ignored. Ignored lines do not fail the request: the refund is already recorded and the money has moved.
Payment Providers
| Provider | Behaviour |
|---|---|
| Stripe | Refunded through Stripe against the original charge |
| PayNow | Refunded through PayNow; the refund row stays pending until PayNow's settlement webhook lands |
| Frame | 400 – refund it in the Frame dashboard, then set the order status to Refunded |
| Bank transfer | 400 – refund it manually from your bank |
| Cash on delivery | 400 – refund the customer yourself, then set the order status to Refunded |
Errors
| Status | Meaning |
|---|---|
400 | Order status can't be refunded, the payment provider can't be refunded through this API, no Stripe payment found, the amount exceeds what's still refundable, or shippingAmount exceeds amount |
404 | Order not found |
Only orders with status paid, processing, shipped, completed, or partially_refunded can be refunded.
Remaining headroom counts committed refunds – both succeeded and pending rows. A refund still awaiting its provider's settlement webhook already consumes headroom, so amount plus every committed refund on the order may not exceed the order total.
Get Refund
Returns a single refund belonging to the order.