Skip to main content

Update Custom Discount For Cart Item

PUT 

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

Body

    data object
    amountnumberrequired

    Specifies an amount to be applied for the custom discount. It must be less than zero.

    descriptionstringrequired

    Specifies a description for the custom discount.

    discount_codestringrequired

    Specifies the discount code used for the custom discount.

    discount_enginestringrequired

    Specifies from where the custom discount is applied. For example, Talon.one.

    external_idstringrequired

    Specifies an external id for the custom discount.

    typestringrequired

    Specifies the type of the resource. Always custom_discount.

Responses

Response Headers
    Schema
      data object
      amount object
      amountnumber

      Specifies an amount to be applied for the custom discount. It must be less than zero.

      currencystring

      The currency set for the custom discount.

      formattedstring

      The formatted value for the custom discount.

      descriptionstring

      Specifies a description for the custom discount.

      discount_codestring

      Specifies the discount code used for the custom discount.

      discount_enginestring

      Specifies from where the custom discount is applied. For example, Talon.one.

      external_idstring

      Specifies an external id for the custom discount.

      typestring

      Specifies the type of the resource. Always custom_discount.

      iduuid

      Specifies the UUID of the custom discount.

    Authorization: http

    name: bearerAuthtype: httpscheme: bearer
    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());
    Request Collapse all
    Base URL
    https://useast.api.elasticpath.com
    Auth
    Parameters
    — pathrequired
    — pathrequired
    — pathrequired
    Body
    {
      "data": {
        "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!

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