Replicate a Price Book
POSThttps://euwest.api.elasticpath.com/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
pricebookID stringrequired
The unique identifier of a price book.
- application/json
Body
A replicated price book with the following attributes.
data objectrequired
Responses
- 201
- default
A replicated price book with the following attributes.
- application/json
- Schema
- Example (from schema)
Schema
data objectrequired
links object
{
"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
errors object[]
{
"errors": [
{
"detail": "The price book already exists",
"status": "409",
"title": "conflict"
}
]
}
Authorization: Authorization
name: Authorizationtype: httpin: headerscheme: bearer
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://euwest.api.elasticpath.com/pcm/pricebooks/:pricebookID/replicate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": {
"type": "pricebook",
"attributes": {
"description": "This is a test price book",
"name": "pricebook-store-abc",
"external_ref": "external-ref"
}
}
}'
ResponseClear