Replacing discounts on cart
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}/UpdateDiscounts
- Auth: API key in header Authorization
Path parameters
Cart ID
Request body
Specifies at what level the discount is applied. Values:
- "None" (0): No specific type
- "LineItem" (1): Discount applied to specific order lines. Use SkuIds to specify which products
- "Order" (2): Discount applied to the entire order total
- "Shipping" (3): Discount applied to shipping cost. Should be added to shipment.discounts
- "Manual" (4): Manually applied discount (typically from UI)
- "BonusPoints" (5): Discount paid with customer club bonus points
List of SKU codes (product variant codes) that this discount applies to. Required for LineItem discounts and for FixedPrice/MultiBuys promotions to identify which products are part of the offer. Example: ["SKU-001", "SKU-002"] for a "Buy any 2 of these for 199" promotion.
Restricts the discount to specific order lines, on top of SkuIds. Leave it out - the usual case - and the discount applies to every line carrying one of the SkuIds. Set it when the same sku sits on more than one line and only some of them are discounted, or when two lines of the same sku are discounted by different amounts. This is how a discount coming from the product's price ("Price" DiscountSource) is recorded, since the price is resolved per line. A line split off one of these lines by a partial delivery is covered as well. Example: ["1", "3"]
Unique identifier for this discount. Used to track and reference specific discount instances.
The calculated discount amount in the order's currency. This is the actual monetary value that will be deducted from the order/line total. For percentage-based discounts, this is calculated from DiscountValue.
Maximum cap for the discount amount. Useful for percentage discounts where you want to limit the maximum deduction. Example: "20% off, maximum 100 NOK" - set DiscountValue=20, RewardType="Percentage", MaxDiscountAmount=100
Coupon or promotion code that triggered this discount. Used for tracking and for customers who enter promotional codes at checkout.
Display name for the discount, shown to customers and in reports. Example: "Summer Sale 20%", "3 for 2 on selected items", "Free shipping"
The discount value used together with RewardType to calculate the actual discount.
- For RewardType "Money": The fixed amount to deduct (e.g., 50 = 50 NOK off)
- For RewardType "Percentage": The percentage to deduct (e.g., 20 = 20% off)
- For RewardType "Free": Typically 100 (100% off)
- For RewardType "FixedPrice" and "MultiBuys": Use the corresponding reward objects instead
Indicates how the discount was created. Values: "Manual" (added by user/API), "Campaign" (from promotion engine), "Price" (carried by the product's price row, e.g. a sale price - scoped to the line it was priced for through LineItemIds, and maintained by Omnium as the line is repriced)
Defines how DiscountValue is interpreted and applied. Values:
- "None" (0): No reward
- "Money" (1): Fixed monetary discount (e.g., 50 NOK off)
- "Percentage" (2): Percentage discount (e.g., 20% off)
- "Free" (3): Item is free (100% off)
- "FixedPrice" (4): Items for a fixed total price (e.g., "4 for 99"). Requires PromotionFixedPriceReward
- "Gift" (5): Free gift item included
- "MultiBuys" (6): Multi-buy offer (e.g., "3 for 2"). Requires PromotionMultiBuyReward
- "Kit" (7): Set discount (buy one item from each of groups A, B, C and get discount on the set)
Priority determines the order in which discounts are applied when multiple discounts exist. Lower values are applied first (0 = highest priority, applied first). Important when combining discounts, as earlier discounts affect the base for later percentage calculations.
When true, this discount can be stacked with other promotions. When false, applying this discount may exclude other discounts depending on configuration.
When true, this discount is always applied regardless of CanBeCombinedWithOtherPromotions on other discounts. Use for discounts that should never be blocked by exclusivity rules.
When true, the reward is given as customer club bonus points instead of a price reduction. Only applicable for customer club promotions.
Response
Discount updated and cart is returned
Cart unique ID
Expiration date of cart. If passed, the cart should not be visible to customer.
Should the cart be read only?
Should the order/cart be read only for the customer?
Should promotion prices be ignored when product is added to cart?
Customer groups (for discount calculation)
Should be used when order needs a special status when created from cart
In most cases, this property will be identical to the Id property. However, if you have orders from multiple sources (multiple e-commerce sites, pos systems or other sales channels), and the order numbers from the sources could overlap, you could set the Id to a unique value and the order number to the user friendly number.
The ID of the customer that has placed the order. Typically this is set to the customers phone number or email address, but it could be set to anything. A customer with the matching ID does not have to exist in the system before the order is placed. If there are no overlapping IDs, but you still have multiple sources of IDs, consider using ExternalIds instead.
In most cases, the customer number could be set to the same value as the CustomerId. However, in some edge cases the customers could get imported from multiple systems with the same ID range. In that case, you should set the user friendly number to the CustomerNumber and an unique ID for the CustomerId.
If Customer is member of customer club, set Customer ID as member ID.
Currency of the order. e.g. "USD","NOK"
Full name of customer
Customer phone number with prefix. e.g. +4740000000
Customer e-mail
B2B or B2C (Business customer or private customer)
Market ID e.g. "US", "NOR", "SWE". This must match the value of the market(s) defined in Omnium.
(OBSOLETE: Use property on OrderForm instead) Shipping discount amount
Total shipping cost
The current order status. This must match a status defined in the order settings in Omnium. Typical values are "New", "InProgress", "Cancelled" or "Completed".
CALCULATED: The remaining payment amount if the difference between the authorized amount and total amount
Id of seller of the order - typically set to the e-mail of the user in Omnium, but could be set to any ID.
Name of the seller of the order
Name of sales channel
CALCULATED: Order completed date
CALCULATED: Order last modified date
CALCULATED: Modified by
The creation date of the order
The received date of the order
Order follow-up date
CALCULATED: Customer deadline for picking up order
CALCULATED: Employee deadline for picking order
Delivery date requested by customer
Date when order should be moved to next status. (Updated by UpdateOrderStatusScheduledTask)
Calculated: When the order was set to ready for pickup. The property can be set by workflow step with name: Set ready for pickup date
Status order should be moved to. (Updated by UpdateOrderStatusScheduledTask)
OBSOLETE: Use orderForm.payments instead.
Order type e.g. "Online", "Pos". The order type must match a order type defined in the Omnium order settings
The allocation profile Omnium's allocation engine should rank plans under for this order, for example FewestShipments or Closest. Empty means the profile configured for the market.
The store Id identifies the store that sells the orders. Should match an ID of an existing store. A store would typically be the front end e-commerce solution, a physical store or other sales channels.
The origin of the order should identify where the order was created. Typical values are "OMS", "ERP", "WEB" or "POS".
Calculated: Total cost of the order. The cost price
Calculated: OrderForm total - returnForms total
Calculated: OrderForm total excl tax - returnForms total excl tax
Reference provided by customer.
Customer contact person
Customer requisition provided by customer
If true, Omnium's notifications will not be triggered for the order
List of related order IDs
Session code used for referencing a web session
A unique secret key for the order. Can be used for secure order lookups.
List of replacement order IDs for this order
Subscription ID - used if order is part of a subscription. The Id should match an existing subscription in Omnium
Project IDs - used if order is part of projects
Order tags (Used by notification filters, and for grouping / filtering orders)
Net payment terms (in days). Used for invoice due dates.
Invoice comment
OBSOLETE: Use ProjectIds instead. Project ID - used if order is part of a project
(OBSOLETE: Use property on OrderForm instead) Order total without shipment cost
(OBSOLETE: Use property on OrderForm instead) Order total without shipment cost and without tax
(OBSOLETE: Use property on OrderForm instead) Total tax amount
(OBSOLETE: Use property on OrderForm instead) Order total, including shipment cost, tax, and discounts
(OBSOLETE: Use property on OrderForm instead) Order total, including shipment cost and discounts, but without tax
(OBSOLETE: Use property on OrderForm instead) Total order discount
Indicates whether the customer is new. Set automatically by the workflow if the customer's creation date is in the past, but can also be updated via the API.
Read only: Current version ID
Order name
Canceled date
Organization number
Correlation ID for tracing
Whether the order has been anonymized
Whether the order is reservable
List of invoice IDs associated with this order
Shows which documents have been generated for the order
Customer's own order number
Whether the order has been reallocated
Changes
No recorded changes to this operation across all 1 revision of this API.