younifyd
Menu

Bulk Add Custom Discounts To Cart

Bulk Add Custom Discounts to Cart

POST/v2/carts/{cartID}/custom-discounts

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Bulk Add Custom Discounts To Cart action (under Carts).
  3. Fill in the fields below, then reference the result from later steps as {{bulkAddCustomDiscountsToCart.response.data}}.

Request

Path parameters

cartIDstringrequired

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

Request body

Enter the body as JSON in the step's Body field.

dataarray<any>
optionsobject
add_all_or_nothingboolean

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`.

json
{
  "data": [
    null
  ],
  "options": {
    "add_all_or_nothing": false
  }
}

Response

Returns 201 with a oneOf. Read it in later steps with {{bulkAddCustomDiscountsToCart.response.data.<field>}}.

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.