LianaCommerce REST API

Properties

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

Product and variation properties, such as roast level or origin, and their options. Every /properties endpoint needs the ProductProperties plugin; without it they return 403.


List properties

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

Returns the product and variation properties, newest first, without deleted ones. List items leave out category_id, user_helps, position, the timestamps and options: get a property for those. Needs the ProductProperties plugin: without it every /properties endpoint returns 403.

List properties › query Parameters

codes[]
​string[] · style: form · explode: true

Returns properties whose code is one of these codes. The match is exact but ignores case. Repeat the parameter for each code (codes[]=roast&codes[]=origin); codes=roast also works for a single code.

types[]
​PropertyType[] · style: form · explode: true

Returns properties whose type is one of these types. Repeat the parameter for each type (types[]=choice&types[]=text); types=choice also works for a single type.

Enum values:
boolean
choice
option_group
date
datetime
wysiwyg
link
numeric
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 properties › Responses

A page of properties.

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 property

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

Creates a property in a category. Needs the ProductProperties plugin.

  • type, category_id, multichoice, property_of_product and property_of_variation can only be set here; PUT ignores them.
  • Sending property_of_product: false needs property_of_variation: true, else 400.
  • multichoice: true with type: boolean returns 400.
  • A boolean property gets its two options (yes and no) automatically. Its options, and those of an option_group property, can't be changed through the API.

Create a property › Request Body

​PropertyName[] · minItems: 1 · required

The property's name per language. Each element needs a non-empty name.

type
​PropertyType · enum · required

The property's value type. boolean, option_group, numeric, date and datetime values are not localized; the others are.

Enum values:
boolean
choice
option_group
date
datetime
wysiwyg
link
numeric
Example: choice
category_id
​integer · required

The category to create the property in. It must exist and not be deleted.

Example: 14
code
​string

Your own code for the property.

Example: roast
Default:
property_of_product
​boolean

Whether products can have the property. If you send neither this nor property_of_variation, the property is for products.

Example: true
property_of_variation
​boolean

Whether variations can have the property.

Example: false
multichoice
​boolean

Whether a product or variation can have more than one option. Can't be true for boolean.

Example: false
Default: false
public
​boolean
Example: true
Default: false
filter
​boolean
Example: true
Default: false
default_property
​boolean
Example: false
Default: false
position
​integer

The sort position. If you leave it out, the property gets the next free number.

Example: 12
​PropertyUserHelp[]

Help texts for the shop's admin users per language.

Create a property › Responses

The created property.

href
​string

The URL of the request.

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

The property, as the only element.

​Meta

Get a property

GET
https://shop.example.com/api/v1
/properties/{property-id}

Returns one property with its options. Needs the ProductProperties plugin.

Get a property › path Parameters

property-id
​integer · required

The property's id.

Get a property › Responses

The property.

href
​string

The URL of the request.

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

The property, as the only element.

​Meta

Update a property

PUT
https://shop.example.com/api/v1
/properties/{property-id}

Updates the fields you send and keeps the others. In names and user_helps, languages you leave out keep their stored values. type, category_id, multichoice, property_of_product and property_of_variation can't be changed. Needs the ProductProperties plugin.

Update a property › path Parameters

property-id
​integer · required

The property's id.

Update a property › Request Body

`type`, `category_id`, `multichoice`, `property_of_product` and `property_of_variation` can't be changed and are ignored.

Names to add or change, one element per language. Languages you leave out keep their stored values. A language the property has no name for yet needs a non-empty name.

code
​string
public
​boolean
filter
​boolean
default_property
​boolean
position
​integer
​PropertyUserHelp[]

Help texts to add or change, one element per language.

Update a property › Responses

The updated property.

href
​string

The URL of the request.

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

The property, as the only element.

​Meta

Delete a property

DELETE
https://shop.example.com/api/v1
/properties/{property-id}

Deletes the property permanently, with its options and the values products and variations have for it. The response shows the property as it was. Needs the ProductProperties plugin.

Delete a property › path Parameters

property-id
​integer · required

The property's id.

Delete a property › Responses

The deleted property.

href
​string

The URL of the request.

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

The property, as the only element.

​Meta

List property options

GET
https://shop.example.com/api/v1
/properties/{property-id}/options

Returns the property's options, newest first. Needs the ProductProperties plugin.

List property options › path Parameters

property-id
​integer · required

The property's id.

List property options › 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 property options › Responses

A page of options.

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 property option

POST
https://shop.example.com/api/v1
/properties/{property-id}/options

Adds an option to a property. The body depends on the property's type:

  • text, short_text, link, wysiwyg, choice, date, datetime: values, an array of {language, value}. Languages you leave out get an empty value.
  • range: values as {min_value, max_value}.
  • numeric: value, an integer.

Options of boolean and option_group properties can't be changed: POST, PUT and DELETE return 403. Adding an option also updates the property's modified_at. Needs the ProductProperties plugin.

Create a property option › path Parameters

property-id
​integer · required

The property's id.

Create a property option › Request Body

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: values
type = object · requires: values
type = object · requires: value
Properties for Localized values:
For `text`, `short_text`, `link`, `wysiwyg`, `choice`, `date` and `datetime` properties. A `date` value is `YYYY-MM-DD`; a `datetime` value is an ISO 8601 date and time, converted to the shop's time zone.
​object[] · required

The option's value per language. Each language must be one the shop uses, else 400. Languages you leave out get an empty value, also on PUT.

Create a property option › Responses

The created option.

href
​string

The URL of the request.

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

The option, as the only element.

​Meta

Get a property option

GET
https://shop.example.com/api/v1
/properties/{property-id}/options/{option-id}

Returns one option of the property. Needs the ProductProperties plugin.

Get a property option › path Parameters

property-id
​integer · required

The property's id.

option-id
​integer · required

The option's id. An unknown option, or an option of another property, returns 404.

Get a property option › Responses

The option.

href
​string

The URL of the request.

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

The option, as the only element.

​Meta

Update a property option

PUT
https://shop.example.com/api/v1
/properties/{property-id}/options/{option-id}

Replaces the option's value. The body has the same shape as in Create a property option. Send every language: languages you leave out from values become empty. Options of boolean and option_group properties can't be changed (403). Needs the ProductProperties plugin.

Update a property option › path Parameters

property-id
​integer · required

The property's id.

option-id
​integer · required

The option's id. An unknown option, or an option of another property, returns 404.

Update a property option › Request Body

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: values
type = object · requires: values
type = object · requires: value
Properties for Localized values:
For `text`, `short_text`, `link`, `wysiwyg`, `choice`, `date` and `datetime` properties. A `date` value is `YYYY-MM-DD`; a `datetime` value is an ISO 8601 date and time, converted to the shop's time zone.
​object[] · required

The option's value per language. Each language must be one the shop uses, else 400. Languages you leave out get an empty value, also on PUT.

Update a property option › Responses

The updated option.

href
​string

The URL of the request.

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

The option, as the only element.

​Meta

Delete a property option

DELETE
https://shop.example.com/api/v1
/properties/{property-id}/options/{option-id}

Deletes the option permanently, with the values products and variations have for it. The response shows the option as it was. Options of boolean and option_group properties can't be deleted (403). Needs the ProductProperties plugin.

Delete a property option › path Parameters

property-id
​integer · required

The property's id.

option-id
​integer · required

The option's id. An unknown option, or an option of another property, returns 404.

Delete a property option › Responses

The deleted option.

href
​string

The URL of the request.

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

The option, as the only element.

​Meta