LianaCommerce

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 addressAPI URL
https://shop.example.comhttps://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.

  • POST and PUT take a JSON body with Content-Type: application/json. An empty body returns 400.
  • PUT is 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 403 with the message method not allowed.
  • GET filters 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.

JSONResponse
{ "href": "https://shop.example.com/api/v1/countries?limit=2", "next": { "href": "https://shop.example.com/api/v1/countries?offset=2&limit=2" }, "first": { "href": "https://shop.example.com/api/v1/countries?offset=0&limit=2" }, "prev": { "href": null }, "items": [ { "id": 2, "names": [ { "language": "EN", "name": "Sweden" }, { "language": "FI", "name": "Ruotsi" } ], "code": "SE", "href": "https://shop.example.com/api/v1/countries/2", "result_index": 1 }, { "id": 1, "names": [ { "language": "EN", "name": "Finland" }, { "language": "FI", "name": "Suomi" } ], "code": "FI", "href": "https://shop.example.com/api/v1/countries/1", "result_index": 2 } ], "meta": { "response_at": "2026-11-22T07:35:27+02:00" } }
  • POST returns 200 with the created item, and DELETE returns 200 with the deleted item.
  • Lists are paged with limit (default 20) and offset (default 0). There is no page size cap, but large pages are slower. To read a whole list, follow next until its href is null. limit and offset must be whole numbers; any other value returns 400.
  • Texts in several languages are lists of language and text pairs, as names above. 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:

JSONResponse
{ "code": 400, "message": "Missing parameter 'name' from request body", "meta": { "response_at": "2026-11-22T07:35:27+02:00" } }
StatusMeaning
400A parameter or a field is missing or invalid. message names it.
401The credentials are missing or invalid. See Authorization.
403The token's scope doesn't cover the method, or the endpoint doesn't support the method.
404The 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.

  1. 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 the X-Auth-Token header; see Authorization.

    Shops accept Bearer tokens from the January 2027 update. Until then, use an API key.

  2. Send the request

    curl 'https://shop.example.com/api/v1/ping' \ --header 'Authorization: Bearer <token>'
  3. Check the response

    JSONResponse
    { "success": true, "code": 200, "meta": { "response_at": "2026-11-22T07:35:27+02:00" } }

    A failed request returns an HTTP error status. See Requests and responses.

Next steps

Start with the basics:

  1. Authorization: Bearer tokens, API keys and their errors.
  2. Changes: what changed for existing integrations.

Then browse the endpoints:

Last modified on