Carts | Checkout
Add discount to cart
Add a discount to the cart. Use discountType to specify whether it applies to the order, specific line items, or other scenarios.
Note: Discounts are usually applied automatically to a cart - either by Omnium's promotions engine when adding items, when adding a coupon code, or when adding a customer to the cart and items are recalculated. If you are unsure whether you should use this endpoint or not, you probably shouldn't😵💫
Example - 20% order-level discount:
PUT /api/carts/{cartId}/AddDiscount
{
"discountType": "Order",
"discountName": "Summer sale 20%",
"discountValue": 20,
"rewardType": "Percentage"
}
Example - Fixed amount discount (100 NOK off):
PUT /api/carts/{cartId}/AddDiscount
{
"discountType": "Order",
"discountName": "100 NOK rabatt",
"discountValue": 100,
"rewardType": "Money"
}
Example - Line item discount on specific SKUs:
PUT /api/carts/{cartId}/AddDiscount
{
"discountType": "LineItem",
"discountName": "50% on selected items",
"discountValue": 50,
"rewardType": "Percentage",
"skuIds": ["SKU-001", "SKU-002"]
}
Example - 3 for 2 promotion:
PUT /api/carts/{cartId}/AddDiscount
{
"discountType": "LineItem",
"discountName": "3 for 2",
"rewardType": "MultiBuys",
"skuIds": ["SKU-001", "SKU-002", "SKU-003"],
"promotionMultiBuyReward": {
"requiredBuyAmount": 2,
"numberOfDiscountedItems": 1,
"percentage": 100
}
}
put/api/Cart/{cartId}/AddDiscount
Request
- Base URL: https://api.omnium.no (the document declares no server; this is the origin it was published from)
- URL: https://api.omnium.no/api/Cart/{cartId}/AddDiscount
- Auth: API key in header Authorization
Path parameters
cartIdstring nullable required
Cart ID
Request body
Response
Discount added and updated cart is returned
Changes
No recorded changes to this operation across all 1 revision of this API.