Overview
B2B (business-to-business) e-commerce is the exchange of products, services or information between businesses, rather than between businesses and consumers (B2C).
Athena XAI supports pricing by B2B groups, so you can list different prices for the same products across various B2B groups and apply discounts to specific B2B groups. It is similar to pricing by customer groups, but adds features such as quantity support for each group.
Add groups to the product feed
Include the btb_groups field in the product feed. This field should be an array of objects. Each object represents a B2B group and includes:
- The regular price.
- The B2B group ID, a string without spaces or special characters.
- Additional fields for special pricing and quantity.
[
{
"entity_id": "68",
"name": "Chaz Kangeroo Hoodie",
"sku": "MH01",
...
"btb_groups": [
{
"regular_price": 52.99,
"btb_group_id": “company-4567”
},
{
"regular_price": 52.99,
"special_price": 42.99,
"btb_group_id": “company-17y23”
},
{
"regular_price": 52.99,
"special_price": 42.99,
"qty": 42,
"btb_group_id": “company-12jh1”
}
]
}
]
Request prices for a group
After Athena XAI indexes the data and completes reindexing, you can display different prices for the same products to different B2B groups.
To retrieve prices for a specific B2B group, include the B2B group ID in every API request. For instance, when you use the Autocomplete API, include the parameter btb_group_id for the B2B clients conducting searches, along with the query parameters, website token and others:
{
"q": "Yoga",
"token": "{{ token }}",
"btb_group_id": "company-12jh1"
}
Prices in the response
When you provide the B2B group ID correctly, you get the prices for that B2B group:
"price": {
"regular_price": 59.99,
"regular_price_with_currency": "$ 59,99",
"special_price": 42.99,
"special_price_with_currency": "$ 42,99",
"discount_percentage": 20,
"qty": 42
}