Update a Price Book by ID
PUThttps://euwest.api.elasticpath.com/pcm/pricebooks/:pricebookID
Updates the specified price book. Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the price book is not updated.
Request
Path Parameters
pricebookID stringrequired
The unique identifier of a price book.
- application/json
Bodyrequired
An updated price book with the following attributes.
data objectrequired
Responses
- 200
- default
An updated price book with the following attributes.
- application/json
- Schema
- Example (auto)
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 (auto)
Schema
errors object[]
{
"errors": [
{
"detail": "The price book already exists",
"status": "409",
"title": "conflict"
}
]
}
Authorization: Authorization
name: Authorizationtype: httpin: headerscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/pcm/pricebooks/:pricebookID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"4c45e4ec-26e0-4043-86e4-c15b9cf985a7\",\n \"type\": \"pricebook\",\n \"attributes\": {\n \"description\": \"This is a price book\",\n \"name\": \"pricebook-store-abc\",\n \"external_ref\": \"external-ref\"\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear