Add Custom Discount To Cart Item
POSThttps://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.
- application/json
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
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
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"
}'
ResponseClear