Introduction
The LianaCommerce REST API lets your applications manage a shop's products, variations, categories, prices, discounts and stock, read and update orders, and manage customer accounts and companies. Requests and responses are JSON.
API URL
Each shop serves its own API. The API URL is the shop's address followed by /api/v1:
| Shop address | API URL |
|---|---|
https://shop.example.com | https://shop.example.com/api/v1 |
https://example.com/store/ | https://example.com/store/api/v1 |
Send requests to {API URL}/{endpoint}, for example https://shop.example.com/api/v1/products. If
the shop runs under a path, such as /store/, include it: a request without it is redirected, and
many HTTP clients turn a redirected POST or PUT into a GET.
Requests and responses
The API uses GET to read, POST to create, PUT to update and DELETE to delete.
POSTandPUTtake a JSON body withContent-Type: application/json. An empty body returns400.PUTis a partial update: it changes only the fields you send.- The API ignores fields and query parameters it doesn't know, so check the spelling of names.
- A method that an endpoint doesn't support returns
403with the messagemethod not allowed. GETfilters go in the query string. A filter with[]in its name takes a list, for example?codes[]=A100&codes[]=A200.
Every response, also for a single item, has the same shape: the request URL in href, the
results in items and the response time in meta. Each item has its position in the response in
result_index. Lists also have links to the first, prev and next page.
Response
POSTreturns200with the created item, andDELETEreturns200with the deleted item.- Lists are paged with
limit(default 20) andoffset(default 0). There is no page size cap, but large pages are slower. To read a whole list, follownextuntil itshrefisnull.limitandoffsetmust be whole numbers; any other value returns400. - Texts in several languages are lists of
languageand text pairs, asnamesabove. When you send them, languages that the shop doesn't use are ignored. - Times in responses are in the shop's time zone, such as
2026-11-22T07:35:27+02:00. Times you send are read as the shop's local time, and a time zone offset in them is ignored.
An error returns an HTTP error status, with the status repeated in the body:
Response
| Status | Meaning |
|---|---|
400 | A parameter or a field is missing or invalid. message names it. |
401 | The credentials are missing or invalid. See Authorization. |
403 | The token's scope doesn't cover the method, or the endpoint doesn't support the method. |
404 | The item doesn't exist or has been deleted. Bulk updates return 404 when no element matched anything. |
The message is meant for people and may change, so don't parse it.
Make your first request
The ping endpoint returns success: true when your credentials work. Use
it to check the credentials and the shop's API URL.
-
Get a Bearer token
Create a client ID and secret in LianaAccount, and request a token with them. The examples request the scope
commerce-api, which is optional. The token is valid for 15 minutes. To use a shop API key instead, send it in theX-Auth-Tokenheader; see Authorization.Shops accept Bearer tokens from the January 2027 update. Until then, use an API key.
-
Send the request
-
Check the response
ResponseA failed request returns an HTTP error status. See Requests and responses.
Next steps
Start with the basics:
- Authorization: Bearer tokens, API keys and their errors.
- Changes: what changed for existing integrations.
Then browse the endpoints:
Products and their descriptions, images, attachments, tags, properties and stock.
VariationsSizes, colors and other variations of a product, with their own stock and images.
StocksUpdate the stock of many products and variations in one request.
PricesUpdate the prices of many products and variations in one request.
OrdersRead orders and their rows, and change their status.
AccountsCustomer accounts and their roles and companies.