Update Custom Discount For Cart Item
PUThttps://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID/custom-discounts/:customdiscountID
Use this endpoint to update a custom discount in your cart item.
Request
Path Parameters
cartID stringrequired
Specifies the ID for the cart.
cartitemID stringrequired
Specifies the ID for the cart item.
customdiscountID stringrequired
Specifies the ID for the custom discount to be updated.
- application/json
Body
data object
Responses
- 200
- 401
Response Headers
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": {
"amount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"description": "string",
"discount_code": "string",
"discount_engine": "string",
"external_id": "string",
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
Unauthorized
- application/json
- Schema
- Example (auto)
- Example
Schema
detailstring
statusstring
titlestring
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}
Authorization: http
name: bearerAuthtype: httpscheme: 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://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID/custom-discounts/:customdiscountID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"amount\": 0,\n \"description\": \"string\",\n \"discount_code\": \"string\",\n \"discount_engine\": \"string\",\n \"external_id\": \"string\",\n \"type\": \"string\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear