Skip to main content

Update a Cart

PUT 

https://useast.api.elasticpath.com/v2/carts/:cartID

Updates cart properties for the specified cartID.

You can update a cart to specify custom discounts. You can enable custom discounts when the discount_settings.custom_discounts_enabled field is set to true. Default is set from cart discount settings for the store. See Cart Settings.

You can also create a cart when inventory checks are not performed until checkout by setting the inventory_settings.defer_inventory_checks field to true. Again the default is set from cart discount settings for the store. See Update Cart Settings.

Request

Responses

Response Headers

    Authorization: http

    name: bearerAuthtype: httpscheme: bearer
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Put, "https://useast.api.elasticpath.com/v2/carts/:cartID");
    request.Headers.Add("Accept", "application/json");
    request.Headers.Add("Authorization", "Bearer <token>");
    var content = new StringContent("{\n \"description\": \"string\",\n \"discount_settings\": {\n \"custom_discounts_enabled\": true,\n \"use_rule_promotions\": true\n },\n \"inventory_settings\": {\n \"defer_inventory_checks\": true\n },\n \"name\": \"string\",\n \"contact\": {\n \"email\": \"user@example.com\"\n },\n \"snapshot_date\": \"string\",\n \"custom_attributes\": {},\n \"payment_intent_id\": \"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
    Body
    {
      "description": "string",
      "discount_settings": {
        "custom_discounts_enabled": true,
        "use_rule_promotions": true
      },
      "inventory_settings": {
        "defer_inventory_checks": true
      },
      "name": "string",
      "contact": {
        "email": "user@example.com"
      },
      "snapshot_date": "string",
      "custom_attributes": {},
      "payment_intent_id": "string"
    }
    
    ResponseClear

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