Skip to main content

Bulk Add Custom Discounts to Cart

POST 

/v2/carts/:cartID/custom-discounts

The default value for custom discounts on both the cart and cart items is set to 5 if this parameter is not configured in the store. To verify the custom discount limit value, call Get all settings endpoint.

To increase the custom discount value, contact Elastic Path Support team.

Request

Path Parameters

    cartID stringrequired

    Specifies the system generated ID for the cart that the shopper created.

Body

    data object[]
  • Array [
  • amount numberrequired

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

    description stringrequired

    Specifies a description for the custom discount.

    discount_code stringrequired

    Specifies the discount code used for the custom discount.

    discount_engine stringrequired

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

    external_id stringrequired

    Specifies an external id for the custom discount.

    type stringrequired

    Specifies the type of the resource. Always custom_discount.

    relationships object
    item object
    data object
    type string

    Specifies the type of item. For example, custom_item or cart_item.

    id uuid

    Specifies the unique identifier of the cart_item or custom_item in the cart.

  • ]
  • options object
    add_all_or_nothing boolean

    When true, if an error occurs for any item, no items are added to the cart. When false, valid items are added to the cart and the items with errors are reported in the response. Default is false.

Responses

Response Headers
    Schema
      data object[]
    • Array [
    • amount object
      amount number

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

      currency string

      The currency set for the custom discount.

      formatted string

      The formatted value for the custom discount.

      description string

      Specifies a description for the custom discount.

      discount_code string

      Specifies the discount code used for the custom discount.

      discount_engine string

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

      external_id string

      Specifies an external id for the custom discount.

      type stringrequired

      Specifies the type of the resource. Always custom_discount.

      id uuidrequired

      Specifies the UUID of the custom discount.

      relationships object
      item object
      data object
      type string

      Specifies the type of item. For example, custom_item or cart_item.

      id uuid

      Specifies the unique identifier of the cart_item or custom_item in the cart.

    • ]
    • options object
      add_all_or_nothing boolean

      When true, if an error occurs for any item, no items are added to the cart. When false, valid items are added to the cart and the items with errors are reported in the response. Default is false.

    Loading...