## Creates or updates stores.

**post** `/api/v2/public/stores`

Creates or updates stores in bulk. When `flush` is true, removes existing stores before inserting.

### Query Parameters

- `flush: optional boolean`

  When true, removes existing stores before inserting.

### Body Parameters

- `stores: optional array of object { is_active, is_active_data_exchange, is_warehouse, 39 more }`

  The list of stores to create or update.

  - `is_active: boolean`

    Whether the store is active.

  - `is_active_data_exchange: boolean`

    Whether data exchange is active for this store.

  - `is_warehouse: boolean`

    Whether the store is a warehouse.

  - `store_name: string`

    Display name of the store.

  - `store_number: string`

    Unique store number identifier.

  - `address: optional string`

    Street address of the store.

  - `area_description: optional string`

    Description of the area.

  - `area_id: optional string`

    Area identifier the store belongs to.

  - `area_manager_user_id: optional number`

    User identifier of the area manager assigned to the store.

  - `city: optional string`

    City of the store.

  - `contact_details: optional string`

    Free-form contact details for the store.

  - `cost_center: optional string`

    Cost center associated with the store.

  - `country_code: optional string`

    ISO country code.

  - `country_name: optional string`

    Country name.

  - `esl_server_path: optional string`

    Path to the ESL server.

  - `free_fields: optional array of object { sort_order, key, value }`

    Custom free-field key/value pairs.

    - `sort_order: number`

      Sort order for display purposes.

    - `key: optional string`

      Free-field key.

    - `value: optional string`

      Free-field value.

  - `invent_location: optional string`

    Inventory location associated with the store.

  - `ip_range_begin: optional string`

    Start of the store's IP range.

  - `ip_range_end: optional string`

    End of the store's IP range.

  - `legal_entity: optional string`

    Legal entity associated with the store.

  - `local_server_path: optional string`

    Path to the local server.

  - `opening_hours: optional array of object { sort_order, key, value }`

    Opening hours for the store, as key/value pairs (e.g. day → 09:00-18:00).

    - `sort_order: number`

      Sort order for display purposes.

    - `key: optional string`

      Free-field key.

    - `value: optional string`

      Free-field value.

  - `ordering_schema: optional array of object { day, delivery_offset, ordering_offset, 3 more }`

    Ordering and delivery calendar entries for the store.

    - `day: number`

      Day of the week (1=Monday, 7=Sunday).

    - `delivery_offset: number`

      Delivery offset in days.

    - `ordering_offset: number`

      Ordering offset in days.

    - `time: string`

      Time of day for the calendar entry.

    - `category_code: optional string`

      Optional category code this calendar entry applies to.

    - `week_numbers: optional string`

      Comma-separated week numbers when this entry applies.

  - `phone_number: optional string`

    Contact phone number of the store.

  - `postal_code: optional string`

    Postal code of the store.

  - `price_line_id: optional number`

    Identifier of the price line applied to the store.

  - `store_gln: optional string`

    Global Location Number (GLN) of the store.

  - `store_next_delivery_datetime: optional string`

    Next scheduled delivery datetime for the store.

  - `store_next_ordering_datetime: optional string`

    Next scheduled ordering datetime for the store.

  - `store_printers: optional array of object { is_bluetooth, printer_type, printer_ip, 3 more }`

    Printers configured at the store.

    - `is_bluetooth: boolean`

      Whether the printer connects via Bluetooth.

    - `printer_type: number`

      Numeric printer type identifier.

    - `printer_ip: optional string`

      IP address of the printer.

    - `printer_name: optional string`

      Display name of the printer.

    - `printer_serial: optional string`

      Serial number of the printer.

    - `vendor: optional string`

      Vendor / manufacturer of the printer.

  - `store_stock_pool_1: optional string`

    Name of stock pool 1.

  - `store_stock_pool_10: optional string`

    Name of stock pool 10.

  - `store_stock_pool_2: optional string`

    Name of stock pool 2.

  - `store_stock_pool_3: optional string`

    Name of stock pool 3.

  - `store_stock_pool_4: optional string`

    Name of stock pool 4.

  - `store_stock_pool_5: optional string`

    Name of stock pool 5.

  - `store_stock_pool_6: optional string`

    Name of stock pool 6.

  - `store_stock_pool_7: optional string`

    Name of stock pool 7.

  - `store_stock_pool_8: optional string`

    Name of stock pool 8.

  - `store_stock_pool_9: optional string`

    Name of stock pool 9.

  - `store_type_code: optional string`

    Code identifying the store type.

  - `store_type_description: optional string`

    Description of the store type.

### Returns

- `success: boolean`

  Indicates whether the operation completed successfully.

- `data: optional string`

  Optional data payload returned by the operation.

- `message: optional string`

  Human-readable message describing the result.

### Example

```http
curl https://api.colleqtive.net/api/v2/public/stores \
    -X POST \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

```json
{
  "success": true,
  "data": "data",
  "message": "message"
}
```
