> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create branch

> Create a new branch to organize your products by location.

<ParamField path="app_id" type="string" required>
  Your store ID in Jelou Shop.
</ParamField>

<ParamField body="name" type="string" required>
  Branch name (max. 255 characters).
</ParamField>

<ParamField body="code" type="string" required>
  Unique branch code within the store (max. 255 characters).
</ParamField>

<ParamField body="address" type="string">
  Branch address (max. 255 characters).
</ParamField>

<ParamField body="phone" type="string">
  Branch phone number (max. 255 characters).
</ParamField>

<ParamField body="status" type="boolean" default="true">
  Branch status (active/inactive).
</ParamField>

<ParamField body="properties" type="object">
  JSON object with custom branch properties. You can include any of your own keys; the `language` key is validated.

  <Expandable title="Reserved properties">
    <ParamField body="language" type="string">
      Branch language. Validated field: only accepts `es`, `en`, or `pt`. Any other value returns a validation error.
    </ParamField>
  </Expandable>
</ParamField>

<Note>
  The `code` must be unique per store. If you try to create two branches with the same code in the same store, you will receive a validation error.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://gateway.jelou.ai/ecommerce/v2/apps/{app_id}/branches" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Downtown Branch",
      "code": "BRANCH-DOWNTOWN",
      "address": "123 Main Ave, Quito",
      "phone": "+593991234567",
      "status": true,
      "properties": {
        "schedule": "09:00 - 18:00",
        "zone": "north"
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "id": "9e3f2c1a-8b7d-4e6f-a5c4-d3b2a1e0f9c8",
      "name": "Downtown Branch",
      "code": "BRANCH-DOWNTOWN",
      "address": "123 Main Ave, Quito",
      "phone": "+593991234567",
      "status": true,
      "properties": {
        "schedule": "09:00 - 18:00",
        "zone": "north"
      },
      "created_at": "2026-02-19T15:30:00.000000Z",
      "updated_at": "2026-02-19T15:30:00.000000Z"
    }
  }
  ```
</ResponseExample>

<Tip>
  **Batch operations:** you can manage multiple branches in a single call using the `/ecommerce/v2/apps/{app_id}/branches/batch` endpoint:

  * `POST` — create multiple branches with a `{ "resources": [ { ... }, { ... } ] }` body.
  * `PATCH` — update multiple branches with `{ "resources": { "<branch_id>": { ... } } }`.
  * `DELETE` — delete multiple branches with `{ "resources": ["<branch_id>", "<branch_id>"] }`.

  The batch response returns the affected branches inside `data`.
</Tip>
