Create a price list

How to create a price list via API

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

Request

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

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.name

string

Required

attributes.code

string

Optional

attributes.currency_code

string

Required

attributes.tax_included

boolean

Optional, default is 'true'

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.rules

object

Optional

attributes.metadata

object

Optional

Example

The following request creates a new price list:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/price_lists' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "price_lists",
    "attributes": {
      "name": "EU Price list",
      "currency_code": "EUR"
    }
  }
}'

Last updated