Branch Management

Branches represent your physical store locations. Each branch serves as a container for multiple sales registers and POS terminals.

Create Branch

Creates a new physical location for the authenticated account.

Endpoint

  • POST /api/pos/branches

Request Payload

FieldTypeRequiredDescription
namestringYesBranch name (max 100 chars)
external_idstringNoExternal system ID (max 100 chars)
addressobjectNoPhysical address
address.streetstringNoStreet address (max 200 chars)
address.citystringNoCity (max 100 chars)
address.statestringNoState (max 100 chars)
address.countrystringNoCountry (default: "Mexico", max 100 chars)
address.postal_codestringNoPostal code (max 20 chars)
address.latitudenumberNoLatitude (-90 to 90)
address.longitudenumberNoLongitude (-180 to 180)
contactobjectNoContact information
contact.emailstringNoContact email (max 255 chars)
contact.phonestringNoContact phone (max 30 chars)
contact.manager_namestringNoManager name (max 100 chars)
operating_hoursobjectNoOperating hours per day
operating_hours.[day]objectNoHours for specific day (monday-sunday)
operating_hours.[day].openstringNoOpening time (HH:MM format)
operating_hours.[day].closestringNoClosing time (HH:MM format)
operating_hours.[day].is_closedbooleanNoWhether closed on this day
timezonestringNoTimezone (default: "America/Mexico_City")
statusstringNoStatus: active, inactive, paused (default: "active")
settingsobjectNoBranch settings
settings.auto_close_registersbooleanNoAuto-close registers at end of day
settings.require_cash_reconciliationbooleanNoRequire cash count on close
settings.default_currencystringNoDefault currency (3 chars, uppercase)
settings.receipt_headerstringNoReceipt header text (max 500 chars)
settings.receipt_footerstringNoReceipt footer text (max 500 chars)
metadataobjectNoCustom metadata

Example Response

{
  "message": "Branch created successfully",
  "data": {
    "_id": "60b7f96f4118eb4370469d19",
    "name": "Downtown Store",
    "status": "active"
  }
}


Get All Branches

Retrieves all branches for the authenticated account.

Endpoint

  • GET /api/pos/branches

Query parameters

ParameterTypeDescription
statusstringFilter by status
citystringFilter by city
statestringFilter by state
pagenumberPage number (default: 1)
limitnumberItems per page (default: 50)

Response

{
  "data": [...],
  "pagination": {
    "total": 10,
    "page": 1,
    "limit": 50,
    "pages": 1
  }
}

Get Branch by ID

Retrieves a specific branch.

Endpoint

GET /api/pos/branches/:id

Response

{
  "data": {
    "_id": "...",
    "name": "Downtown Store",
    ...
  }
}

Update Branch

Updates an existing branch.

Endpoint

PUT /api/pos/branches/:id

Request Payload

Same fields as Create Branch (all optional)

Response

{
  "message": "Branch updated successfully",
  "data": { ... }
}

Delete Branch

Soft-deletes a branch.

Endpoint

DELETE /api/pos/branches/:id

Request Body:

FieldTypeRequiredDescription
forcebooleanNoForce delete even with active registers (default: false)
reasonstringNoDeletion reason (max 500 chars)

Response

{
  "message": "Branch deleted successfully",
  "data": {
    "id": "...",
    "deleted_at": "2025-12-01T..."
  }
}

Restore Branch

Restores a soft-deleted branch.

Endpoint

POST /api/pos/branches/:id/restore

Response

{
  "message": "Branch restored successfully",
  "data": { ... }
}


Check Branch Status

Verifies if a specific branch is currently open based on its configured operating hours.

Endpoint

  • GET /api/pos/branches/:id/status

Query Parameters

  • check_time (String): ISO date to check (defaults to current time).

Response

{
  "data": {
    "is_open": true,
    "branch_name": "Downtown Store",
    "operating_hours": {
      "open": "09:00",
      "close": "21:00",
      "is_closed": false
    },
    "current_time": "14:30",
    "checked_at": "2025-12-01T14:30:00.000Z"
  }
}