Updates To Item Response
Overview
This update introduces improvements to how item details are returned, specifically concerning branch-level configurations.
❗ WARNING: This is a BREAKING CHANGE.
The response for fetching items has been modified. The previous inactive_in_branches
attribute has been removed and replaced with a branch_customizations
array of objects.
Before (Old Response Structure)
Previously, the response specified which branches the item was inactive in using a simple list of IDs.
{
"success": true,
"item": {
"id": 1,
"name_en": "item name",
"price": 120,
"inactive_in_branch_ids": [2, 3]
}
}
After (New Response Structure)
The new response specifies a new branch_customizations
attribute provides richer, per-branch information.
{
"success": true,
"item": {
"id": 1,
"name_en": "item name",
"price": 120,
"branch_customizations": [
{
"branch_id": 3,
"is_active": true,
"price": 31.0
},
{
"branch_id": 2,
"is_active": false,
"price": null
}
]
}
}
Reason for the Change
This change was implemented to support more complex business requirements and give you more power over your items. The old model could only specify where an item was inactive. The new branch_customizations
structure allows for nuanced, branch-by-branch rules, including:
- Branch-Specific Pricing: Set a unique price for an item in a specific branch.
- Explicit Status: Clearly define if an item is active or inactive in a branch, which is more explicit than the previous "inactive-only" list.
- Future Extensibility: This object-based model allows us to easily add more branch-specific attributes in the future without introducing more breaking changes.