Skip to main content

Update a Product Price in a Price Book

PUT 

https://euwest.api.elasticpath.com/pcm/pricebooks/:pricebookID/prices/:priceID

Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the price is not updated.

Request

Responses

An updated product price with the following attributes.

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/prices/:priceID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"product-price\",\n \"pricebook_external_ref\": \"a-pricebook-external-ref\",\n \"attributes\": {\n \"currencies\": {\n \"USD\": {\n \"amount\": 100,\n \"includes_tax\": false,\n \"tiers\": {\n \"min_5\": {\n \"minimum_quantity\": 5,\n \"amount\": 50\n }\n }\n },\n \"CAD\": {\n \"amount\": 127,\n \"includes_tax\": false,\n \"tiers\": {\n \"min_10\": {\n \"minimum_quantity\": 10,\n \"amount\": 100\n }\n }\n },\n \"GBP\": {\n \"amount\": 73,\n \"includes_tax\": true,\n \"tiers\": {\n \"min_20\": {\n \"minimum_quantity\": 20,\n \"amount\": 60\n }\n }\n }\n },\n \"sku\": \"product-sku-a\",\n \"sales\": {\n \"summer\": {\n \"schedule\": {\n \"valid_form\": \"2023-12-24T09:00:00\",\n \"valid_to\": \"2023-12-25T09:00:00\"\n },\n \"currencies\": {\n \"USD\": {\n \"amount\": 90,\n \"includes_tax\": false,\n \"tiers\": {\n \"min_5\": {\n \"minimum_quantity\": 5,\n \"amount\": 40\n }\n }\n },\n \"CAD\": {\n \"amount\": 117,\n \"includes_tax\": false,\n \"tiers\": {\n \"min_10\": {\n \"minimum_quantity\": 10,\n \"amount\": 80\n }\n }\n },\n \"GBP\": {\n \"amount\": 65,\n \"includes_tax\": true,\n \"tiers\": {\n \"min_20\": {\n \"minimum_quantity\": 20,\n \"amount\": 50\n }\n }\n }\n }\n }\n },\n \"external_ref\": \"external-ref\",\n \"created_at\": \"2020-09-22T09:00:00Z\",\n \"updated_at\": \"2020-09-22T09:00:00Z\",\n \"admin_attributes\": {\n \"cost_of_goods\": \"42.0\",\n \"charge_type\": \"credit card\"\n },\n \"shopper_attributes\": {\n \"cost_of_goods\": \"42.0\",\n \"charge_type\": \"credit card\"\n }\n },\n \"id\": \"a915553d-935d-4d56-870b-817b47a44a99\",\n \"meta\": {\n \"owner\": \"store\",\n \"pricebook_id\": \"4c45e4ec-26e0-4043-86e4-c15b9cf985a7\"\n }\n },\n \"links\": {\n \"self\": \"/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7/prices/ad042b07-e86d-476a-82d5-43dda1f80d03\"\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
— pathrequired
Body required
{
  "data": {
    "type": "product-price",
    "pricebook_external_ref": "a-pricebook-external-ref",
    "attributes": {
      "currencies": {
        "USD": {
          "amount": 100,
          "includes_tax": false,
          "tiers": {
            "min_5": {
              "minimum_quantity": 5,
              "amount": 50
            }
          }
        },
        "CAD": {
          "amount": 127,
          "includes_tax": false,
          "tiers": {
            "min_10": {
              "minimum_quantity": 10,
              "amount": 100
            }
          }
        },
        "GBP": {
          "amount": 73,
          "includes_tax": true,
          "tiers": {
            "min_20": {
              "minimum_quantity": 20,
              "amount": 60
            }
          }
        }
      },
      "sku": "product-sku-a",
      "sales": {
        "summer": {
          "schedule": {
            "valid_form": "2023-12-24T09:00:00",
            "valid_to": "2023-12-25T09:00:00"
          },
          "currencies": {
            "USD": {
              "amount": 90,
              "includes_tax": false,
              "tiers": {
                "min_5": {
                  "minimum_quantity": 5,
                  "amount": 40
                }
              }
            },
            "CAD": {
              "amount": 117,
              "includes_tax": false,
              "tiers": {
                "min_10": {
                  "minimum_quantity": 10,
                  "amount": 80
                }
              }
            },
            "GBP": {
              "amount": 65,
              "includes_tax": true,
              "tiers": {
                "min_20": {
                  "minimum_quantity": 20,
                  "amount": 50
                }
              }
            }
          }
        }
      },
      "external_ref": "external-ref",
      "created_at": "2020-09-22T09:00:00Z",
      "updated_at": "2020-09-22T09:00:00Z",
      "admin_attributes": {
        "cost_of_goods": "42.0",
        "charge_type": "credit card"
      },
      "shopper_attributes": {
        "cost_of_goods": "42.0",
        "charge_type": "credit card"
      }
    },
    "id": "a915553d-935d-4d56-870b-817b47a44a99",
    "meta": {
      "owner": "store",
      "pricebook_id": "4c45e4ec-26e0-4043-86e4-c15b9cf985a7"
    }
  },
  "links": {
    "self": "/pcm/pricebooks/4c45e4ec-26e0-4043-86e4-c15b9cf985a7/prices/ad042b07-e86d-476a-82d5-43dda1f80d03"
  }
}
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.