Replicate a Price Book
POST/pcm/pricebooks/:pricebookID/replicate
Using this endpoint, you can replicate an existing price book. This is useful because it enables you to quickly and easily create multiple price books with the same pricing structure. When you replicate an existing price book, you can specify a new name, description, and external reference for the replicated price book. Other attributes stay the same.
Request
Path Parameters
The unique identifier of a price book.
- application/json
Body
A replicated price book with the following attributes.
data objectrequired
Price book replicate request.
Possible values: [pricebook
]
Default value: pricebook
attributes objectrequired
A brief description outlining the purpose of a price book, such as 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 could use to contain information from another company system, for example. The maximum length is 2048 characters.
Responses
- 201
- default
A replicated 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"
}
]
}