Authentication v1
- Identity APIs
- User
- Address
- Auth
User Self Service APIs
- Introduction
- User Self Service APIs
- Authentication APIs
Experiences v2 (XM v2)
- XM
- Pages
- Global Components
- Menu
Experiences v1 (XM v1)
- XM
- Pages
- Global Components
- Menu
Product Catalog
- Product Catalog
- Category
- Product
- Attributes
- Bulk Import
Orders v2 (OMS v2)
- Order Management System
- Order
- Order Attribute
- Developer Guide
- Order Return
- Payment Status
- Package Tracking
- Cross Border
- Order Cancellation
- Appeasement
- Allocation
- Configuration
- Fraud Configuration
- Target Configuration
- Location
- Location Attribute
- Inventory Network
- Inventory
- Inventory Counter
- Inventory Bulk Operation
- Inventory Attribute
- Inventory Upload Log
- Shipment
- Shipping Method
- Webhook
- Notification
- Export
- Invoice
- Fraud
- Backorder Preorder Reservation
- List
Orders v1 (OMS v1)
- Order Management System
- Cart
- Bill To
- Ship To
- Wishlist
- Cart Decoupled
- Warehouse
- Inventory
- Attributes
- List
- Tax/Address Validate
- Shipping
- Payments
- Order
Offers v2
- Offers
- Developer Guide
- Promotion
- Price Kind
- Dynamic Pricing Engine
- Segment
- Coupon
- Coupon Codes
- Product
- Price List
- Attributes
- Item
- Price Guard
- Global Exclusion
- Upload Price CSV
- Pricing
- Redemption
- Exports
Offers v1
- Offers
- Login API
- Promotions
- Pricing
Subscriptions (SMT API)
- Subscriptions API
- Cancellation Reasons
- Subscription Discounts
- Subscriptions
- Subscribers
- Orders
Loyalty (Member)
- Member APIs
- Inquire
- Discounts
- Redeem
- Earn
- Members
Dropship
- Dropship API
- Shipments
- Products
- Invoices
- Connections
- Inventory
- Developer Guide
- Returns
- Orders
Cart API
- Cart
- Order Draft
- Attribute
- Adjustments
- Shipping
- Cart
Checkout API
- Checkout
- Checkout
Customer
- Core Concepts
- Customer Service
- Organization
- User Party
- Organization Group Addresses
- User Internal Party
- Organization Contracts
- Party
- Party Contracts
- Contracts
- User
- Search
- User Trait
- Organization Users
- Address
- User Address
- Trait
- Party Address
- Party Trait
- Organization Group Users
- Internal Party
- Contract Pricelist
- Internal Parties Party
- Account
- Party Account
- Organization Addresses
- Organization Groups
- Individual Addresses
- Users Organization
- Individual
Validate Promotions
Enables you to validate a cart’s promotions - coupon codes and implicit promotions - for specified item IDs.
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-price/promo/validate \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '{
"isLoggedIn": false,
"userId": "5e2cfb9b45570b000864c4b5",
"promoCodes": [
"300DOFF"
],
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"base": 1000,
"sale": 0,
"currency": "USD"
}
}
]
}'
{
"isSuccess": true,
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"sale": 1000,
"cost": 0,
"currency": "USD",
"base": 5000,
"kind": "Promotion",
"discount": 0
},
"discount": [
{
"_id": "5f9be340dde1cd0008f96035",
"unit": "AMOUNT_OFF",
"value": 300,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5f9be340dde1cd0008f96035",
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "300DOFF",
"promoTitle": "SKU 300 D off all skus",
"type": "COUPON"
}
],
"discountQuantity": 3,
"discountAmount": 5070
}
],
"appliedDiscounts": [
{
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off ",
"type": "PROMOTION-SKU"
}
],
"discounts": [
{
"_id": "5faaac2dd49ffe00071e4f8e",
"unit": "%OFF",
"value": 99,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faaac2dd49ffe00071e4f8e",
"type": "PROMOTION-SKU",
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off."
}
]
}
Headers
The x-site-context
header is a JSON object that contains information about the source you wish to pull from. The mandatory account
is the 24 character identifier found in Copilot. The channel
(Sales channel ID), stage
(environment name), and date
attributes can be used to further narrow the scope of your data source.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Body
The item details. At least one item must be specified.
The unique ID of the item.
1000000119
The ID of the group to which the item belongs.
["5e2cfb9b45570b000863c4b5"]
The quantity of the item in the cart.
3
The number corresponding to the item in the cart.
1
The Stock Keeping Unit (SKU) ID of the item to track in the inventory.
"SKU0001"
True
indicates a logged in user and False
indicates guest user.
false
The 24 character system-generated ID of the logged-in user. This is auto-generated based on the Authorization Token (JWT token from the Login API) specified in the Headers.
"5e2cfb9b45570b000864c4b5"
The coupon codes applied by the user.
["300DOFF"]
Response
True indicates the cart validation is successful and false indicates otherwise.
true
The item details.
The number corresponding to the item in the cart.
1
The Stock Keeping Unit (SKU) ID of the item to track in the inventory.
"SKU0001"
The unique ID of the item.
1000000119
The ID of the group to which the item belongs.
["5e2cfb9b45570b000863c4b5"]
The quantity of items.
3
The price details
The sale price.
1000
The cost of the item as provided by the merchant.
0
The three character unit of currency.
"USD"
The base price.
5000
The price type currently active.
Clearance
, Promotion
"Promotion"
The discount value.
0
The details of the discount applied.
The system-generated ID (for internal use only).
"5f9be340dde1cd0008f96035"
The unit of discount. Represents whether the discount is in percentage or dollar value.
%OFF
, AMOUNT_OFF
"AMOUNT_OFF"
The discount value.
300
For internal use only. Represents the promotion type (SKU, CART, or QUANTITY) that was applied.
The ID of the discount.
"5f9be340dde1cd0008f96035"
The 24 character system-generated ID for a set of promotion codes.
"5f9be340dde1cd0008f96034"
The promo code (for customer use).
"300DOFF"
The title of the promotions.
"SKU 300 D off all skus"
The type of promotions.
PROMOTION-SKU
, PROMOTION-SHIPPING
, PROMOTION-CART
, PROMOTION-QUANTITY
, COUPON
"COUPON"
The discount quantity.
3
The discount value.
5070
The basic details (such as promoId, promoTitle, and type) of all the discounts applied to the cart.
The 24 character system-generated ID for a set of promotion codes.
"5faaac2dd49ffe00071e4f8d"
The name or label of the promo.
"inclsion promo 99 P off "
The type of promotion.
PROMOTION-SKU
, PROMOTION-SHIPPING
, PROMOTION-CART
, PROMOTION-QUANTITY
, COUPON
"PROMOTION-SKU"
The additional attributes of the discounts applied to the cart such as discount ID, unit, and value of discount, along with the basic details.
The 24-character system-generated ID of the discount.
"5faaac2dd49ffe00071e4f8e"
The unit of discount. Represents whether the discount is in percentage or dollar value.
%OFF
, AMOUNT_OFF
"%OFF"
The discount value.
99
The 24 character system-generated discount ID.
"5faaac2dd49ffe00071e4f8e"
The type or kind of promotion.
PROMOTION-SKU
, PROMOTION-SHIPPING
, PROMOTION-CART
, PROMOTION-QUANTITY
, COUPON
"PROMOTION-SKU"
The system-generated ID for a set of promotion codes.
"5faaac2dd49ffe00071e4f8d"
The name or label of the promo.
"inclsion promo 99 P off."
Was this page helpful?
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-price/promo/validate \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '{
"isLoggedIn": false,
"userId": "5e2cfb9b45570b000864c4b5",
"promoCodes": [
"300DOFF"
],
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"base": 1000,
"sale": 0,
"currency": "USD"
}
}
]
}'
{
"isSuccess": true,
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"sale": 1000,
"cost": 0,
"currency": "USD",
"base": 5000,
"kind": "Promotion",
"discount": 0
},
"discount": [
{
"_id": "5f9be340dde1cd0008f96035",
"unit": "AMOUNT_OFF",
"value": 300,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5f9be340dde1cd0008f96035",
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "300DOFF",
"promoTitle": "SKU 300 D off all skus",
"type": "COUPON"
}
],
"discountQuantity": 3,
"discountAmount": 5070
}
],
"appliedDiscounts": [
{
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off ",
"type": "PROMOTION-SKU"
}
],
"discounts": [
{
"_id": "5faaac2dd49ffe00071e4f8e",
"unit": "%OFF",
"value": 99,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faaac2dd49ffe00071e4f8e",
"type": "PROMOTION-SKU",
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off."
}
]
}