Branches represent physical store locations for a merchant. Each branch can have its own POS terminals and payment settings.
Create Branch
Requires a valid Bearer token in the Authorization header.
Request Body
Branch display name (e.g., Colombo Main Store).
Physical address of the branch.
City where the branch is located.
Branch contact phone number.
Example Request
{
"name": "Colombo Main Store",
"address": "123 Galle Road, Colombo 03",
"city": "Colombo",
"phone": "+94112345678"
}
Example Response (201)
{
"id": "branch_abc123",
"merchantId": "merch_abc123",
"name": "Colombo Main Store",
"address": "123 Galle Road, Colombo 03",
"city": "Colombo",
"phone": "+94112345678",
"status": "active",
"createdAt": "2026-03-26T10:00:00Z"
}
List Branches
Returns all branches for the authenticated merchant.
Query Parameters
Items per page (max 100).
Example Response (200)
{
"data": [
{
"id": "branch_abc123",
"name": "Colombo Main Store",
"address": "123 Galle Road, Colombo 03",
"city": "Colombo",
"status": "active",
"createdAt": "2026-03-26T10:00:00Z"
},
{
"id": "branch_def456",
"name": "Kandy Branch",
"address": "45 Peradeniya Road, Kandy",
"city": "Kandy",
"status": "active",
"createdAt": "2026-03-20T14:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2,
"totalPages": 1
}
}
Get Branch
Path Parameters
The branch identifier (e.g., branch_abc123).
Example Response (200)
{
"id": "branch_abc123",
"merchantId": "merch_abc123",
"name": "Colombo Main Store",
"address": "123 Galle Road, Colombo 03",
"city": "Colombo",
"phone": "+94112345678",
"status": "active",
"createdAt": "2026-03-26T10:00:00Z",
"updatedAt": "2026-03-26T10:00:00Z"
}
Delete Branch
Permanently deletes a branch. Active POS terminals associated with the branch will be deactivated.
Path Parameters
The branch identifier (e.g., branch_abc123).
Example Response (200)
{
"message": "Branch deleted successfully"
}
Error Responses
{
"error": {
"code": "NOT_FOUND",
"message": "Branch not found"
}
}