B2B / Customer Groups
Group-Specific Fields
Makaira supports customer group-specific field overrides for B2B scenarios, multi-channel setups, and personalized pricing.
Target location: This content could be added as a new section under Use Cases or as part of a B2B documentation section.
Overview
Any field can have a group-specific override using the pattern:
groups.<groupname>.<fieldname>
When a GROUP constraint is set in the API request, Makaira checks for group-specific values first.
How It Works
- Customer makes a request with
GROUPconstraint - Makaira checks if
groups.<group>.<field>exists - If yes, uses the group-specific value
- If no, falls back to the root field value
Commonly Overridden Fields
| Field Pattern | Description |
|---|---|
groups.<group>.active | Group-specific activation |
groups.<group>.hidden | Group-specific visibility |
groups.<group>.hideOnLists | Group-specific list visibility |
groups.<group>.searchable | Group-specific searchability |
groups.<group>.onstock | Group-specific stock status |
groups.<group>.stock | Group-specific stock quantity |
groups.<group>.price | Group-specific pricing |
Import Example
{
"id": "product-001",
"type": "product",
"active": true,
"onstock": true,
"price": 99.99,
"stock": 100,
"groups": {
"wholesale": {
"active": true,
"onstock": true,
"price": 79.99,
"stock": 1000,
"hideOnLists": false
},
"retail": {
"active": true,
"onstock": true,
"price": 99.99,
"stock": 50
},
"vip": {
"active": true,
"price": 69.99,
"hideOnLists": false
},
"internal": {
"active": false
}
}
}API Request with Group
To use group-specific values, include the GROUP constraint:
{
"searchPhrase": "t-shirt",
"isSearch": true,
"constraints": {
"query.shop_id": "shop1",
"query.language": "de",
"query.group": "wholesale"
}
}Use Cases
B2B Pricing
Different prices for different customer tiers:
{
"id": "product-001",
"price": 99.99,
"groups": {
"wholesale": {"price": 79.99},
"distributor": {"price": 59.99},
"retail": {"price": 99.99}
}
}Group-Specific Visibility
Hide products from certain groups:
{
"id": "product-001",
"active": true,
"groups": {
"consumer": {"active": true},
"b2b_only": {"active": true},
"internal": {"active": false}
}
}Group-Specific Stock
Different stock pools per channel:
{
"id": "product-001",
"stock": 100,
"onstock": true,
"groups": {
"online": {"stock": 50, "onstock": true},
"store_pickup": {"stock": 25, "onstock": true},
"wholesale": {"stock": 500, "onstock": true}
}
}Regional Availability
Products available only in certain regions:
{
"id": "product-001",
"active": true,
"groups": {
"de": {"active": true},
"at": {"active": true},
"ch": {"active": false}
}
}Visibility Filter Logic
When a group is set, visibility filters check both the root field AND the group override:
Logic for active field:
- Check root
activefield - If
groups.<group>.activeexists, it overrides the root value - Product is visible only if the effective
activevalue istrue
Example:
Root: active = true
Group "wholesale": active = false
→ Product is HIDDEN for wholesale customers
Stock Ranking with Groups
When "Out of stock at the end" is enabled in Ranking Mix:
- Makaira checks for
groups.<group>.stock - If exists, uses group-specific stock for ranking
- If not, falls back to root
stockfield
{
"id": "product-001",
"stock": 100,
"groups": {
"wholesale": {"stock": 0}
}
}For wholesale customers, this product would be pushed to the bottom of results (stock = 0).
Custom Group Fields
You can add any custom field as a group override:
{
"id": "product-001",
"delivery_days_int": 3,
"min_order_quantity_int": 1,
"groups": {
"wholesale": {
"delivery_days_int": 1,
"min_order_quantity_int": 10
},
"dropship": {
"delivery_days_int": 5,
"min_order_quantity_int": 1
}
}
}Best Practices
-
Define all groups consistently - Use the same group names across all products.
-
Set defaults at root level - Always provide root field values as fallback.
-
Only override what changes - Don't duplicate values that are the same as root.
-
Document your groups - Maintain a list of group names and their purposes.
-
Test group visibility - Verify that group-specific filtering works as expected.
Limitations
- Group names are case-sensitive
- Group fields must match the type of the root field
- Not all fields support group overrides (check specific documentation)
- Group overrides are only applied when
GROUPconstraint is set
Updated about 14 hours ago
