Price Lists
Price lists determine the SKU prices and their currency within a market. Create more price lists if you need to manage international business models or B2B/B2C.
Price lists determine the SKU prices and their currency within a market. Create more price lists if you need to manage international business models or B2B/B2C.
{"foo":"bar"}
POST
request to the /api/price_lists
endpoint, passing the resource arguments in the request body.
The following table contains the list of all the possible arguments, along with their type, description and examples values.
All the arguments marked as required must be present in the request.
POST /api/price_lists HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "price_lists",
"attributes": {
"name": "EU Price list",
"currency_code": "EUR"
}
}
}
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "1234",
"type": "price_lists",
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234"
},
"attributes": {
"name": "EU Price list",
"currency_code": "EUR",
"tax_included": "true",
"id": "1234",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANYREFEFERNCE",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"prices": {
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234/relationships/prices",
"related": "https://your-brand.commercelayer.io/api/price_lists/1234/prices"
}
}
},
"meta": {
"mode": "test"
}
}
}
To fetch a collection of price lists, send a GET
request to the /api/price_lists
endpoint.
GET /api/price_lists HTTP/1.1
Accept: application/vnd.api+json
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "1234",
"type": "price_lists",
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234"
},
"attributes": {
"name": "EU Price list",
"currency_code": "EUR",
"tax_included": "true",
"id": "1234",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANYREFEFERNCE",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"prices": {
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234/relationships/prices",
"related": "https://your-brand.commercelayer.io/api/price_lists/1234/prices"
}
}
},
"meta": {
"mode": "test"
}
},
{
"other": "... 24 price_lists (first page)"
}
],
"meta": {
"record_count": 125,
"page_count": 5
},
"links": {
"first": "/api/price_lists?page[number]=1&page[size]=25",
"prev": "/api/price_lists?page[number]=2&page[size]=25",
"next": "/api/price_lists?page[number]=4&page[size]=25",
"last": "/api/price_lists?page[number]=5&page[size]=25"
}
}
GET
request to the /api/price_lists/{{id}}
endpoint, where {{id}}
is the id of the resource that you want to retrieve.
GET /api/price_lists/1234 HTTP/1.1
Accept: application/vnd.api+json
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "1234",
"type": "price_lists",
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234"
},
"attributes": {
"name": "EU Price list",
"currency_code": "EUR",
"tax_included": "true",
"id": "1234",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANYREFEFERNCE",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"prices": {
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234/relationships/prices",
"related": "https://your-brand.commercelayer.io/api/price_lists/1234/prices"
}
}
},
"meta": {
"mode": "test"
}
}
}
PATCH
request to the /api/price_lists/{{id}}
endpoint, where {{id}}
is the id of the resource that you want to update.
The following table contains the list of all the possible arguments that you can pass with the request body, along with their type, description and examples values.
Please note that all arguments are optional.
PATCH /api/price_lists/1234 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "price_lists",
"id": 1234,
"attributes": {
"name": "EU Price list"
},
"relationships": {
}
}
}
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "1234",
"type": "price_lists",
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234"
},
"attributes": {
"name": "EU Price list",
"currency_code": "EUR",
"tax_included": "true",
"id": "1234",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANYREFEFERNCE",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"prices": {
"links": {
"self": "https://your-brand.commercelayer.io/api/price_lists/1234/relationships/prices",
"related": "https://your-brand.commercelayer.io/api/price_lists/1234/prices"
}
}
},
"meta": {
"mode": "test"
}
}
}
DELETE
request to the /api/price_lists/{{id}}
endpoint, where {{id}}
is the id of the resource that you want to delete.
DELETE /api/price_lists/1234 HTTP/1.1
Accept: application/vnd.api+json
HTTP/1.1 204 No Content
Get our machine-readable JSON schema that follows the OpenAPI Specification (formerly Swagger).
Get our Postman collection in one click and start making real calls to Commerce Layer API in minutes.
Get in touch with our support team if you have any questions or want to learn more about Commerce Layer.