Branch Creation
Overview
A branch is a sub-account created by a store user. Each branch has its own independent user account and can perform operations such as creating payment orders and managing it own margins. The store that creates a branch is its owner.
When a branch is created, three things happen simultaneously:
- A new branch entity is registered in the system
- A new user is created using the provided email address
- A new account under this new user is created
⚠️ This user represents the branch and operates independently — it has its own credentials and access token, separate from the store that created it.
Endpoint
POST /branch
Full API reference: Branch Creation
Authentication
This endpoint requires a valid Bearer Token issued to a user with the store role.
Authorization: Bearer <your_access_token>
Requests from users without the store role will be rejected.
See the Authentication Guide for details on obtaining a token.
Request Example
curl -X POST "/api/v1/branch" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"name": "Branch 1",
"email": "branch@example.com"
}'
Behavior
When this endpoint is called successfully:
- A new branch entity is created and associated with the calling store account
- A new user account is automatically generated using the provided
email - This user account represents the branch within the system and will be used for all branch-level operations
Next Steps
After the branch is created, the branch user must complete the authentication process independently before making any API requests.
- The branch user follows the Authentication Guide
- Upon successful authentication, the branch user receives their own access token
- All subsequent requests made by the branch must use that token — not the store's token
Important Notes
- Only users with the
storerole can call this endpoint - Each branch operates independently with its own credentials and session
- Access tokens are not shared between store and branch users