Branches

Branches represent the physical locations or operational hubs from which your business operates. Effective branch management is key to organizing your teams, fleets, and daily tasks. This guide will walk you through how to manage your branches within the system.

🔗 Click here to know more about branches.

Create Branch

Note: Ensure the branch IDs are unique and coordinates are accurate for proper geolocation services.

Parameters

branch
dictionary
POST/v1/branches
curl https://api.lynxo.ai/v1/branches \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR....." \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"branch":{"name":"Jeddah","id":"BR005","active":true,"coordinates":{"latitude":"28.234511","longitude":"39.1234567"},"contacts":[{"name":"Thaha","phone":"+966555555555","work_timings":[{"from":"09:00 AM","to":"05:00 PM"}]}],"geofence":{"type":"Polygon","coordinates":[[[39.168575095,21.587069614],[39.168575095,21.578751394],[39.187253243,21.578751394],[39.187253243,21.587069614],[39.168575095,21.587069614]]]}}}'
RESPONSE
{
  "id": "66a22021-0431-4ed4-a809-ebc4ca57a2db",
  "branch": {
    "name": "Jeddah",
    "id": "BR005",
    "time_zone": "Asia/Riyadh",
    "active": true,
    "coordinates": {
      "latitude": "28.234511",
      "longitude": "39.1234567"
    },
    "contacts": [
      {
        "name": "Thaha",
        "id": "contact_12345"
      }
    ],
    "geofence": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            39.168575095,
            21.587069614
          ],
          [
            39.168575095,
            21.578751394
          ],
          [
            39.187253243,
            21.578751394
          ],
          [
            39.187253243,
            21.587069614
          ],
          [
            39.168575095,
            21.587069614
          ]
        ]
      ]
    }
  },
  "created_at": "2024-01-17T12:00:00Z",
  "updated_at": "2024-01-17T12:00:00Z"
}