Bulk Add Custom Discounts to Cart
POSThttps://useast.api.elasticpath.com/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.
- application/json
Body
data object[]
options object
Responses
- 200
- 401
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
data object[]
options object
{
"data": [
{
"amount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"description": "string",
"discount_code": "string",
"discount_engine": "string",
"external_id": "string",
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"relationships": {
"item": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}
}
],
"options": {
"add_all_or_nothing": true
}
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
detail string
status string
title string
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}
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/custom-discounts' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": [
{
"amount": 0,
"description": "string",
"discount_code": "string",
"discount_engine": "string",
"external_id": "string",
"type": "string",
"relationships": {
"item": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}
}
],
"options": {
"add_all_or_nothing": true
}
}'
ResponseClear