Update a Modifier
PUThttps://euwest.api.elasticpath.com/pcm/pricebooks/:pricebookID/modifiers/:modifierID
Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the price modifier is not updated.
Request
Responses
- 200
- default
Updated price modifier.
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/modifiers/:modifierID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <TOKEN>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"37f2eed6-0bea-4d0b-a3c6-24cc76143bfd\",\n \"type\": \"price-modifier\",\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 \"name\": \"large-supplement\",\n \"modifier_type\": \"price_equals\",\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