Getting Started
Authentication v3
- Concepts
- System Apps
- User Apps
- Authentication Endpoints
Product Catalog
- Product Catalog API - Overview
- Developer Guide
- Data Ingestion Best Practices
- Attributes & Attribute Mapping
- Categories
- Products
- Collections
- Background Jobs
- Bulk Import & Export
- Published Products
Orders
- Orders (3.0.0)
- Developer Guide
- Orders FAQ
- Shopping Lists
- Shipping Methods
- Imports
- Exports
- Orders
- Frauds
- Notifications
- Backorders Preorders
- Cancellations
- Allocations
- Shipments
- Inventory Transfers
- Tracking
- Invoices
- Payments
- Credits
- Appeasements
- Returns
Inventory
- Inventory (3.0.0)
- Inventory FAQ
- Imports
- Counters
- Inventory
- Locations
- Networks
Integrations
Offers
- Offers (3.0.0)
- Developer Guide
- Real-time Pricing Engine
- Price Lists
- Prices
- Price Types
- Price Controls
- Price Methods
- Priced Products
- Add-ons
- Promotions
- Coupons
- Coupon Codes
- Redemptions
- Product Exclusion Lists
- Segments
- Imports
- Exports
- Attributes
- Webhook Events
Carts
- Overview
- Developer Guides
- Carts
- Order Draft
- Items
- Addresses
- Payments
- Fulfillment
- Customer
- Coupons
- Validations
- Cart Orchestrator
Customers
- Customer Profile
- Customer Address
- Customer Self
Evaluate cart promotions
Evaluate cart’s total cost instantly, after applying all applicable promotions and discount coupons. Using this endpoint, submit a range of data that will be referenced against the conditions that are set earlier using the promotions, coupons or prices APIs. The response includes the details of the promotions and discounts applied. These promotions and discounts can be displayed on your website to help shoppers know that they’re getting their expected discounts.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
The Date and time, in ISO 8601 format, for which the evaluation should be done. The prices and promotions that are active on this date will be considered for evaluation.
A unique request ID.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
A sample cart evaluation request.
Customer details
Unique identifier for the customer
A list of segments the customer belongs to.
Promotion codes to be applied
The details of items in the cart.
The language code, which is a combination of language in ISO 639 format and country in ISO 3166 format. The default value is en-US.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
24
The Date and time, in ISO 8601 format, for which the evaluation should be done. The prices and promotions that are active on this date will be considered for evaluation.
A unique request ID.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
Body
A sample cart evaluation request.
The details of items in the cart.
Item ID obtained from Product Catalog.
Line item position (starts at 1)
x > 1
Line item SKU
Line item product attributes
Attribute ID
Attribute name
Attribute description
Attribute mapping
Attribute type
Attribute value
Attribute price
Attribute level
Line item quantity within the cart
The price list ID associated with the item generated using the create price list endpoint.
Individual line item price
Sale price of the product.
Cost of goods sold, from either producing or purchasing from other vendors.
The base price of a single item before any discounts.
Price of a single item without discount. This price is either the base
or sale
price. The type used is noted in the type
property.
Total price of all items without calculating discounts. This is the unitPriceWithoutDiscounts
multiplied by the quantity.
Total price of all items after all discounts. This is the unitPriceWithoutDiscounts multiplied by the quantity, less the promotion discounts.
Price type
Currency string value
List of group IDs for groups or category the line items belongs to
Line item attributes passed by caller
The collections associated with given item.
Customer details
Promotion codes to be applied
The language code, which is a combination of language in ISO 639 format and country in ISO 3166 format. The default value is en-US.
Response
The response of the evaluation request of the cart promotion.
The list of items in the cart.
Item ID obtained from Product Catalog.
Line item position (starts at 1)
x > 1
Line item SKU
Line item product attributes
Attribute ID
Attribute name
Attribute description
Attribute mapping
Attribute type
Attribute value
Attribute price
Attribute level
Line item quantity within the cart
The price list ID associated with the item generated using the create price list endpoint.
Individual line item price
Sale price of the product.
Cost of goods sold, from either producing or purchasing from other vendors.
The base price of a single item before any discounts.
Price of a single item without discount. This price is either the base
or sale
price. The type used is noted in the type
property.
Total price of all items without calculating discounts. This is the unitPriceWithoutDiscounts
multiplied by the quantity.
Total price of all items after all discounts. This is the unitPriceWithoutDiscounts multiplied by the quantity, less the promotion discounts.
Price type
Currency string value
List of group IDs for groups or category the line items belongs to
Line item attributes passed by caller
A list of applicable discounts.
The actual discount amount applied to the price. For example, specifying 100.15 for a product with a base price of 2000.15 results in a discounted price of 1900.
The number of items eligible for the promotional discount.
The discount amount distributed proportionally among all the selected items. The distribution is determined based on each item's price relative to the total price of all participating items. Typically, proratedAmount
matches the amount
. However, there might be variations, particularly in the context of Buy-Get promotions.
This is used in conjunction with proratedAmount
to determine the discount portion allocated to the respective units of BuyGet promotions. This is applicable in partial return scenarios.
An identifier for an instance of the Buy-Get promotion that can be applied repeatedly. For example, consider a promotion - Buy 1 shirt and get 1 pant at a 20% off. If a shopper buys three shirts, 20% discount is individually applied to each shirt-pant pair. Each such discounted pair is assigned a unique application
number for tracking purposes.
The promotion details.
A 24-character system-generated coupon ID generated using the create coupon endpoint.
The discount in percent or amount.
ID of the group or category this product belongs to
The order in which the current promotion is executed.
A flag indicating whether the promotion is stackable. Set to true
to combine the given promotion with other promotions. The discount of the current promotion is combined with other promotions, if applicable, to the item. Set to false
if the promotion isn't stackable; the given promotion can't be combined with other promotions.
A flag indicating whether the promotion is always applied regardless of any exclusive promotions on the same item. Set to true
if the promotion is always applied and set to false
if the promotion isn't applied on the item by default.
Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. Possible values: - STACKABLE
: This promotion can be combined with other stackable promotions, allowing multiple
discounts to be applied together. The order in which stackable promotions are applied
is determined by the level
field, with promotions having a higher priority (lower numeric value)
being applied before those with a lower priority.
EXCLUSIVE
: This promotion can't be combined with any other promotions. Thelevel
field is used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive promotion is applied, no other promotions can be used in the same transaction.TYPE_EXCLUSIVE
: This promotion can't be combined with other promotions of the same type. Thelevel
field is used to determine which promotion within the same type will be evaluated and applied first.UNIVERSAL
: This promotion can be combined with any other promotions without restrictions. Universal promotions will be evaluated last.
STACKABLE
, EXCLUSIVE
, TYPE_EXCLUSIVE
, UNIVERSAL
The name of the promotion.
The type of the promotion.
The type of discount.
PERCENTAGE_OFF
, AMOUNT_OFF
, FIXED_PRICE
The collections associated with given item.
The error details.
The details of the discounts applied to the cart.
A 24-character system-generated coupon ID generated using the create coupon endpoint.
Coupon code
Promotion name
Promotion type
Discount amount
Suggested free products
A 24-character system-generated coupon ID generated using the create coupon endpoint.
The promotion name
The item ID of the free product
The suggested item IDs from which shoppers can choose one or more items based on the configuration of BuyGet promotion. Even if an item ID is already in the cart, they appear in the list of potential item IDs. This ensures visibility and enables shoppers to make informed decisions during the checkout process.
The Stock Keeping Unit (SKU) of the free product.
The suggested SKUs from which shoppers can choose one or more items based on the configuration of BuyGet promotion. Even if an SKU is already in the cart, they appear in the list of potential SKUs. This ensures visibility and enables shoppers to make informed decisions during the checkout process.
The price list IDs, eligible for promotions. When they're not specified, the promotion applies to all price lists. specified, promotion applies to all price lists.
The number of complimentary items in the promotion.
The maximum limit of complimentary items available for the BuyGet promotion. For example, consider the promotionQuantity
is 10 and promotion condition is Buy 1 pair of shoes and Get 1 pair of socks free. If a shopper purchases up to 10 pairs of shoes, they will get an equivalent number of socks for free. However, even if they buy more than 10 pairs of shoes, the maximum free pairs of socks will remain 10, as defined by the promotionQuantity
parameter.
A flag indicating whether a free item is included as part of promotion. Set to true
to indicate a free item is offered as promotion and false
to indicate otherwise.
The type of discount.
The discount amount.
Rejected coupons
Coupon code
A 24-character system-generated coupon ID generated using the create coupon endpoint.
Reason why coupon not applied
Message description for the promotion
Message name
Message description
The types of web pages where the message is displayed.
The locales in which the promotion message is displayed. Locale is a set of language or country-based preferences for user interface.
A 24-character system-generated coupon ID generated using the create coupon endpoint.
Was this page helpful?