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

Path Parameters

    cartID stringrequired

    Specifies the ID for the cart.

    cartitemID stringrequired

    Specifies the unique identifier for the cart item.

Body

    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.

Authorization: http

name: bearerAuthtype: httpscheme: bearer
curl -L -X POST 'https://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID/custom-discounts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"amount": 0,
"description": "string",
"discount_code": "string",
"discount_engine": "string",
"external_id": "string",
"type": "string"
}'
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!