LianaCommerce REST API

Companies

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

Create, read and update the companies that customer accounts can belong to. Companies can't be deleted through the API.


List companies

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

Returns the shop's companies, newest first. Deleted companies are not listed.

List companies › 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 companies › Responses

The companies.

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

Create a company

POST
https://shop.example.com/api/v1
/companies

Creates a company. Fields you omit get their defaults: empty strings and send_order_notify false. Text fields other than name and code accept null and store an empty string.

Create a company › Request Body

name
​string · required

Can't be null.

Example: Kahvila Aamukaste Oy
code
​string · required

Your code for the company. The shop doesn't check that it is unique. Can't be null.

Example: AAMUKASTE
vat_number
​string | null
street
​string | null
street_extra
​string | null
postal_code
​string | null
city
​string | null
county
​string | null
country
​string | null

The country as free text.

Example: Finland
phone_number
​string | null
email
​string | null

A valid email address, or an empty string.

Example: info@aamukaste.example.com
orders_email
​string | null

Where the shop sends order notifications when send_order_notify is true. The address is not validated.

Example: orders@aamukaste.example.com
send_order_notify
​boolean

Send order notifications to orders_email. Can't be null.

Example: true
extra1
​string | null
extra2
​string | null
extra3
​string | null
extra4
​string | null
extra5
​string | null

Create a company › Responses

The created company.

href
​string

The URL of the request.

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

One company.

​Meta

Get a company

GET
https://shop.example.com/api/v1
/companies/{company-id}

Get a company › path Parameters

company-id
​integer · int64 · required

The company's ID. A value that is not a number returns 400; an unknown or deleted company returns 404.

Get a company › Responses

The company.

href
​string

The URL of the request.

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

One company.

​Meta

Update a company

PUT
https://shop.example.com/api/v1
/companies/{company-id}

Updates the fields you send and keeps the others. Text fields other than name and code accept null and store an empty string.

Update a company › path Parameters

company-id
​integer · int64 · required

The company's ID. A value that is not a number returns 400; an unknown or deleted company returns 404.

Update a company › Request Body

name
​string

Can't be null.

Example: Kahvila Aamukaste Oy
code
​string

Your code for the company. The shop doesn't check that it is unique. Can't be null.

Example: AAMUKASTE
vat_number
​string | null
street
​string | null
street_extra
​string | null
postal_code
​string | null
city
​string | null
county
​string | null
country
​string | null

The country as free text.

Example: Finland
phone_number
​string | null
email
​string | null

A valid email address, or an empty string.

Example: info@aamukaste.example.com
orders_email
​string | null

Where the shop sends order notifications when send_order_notify is true. The address is not validated.

Example: orders@aamukaste.example.com
send_order_notify
​boolean

Send order notifications to orders_email. Can't be null.

Example: true
extra1
​string | null
extra2
​string | null
extra3
​string | null
extra4
​string | null
extra5
​string | null

Update a company › Responses

The updated company.

href
​string

The URL of the request.

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

One company.

​Meta