LianaCommerce REST API

Orders

Serverhttps://shop.example.com/api/v1

Read the shop's orders and change their tracking code and status. An order includes its rows, payer, recipient, delivery and payment methods, and status history.


List orders

GET
https://shop.example.com/api/v1
/orders

Returns the shop's orders, newest first, with their rows, payer, recipient and status comments. Deleted orders are left out; orders in every status are listed unless you filter by status. Filters combine: an order must match all of them. The paging links carry the filters.

To read new and changed orders, filter by modified_after and sort with order_by_field=modified and order_by_direction=ASC. Changing the status with Set the status of an order also changes modified_at.

List orders › query Parameters

limit
​integer · min: 1 · max: 2147483647

The number of items to return. Must be a decimal integer; any other value returns 400. There is no page size cap, but large pages take longer: follow the next link to read a long list.

Default: 20
offset
​integer · min: 0 · max: 2147483647

The number of items to skip. Must be a decimal integer; any other value returns 400.

Default: 0
status
​integer

Returns the orders whose current status has this id, see status in the response. Sub-statuses are not included.

number
​integer

Returns the order with this order number.

account_id
​integer

Returns the orders placed by the customer account with this id.

created_after
​string

Returns the orders created at or after this time. Use ISO 8601, such as 2026-11-01 or 2026-11-01T08:00:00+02:00; encode + as %2B in the URL. A time without an offset is read as the shop's local time.

modified_after
​string

Returns the orders modified at or after this time. The format is the same as in created_after. Use it with order_by_field=modified to read changed orders in order.

is_paid
​boolean

true returns the orders that have a payment time, false the ones that don't. Also accepts 1, 0, yes, no, on and off.

product_ids
​string · pattern: ^[0-9]+(,[0-9]+)*$

A comma-separated list of product ids. Returns the orders that have a row with any of these products. Every item must be a non-negative integer, otherwise the response is 400.

order_by_field
​string

modified sorts the orders by modification time, then by id. Any other value sorts by id, which is the default.

order_by_direction
​string · enum

The sort direction, ASC or DESC (case-insensitive). Any other value is ignored.

Enum values:
ASC
DESC
Default: DESC

List orders › Responses

The orders.

Links to the first, previous and next page. Each link carries the request's `limit`, `offset` and filters. At either end of the list the object is still there, with `href` set to `null`.
href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​PageLink
​PageLink
​PageLink
​object[]
​Meta

Get an order

GET
https://shop.example.com/api/v1
/orders/{order-id}

Returns one order with its rows, payer, recipient and status comments. Unlike in the list, the item has no href, and the response has no paging links.

Get an order › path Parameters

order-id
​integer · required

The order's id (not its order number). An id that is not a decimal integer returns 400; an unknown or deleted id returns 404.

Get an order › Responses

The order.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​object[]
​Meta

Update an order

PUT
https://shop.example.com/api/v1
/orders/{order-id}

Sets the order's delivery tracking code; it is the only field you can change. The order's modified_at is set to now. The update sends no email to the customer and runs no order-flow actions. Returns the updated order.

Update an order › path Parameters

order-id
​integer · required

The order's id (not its order number). An id that is not a decimal integer returns 400; an unknown or deleted id returns 404.

Update an order › Request Body

tracking_code
​string | null · required

The delivery tracking code. null or an empty string clears it.

Example: JJFI64123450001234567

Update an order › Responses

The updated order.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​object[]
​Meta

List the statuses of an order

GET
https://shop.example.com/api/v1
/orders/{order-id}/statuses

Returns the order's status history, newest first: one item for each status the order has had, with the comment saved with the change.

List the statuses of an order › path Parameters

order-id
​integer · required

The order's id (not its order number). An id that is not a decimal integer returns 400; an unknown or deleted id returns 404.

List the statuses of an order › query Parameters

limit
​integer · min: 1 · max: 2147483647

The number of items to return. Must be a decimal integer; any other value returns 400. There is no page size cap, but large pages take longer: follow the next link to read a long list.

Default: 20
offset
​integer · min: 0 · max: 2147483647

The number of items to skip. Must be a decimal integer; any other value returns 400.

Default: 0

List the statuses of an order › Responses

The order's status history.

Links to the first, previous and next page. Each link carries the request's `limit`, `offset` and filters. At either end of the list the object is still there, with `href` set to `null`.
href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​PageLink
​PageLink
​PageLink
​object[]
​Meta

Set the status of an order

POST
https://shop.example.com/api/v1
/orders/{order-id}/statuses

Sets the order's status and adds the change, with your comment, to its status history. Any status can follow any other. The status is set directly: no email is sent to the customer and no order-flow actions run, so for example cancelling an order this way does not release its stock. The order's modified_at is set to now, so List orders with modified_after finds the change. Returns the new status history entry.

Set the status of an order › path Parameters

order-id
​integer · required

The order's id (not its order number). An id that is not a decimal integer returns 400; an unknown or deleted id returns 404.

Set the status of an order › Request Body

status
​integer · required

The id of the new status. An unknown id returns 400. Find the ids in the status of existing orders or in the shop's admin.

Example: 5
comment
​string · required

A comment saved with the status change. Send an empty string for no comment; null returns 400.

Example: Shipped in two parcels.

Set the status of an order › Responses

The new status history entry.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​object[]
​Meta

List ordered products

GET
https://shop.example.com/api/v1
/orderpromotions

Returns the rows of all orders, one item per ordered row, newest row first. Deleted orders are left out. The list has no filters, and order_by_field and order_by_direction have no effect. To read the rows of one order, use Get an order.

List ordered products › query Parameters

limit
​integer · min: 1 · max: 2147483647

The number of items to return. Must be a decimal integer; any other value returns 400. There is no page size cap, but large pages take longer: follow the next link to read a long list.

Default: 20
offset
​integer · min: 0 · max: 2147483647

The number of items to skip. Must be a decimal integer; any other value returns 400.

Default: 0

List ordered products › Responses

The ordered rows.

Links to the first, previous and next page. Each link carries the request's `limit`, `offset` and filters. At either end of the list the object is still there, with `href` set to `null`.
href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​PageLink
​PageLink
​PageLink
​object[]
​Meta