Skip to main content

Update a Price Book by ID

PUT 

https://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.

Bodyrequired

An updated price book with the following attributes.

    data objectrequired

    Updates the specified price book.

    idstringrequired

    The unique identifier of a price book.

    Example: 4c45e4ec-26e0-4043-86e4-c15b9cf985a7
    typestringrequired

    Always pricebook.

    Possible values: [pricebook]

    Default value: pricebook
    Example: pricebook
    attributes objectrequired
    descriptionstringnullable

    A brief description that describes a price book, for example, flash sale pricing or preferred customer pricing.

    Example: This is a price book
    namestringnullable

    The name of a price book. Price books must have a unique name.

    Possible values: non-empty

    Example: pricebook-store-abc
    external_refstringnullable

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Example: external-ref

Responses

An updated price book with the following attributes.

Schema
    data objectrequired

    A price book with the following attributes.

    idstringrequired

    A unique identifier of a price book.

    Example: 4c45e4ec-26e0-4043-86e4-c15b9cf985a7
    typestringrequired

    Always pricebook.

    Possible values: [pricebook]

    Default value: pricebook
    Example: pricebook
    attributes objectrequired
    external_refstringnullable

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Example: an-external-ref
    descriptionstringnullable

    A brief description that outlines the purpose of a price book, for example, flash sale pricing or preferred customer pricing.

    Example: This is a test price book
    namestringnullablerequired

    The name of a price book. Price books must have a unique name

    Example: Standard Price Book
    created_atdate-timerequired

    The date and time when the price book was created.

    Example: 2020-09-22T09:00:00Z
    updated_atdate-timerequired

    The date and time when the price book was last updated.

    Example: 2020-09-22T09:00:00Z
    meta object
    ownerstringnullable

    The resource owner, either organization or store.

    Example: store
    links object

    Links are used to allow you to move between requests.

    selfurinullable

    Single entities use a self parameter with a link to that specific resource.

    Example: /pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7

Authorization: Authorization

name: Authorizationtype: httpin: headerscheme: bearer
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());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Parameters
— pathrequired
Body required
{
  "data": {
    "id": "4c45e4ec-26e0-4043-86e4-c15b9cf985a7",
    "type": "pricebook",
    "attributes": {
      "description": "This is a price book",
      "name": "pricebook-store-abc",
      "external_ref": "external-ref"
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.