Create a Price Book
POST/pcm/pricebooks
Creates a price book. You can add the prices to the price book now or update the price book later.
Request
- application/json
Body
required
Creates a price book with the following attributes.
data objectrequired
Possible values: [pricebook
]
Default value: pricebook
attributes objectrequired
A brief description that describes the purpose of a price book, for example, flash sale pricing or preferred customer pricing.
Possible values: non-empty
The name of the price book. Price books must have a unique name.
A unique attribute that you can use to contain information from another company system, for example. The maximum length is 2048 characters.
Responses
- 201
- default
A price book with the following attributes.
- application/json
- Schema
- Example (from schema)
Schema
data objectrequired
A price book with the following attributes.
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.
{
"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"
}
}
Unexpected error.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"detail": "The price book already exists",
"status": "409",
"title": "conflict"
}
]
}