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
Responses
- 200
- default
An updated price book with the following attributes.
Unexpected error.
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