- Support
- Product Releases
- Blog
- Overview
- API References
- API Authentication
- Getting Started with fabric APIs
- Making your first API request
- Example
- Using Developer Portal
- Security and Compliance
- Product Catalog API - Overview
- Developer Guide
Attributes & Attribute Mapping
Categories
Products
Collections
Background Jobs
Bulk Import & Export
Published Products
Allocations
- Orders (3.0.0)
Backorders Preorders
Exports
Developer Guide
Invoices
Shopping Lists
Shopping List Items
Notifications
Orders
Returns
Cancellations
Tracking
Frauds
Payments
Appeasements
Credits
Shipments
Shipping Methods
Shipping Method Items
Webhooks
- Orders FAQ(s)
- Overview
- Algolia standard integration
- Avalara standard integration
- Constructor.io standard integration
- Stripe standard integration
- Offers (3.0.0)
Real-time Pricing Engine
Promotions
Webhook Events
Redemptions
Priced Products
Product Exclusion Lists
Price Types
Coupons
Coupon Codes
Segments
Prices
Price Methods
Price Controls
Price Lists
Add-ons
Exports
Imports
Attributes
Customer Profile
Customer Address
Customer Self
Getting Started
Product Catalog
Orders
Integrations
Offers
Customers
Calculate prices for products by IDs
Use this endpoint to calculate prices for one or more products in a specific price list based on product IDs. Note that the itemId
is the default identifier of a product. If you want to set SKUs as the identifier of a product identifiers, reach out to the fabric support at support@fabric.inc.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Merchant's 24-character tenant ID
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.
The sales channel ID.
A sample request to evaluate the prices of products by item IDs.
The price list ID associated with the item.
A list of product IDs for which prices needs to be retrieved. You can specify up to 50 IDs at a time.
Customer details
Unique identifier for the customer
List of segments to which the customer belongs
The parameters for price calculation
A flag indicating whether the audit details should be included in the response. Set to true
to include the audit details along with the price calculation details and set to false
to exclude the audit details in the response.
The language code, which is a combination of language (ISO 639 format) and country (ISO 3166 format). <br />Default value is en-US.
curl --request POST \
--url https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '{
"priceListId": 100275,
"itemIds": [
111111,
222222
],
"customer": {
"id": "5e2cfb9b45570b000864c4b5",
"segments": [
{
"name": "category",
"value": [
"GOLD",
"YELLOW"
]
},
{
"name": "ageGroup",
"value": [
"elderly"
]
}
]
},
"priceParameters": [
{
"additionalProperties": [
{
"id": "length",
"value": 10
},
{
"id": "width",
"value": 20
}
],
"selectedAddOns": [
"blind_motor"
],
"quantity": 500,
"itemId": 12345
}
],
"isAudit": true,
"locale": "en-US"
}'
{
"errors": [],
"data": [
{
"priceListId": 100275,
"itemId": 11111111,
"currency": "USD",
"channelId": "12",
"offer": {
"price": {
"sale": 1000.15,
"cost": 900.15,
"base": 2000.15,
"unitPriceWithoutDiscounts": 2000.15,
"lineTotalWithoutDiscounts": 2000.15,
"lineTotalWithDiscounts": 2000.15,
"type": "BASE"
},
"discounts": [
{
"amount": 100.15,
"quantity": 1,
"application": 1,
"promotion": {
"id": "6197ec46e836ff000952d668",
"value": 2000.15,
"groupId": "61a6354d0d70e30009415f16",
"level": 1,
"isStackable": true,
"isAlwaysApplied": true,
"name": "20% OFF",
"type": "Coupon",
"discountType": "AMOUNT_OFF"
}
}
],
"suggestedProducts": [
{
"promotionId": "6197ec46e836ff000952c668",
"promotionName": "Buy Shoes, get socks 50% off",
"itemIds": [
10021,
10022,
10023
],
"eligiblePriceLists": [
10000
],
"isFree": false,
"discountType": "PERCENTAGE_OFF",
"amount": 50,
"quantity": 1
}
],
"additionalAttributes": [
{}
]
},
"audit": {
"userId": "62f5e25ca090100009c6e0f0",
"priceMethodType": "SurfaceArea_Square_Increment",
"quantity": 50,
"priceParameters": {
"additionalProperties": [
{
"id": "length",
"value": 10
},
{
"id": "width",
"value": 20
}
]
},
"appliedAddons": [
{
"name": "blind-motor",
"value": 100
}
]
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Merchant's 24-character tenant ID
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.
The sales channel ID.
Body
The price list ID associated with the item.
A list of product IDs for which prices needs to be retrieved. You can specify up to 50 IDs at a time.
Customer details
Unique identifier for the customer
List of segments to which the customer belongs
Segment name
Segment values
The parameters for price calculation
The additional properties for calculating the price.
The variable ID.
The variable value.
List of add-ons selected for the product
Number of products ordered, mandatory for Range-Base pricing method
Item ID
A flag indicating whether the audit details should be included in the response. Set to true
to include the audit details along with the price calculation details and set to false
to exclude the audit details in the response.
The language code, which is a combination of language (ISO 639 format) and country (ISO 3166 format). <br />Default value is en-US.
Response
Errors array
The error code.
An error message corresponding to the type
.
Price list ID of the item
Item ID
Currency for the discount amount
Sales channel for which the price is calculated
Discounts or special offers applied to the price
Calculated price details of line items
Price at which the product is offered for sale
Cost of goods sold, from either producing or purchasing from other vendors
Starting price of a single item
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 discount(s).
Price type
Currency string value
A list of discounts applied to the price.
Actual discount amount
The number of items eligible for the promotional discount.
The number of times the BuyGet promotion can be used, indicating how many times you can use the promotions, such as get a certain amount or percentage off, or get free items when making a purchase.
Promotion object
Promotion ID
Discount in percent or amount
ID of the group or category this product belongs to
The order in which the current promotion is executed.
Specifies whether the promotion is stackable. You can set one of the following:<br />True: You can combine this promotion with other promotions. The discount of the current promotion is combined with other promotions, if applicable, to the item.<br />False: The promotion is not stackable. You cannot combine this promotion with other promotions.
Specifies whether the promotion is applied regardless of the exclusive promotions on the same item. You can set one of the following values:<br />true: Promotion is applied regardless of the exclusive promotions on the same item.<br />false: Promotion is not applied on the item
Promotion name
Promotion type
Discount type
PERCENTAGE_OFF
, AMOUNT_OFF
, FIXED_PRICE
The message displayed 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.
Promotion ID
A placeholder for additional price attributes, in key-value pairs.
Details about how the price is calculated
ID of the user who created the price
Method used to calculate the price
Quantity for which the price was calculated
The additional parameters for calculating the price.
The additional properties for calculating the price.
The variable ID.
The variable value.
List of additional components used in the price calculation
Was this page helpful?
curl --request POST \
--url https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '{
"priceListId": 100275,
"itemIds": [
111111,
222222
],
"customer": {
"id": "5e2cfb9b45570b000864c4b5",
"segments": [
{
"name": "category",
"value": [
"GOLD",
"YELLOW"
]
},
{
"name": "ageGroup",
"value": [
"elderly"
]
}
]
},
"priceParameters": [
{
"additionalProperties": [
{
"id": "length",
"value": 10
},
{
"id": "width",
"value": 20
}
],
"selectedAddOns": [
"blind_motor"
],
"quantity": 500,
"itemId": 12345
}
],
"isAudit": true,
"locale": "en-US"
}'
{
"errors": [],
"data": [
{
"priceListId": 100275,
"itemId": 11111111,
"currency": "USD",
"channelId": "12",
"offer": {
"price": {
"sale": 1000.15,
"cost": 900.15,
"base": 2000.15,
"unitPriceWithoutDiscounts": 2000.15,
"lineTotalWithoutDiscounts": 2000.15,
"lineTotalWithDiscounts": 2000.15,
"type": "BASE"
},
"discounts": [
{
"amount": 100.15,
"quantity": 1,
"application": 1,
"promotion": {
"id": "6197ec46e836ff000952d668",
"value": 2000.15,
"groupId": "61a6354d0d70e30009415f16",
"level": 1,
"isStackable": true,
"isAlwaysApplied": true,
"name": "20% OFF",
"type": "Coupon",
"discountType": "AMOUNT_OFF"
}
}
],
"suggestedProducts": [
{
"promotionId": "6197ec46e836ff000952c668",
"promotionName": "Buy Shoes, get socks 50% off",
"itemIds": [
10021,
10022,
10023
],
"eligiblePriceLists": [
10000
],
"isFree": false,
"discountType": "PERCENTAGE_OFF",
"amount": 50,
"quantity": 1
}
],
"additionalAttributes": [
{}
]
},
"audit": {
"userId": "62f5e25ca090100009c6e0f0",
"priceMethodType": "SurfaceArea_Square_Increment",
"quantity": 50,
"priceParameters": {
"additionalProperties": [
{
"id": "length",
"value": 10
},
{
"id": "width",
"value": 20
}
]
},
"appliedAddons": [
{
"name": "blind-motor",
"value": 100
}
]
}
}
]
}