Get all Price Books
GET/pcm/pricebooks
Retrieves a list of all price books.
Filtering
Filtering is supported on this endpoint. For the general syntax, see Filtering.
You can filter on the following attributes and operators.
Operator | Attribute | Description | Example |
---|---|---|---|
eq | external_ref | Equals. Checks if the values you provide matches a price book. | filter=eq(external_ref,some-external-ref) |
Request
Query Parameters
You can filter on this endpoint. See Filtering.
Possible values: >= 1
The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the page length store setting is used.
Possible values: <= 10000
The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page offset is set, the page length store setting is used.
Responses
- 200
- default
The list of price books.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
meta object
Contains the results for the entire collection.
results object
Total number of results for the entire collection.
page object
The maximum number of records for all pages.
The current offset by number of pages.
The current number of pages.
The total number of records for the entire collection.
data object[]required
A unique identifier of a price book.
Possible values: [pricebook
]
Default value: pricebook
Always pricebook
.
attributes objectrequired
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
A brief description that outlines the purpose of a price book, for example, flash sale pricing or preferred customer pricing.
The name of a price book. Price books must have a unique name
The date and time when the price book was created.
The date and time when the price book was last updated.
meta object
The resource owner, either organization
or store
.
links object
Links are used to allow you to move between requests. Single entities use a self parameter with a link to that specific resource. Sometimes, there aren’t enough entities for a project to fill multiple pages. In this situation, we return some defaults, instead of expecting you to check for these special cases.
Single entities use a self parameter with a link to that specific resource.
Always the first page.
This is null
if there is only one page.
This is null
if there is only one page.
This is null
if there is only one page.
{
"meta": {
"results": {
"total": 1
},
"page": {
"limit": 10,
"offset": 0,
"current": 0,
"total": 1
}
},
"data": [
{
"id": "4c45e4ec-26e0-4043-86e4-c15b9cf985a7",
"type": "pricebook",
"attributes": {
"external_ref": "an-external-ref",
"description": "This is a test price book",
"name": "Standard Price Book",
"created_at": "2020-09-22T09:00:00Z",
"updated_at": "2020-09-22T09:00:00Z"
},
"meta": {
"owner": "store"
}
}
],
"links": {
"self": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7?filter=like(name,*Standard*)",
"first": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7?filter=like(name,*Standard*)&page[offset]=0&page[limit]=25",
"last": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7?filter=like(name,*Standard*)&page[offset]=0&page[limit]=25",
"prev": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7?filter=like(name,*Standard*)&page[offset]=0&page[limit]=25",
"next": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7?filter=like(name,*Standard*)&page[offset]=25&page[limit]=25"
}
}
Unexpected error.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"detail": "The price book already exists",
"status": "409",
"title": "conflict"
}
]
}