Skip to main content

Add Custom Discount To Cart Item

POST 

https://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID/custom-discounts

Use this endpoint to add a custom discount to cart item.

Request

Responses

Response Headers

    Authorization: http

    name: bearerAuthtype: httpscheme: bearer
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID/custom-discounts");
    request.Headers.Add("Accept", "application/json");
    request.Headers.Add("Authorization", "Bearer <TOKEN>");
    var content = new StringContent("{\n \"amount\": 0,\n \"description\": \"string\",\n \"discount_code\": \"string\",\n \"discount_engine\": \"string\",\n \"external_id\": \"string\",\n \"type\": \"string\"\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://useast.api.elasticpath.com
    Auth
    Parameters
    — pathrequired
    — pathrequired
    Body
    {
      "amount": 0,
      "description": "string",
      "discount_code": "string",
      "discount_engine": "string",
      "external_id": "string",
      "type": "string"
    }
    
    ResponseClear

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