Overview
Use pricing by customer groups to list different prices for the same products across various customer groups. You can also apply discounts to specific customer groups.
Add groups to the product feed
Include the customer_groups field in the product feed. This field should be an array of objects. Each object represents a customer group and includes the regular price, the customer group ID and an additional field for special pricing.
[
{
"entity_id": "68",
"name": "Chaz Kangeroo Hoodie",
"sku": "MH01",
...
"customer_groups": {
"0": {
"regular_price": 52.99,
"customer_group_id": 0
},
"1": {
"regular_price": 52.99,
"special_price": 42.99,
"customer_group_id": 1
},
"2": {
"regular_price": 52.99,
"special_price": 42.99,
"customer_group_id": 2
}
}
}
]
Request prices for a group
After Athena XAI indexes the data, you can show different prices for the same products to different customer groups.
To retrieve prices for a specific customer group, include the customer group ID in every API request. For instance, when you use the Autocomplete API, include the customer group ID parameter for the searching customer, along with the query parameters, website token and others:
{
"q": "Yoga",
"token": "{{ token }}",
"customer_group_id": "1"
}
Prices in the response
When you provide the customer group ID correctly, you get the prices for that customer group:
"price": {
"regular_price": 29,
"regular_price_with_currency": "$ 29,00",
"special_price": 23.2,
"special_price_with_currency": "$ 23,20",
"loyalty_price": null,
"loyalty_price_with_currency": null,
"discount_percentage": 20
}
You can send the customer_group_id parameter to all the APIs that return information about products. Either consistently include or consistently exclude this parameter in your API calls. Its presence and value dictate where the API retrieves price values.