Create a SKU list

How to create a SKU list via API

To create a new SKU list, send a POST request to the /api/sku_lists endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/sku_lists

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.name

string

Required

attributes.description

string

Optional

attributes.image_url

string

Optional

attributes.manual

boolean

Optional, default is 'true'

attributes.sku_code_regex

string

Required, if manual is falsy

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.customer

object

Optional

Example

The following request creates a new SKU list:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/sku_lists' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "sku_lists",
    "attributes": {
      "name": "Personal list",
      "sku_code_regex": "^(A|B).*$"
    }
  }
}'

Last updated