# Customer Orders

## List Customer Orders

**get** `/api/v2/public/stores/{store_number}/orders/customerorders`

Customer orders for one store, with their lines when you ask for them. Use it to follow what has been reserved, picked or handed over for a customer.

### Path Parameters

- `store_number: string`

### Query Parameters

- `fulfillment_status: optional string`

  Filter on the fulfillment status of the order.

- `include_locations: optional boolean`

  Include the stock location per line. Only takes effect when store product locations are enabled for your organisation, otherwise the field stays empty.

- `is_active: optional boolean`

  Return only active orders. Set to false to include finished ones.

- `is_picked: optional boolean`

  Filter on whether the order has been picked. Omit for no filtering.

- `order_number: optional string`

  Returns the single order with this order number.

- `page_size: optional number`

  Number of orders per page.

- `page_start: optional number`

  Page number, starting at 1.

- `pickup_offset: optional number`

  Shifts the pickup-date window by this many days.

- `reference: optional string`

  Returns orders carrying this reference.

- `search_text: optional string`

  Case-insensitive search across the order and its customer details.

- `show_lines: optional boolean`

  Include the order lines. Left out, only the order headers are returned.

### Returns

- `page_size: number`

  Maximum number of items returned per page.

- `page_start: number`

  Current page number (1-based).

- `total_count: number`

  Total number of records matching the query across all pages.

- `list: optional array of object { is_active, is_claimed, is_picked, 19 more }`

  Collection of items for the current page.

  - `is_active: boolean`

  - `is_claimed: boolean`

  - `is_picked: boolean`

  - `is_rejected: boolean`

  - `status_id: number`

  - `total_lines: number`

  - `total_quantity: number`

  - `comment: optional string`

  - `customer_name: optional string`

  - `description: optional string`

  - `lines: optional array of object { id, explicit_order, is_picked, 21 more }`

    - `id: number`

    - `explicit_order: boolean`

    - `is_picked: boolean`

    - `is_template: boolean`

    - `line_number: number`

    - `picked_quantity: number`

    - `price: number`

    - `quantity: number`

    - `stock_pool: number`

    - `store_walking_order: number`

    - `barcode: optional string`

    - `delivery_date: optional string`

    - `delivery_qty: optional number`

    - `description: optional string`

    - `moved_quantity: optional number`

    - `next_ordering_datetime: optional string`

    - `picked_username: optional string`

    - `picking_stock_pool_array: optional array of string`

    - `pickup_date: optional string`

    - `preferred_location_code: optional string`

    - `product_number: optional string`

    - `reference: optional string`

    - `stock_location: optional string`

    - `store_locations: optional array of object { location_order, quantity, customer_order_line_number, 16 more }`

      - `location_order: number`

      - `quantity: number`

      - `customer_order_line_number: optional number`

      - `customer_order_number: optional string`

      - `customer_order_shipment_line_number: optional number`

      - `customer_order_shipment_number: optional string`

      - `default_stock_pool: optional string`

      - `location_code: optional string`

      - `most_likely_pool_1: optional number`

      - `most_likely_pool_10: optional number`

      - `most_likely_pool_2: optional number`

      - `most_likely_pool_3: optional number`

      - `most_likely_pool_4: optional number`

      - `most_likely_pool_5: optional number`

      - `most_likely_pool_6: optional number`

      - `most_likely_pool_7: optional number`

      - `most_likely_pool_8: optional number`

      - `most_likely_pool_9: optional number`

      - `tags: optional array of string`

  - `order_number: optional string`

  - `order_type_code: optional string`

  - `order_type_description: optional string`

  - `pickup_date: optional string`

  - `reference: optional string`

  - `rejection_reason_code: optional string`

  - `rejection_reason_code_description: optional string`

  - `sales_order_id: optional string`

  - `store_number: optional string`

  - `stores_allowed: optional string`

  - `total_delivery_quantity: optional number`

- `list_body: optional map[unknown]`

  Additional body-level metadata for the list.

- `list_filters: optional map[array of string]`

  Active filter criteria applied to the result set, keyed by field name.

- `next_page: optional number`

  Next page number, or null when on the last page.

- `previous_page: optional number`

  Previous page number, or null when on the first page.

- `project_last_modified_date: optional string`

  Last modified date/time of the project.

- `scroll_id: optional string`

  Opaque scroll identifier for deep-pagination scenarios.

- `server_time: optional string`

  Server UTC date/time when the response was generated.

- `sort_column: optional string`

  Column name the results are sorted by.

- `sort_order: optional string`

  Sort direction (asc or desc).

- `task_last_modified_date: optional string`

  Last modified date/time of the task.

### Example

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

#### Response

```json
{
  "page_size": 0,
  "page_start": 0,
  "total_count": 0,
  "list": [
    {
      "is_active": true,
      "is_claimed": true,
      "is_picked": true,
      "is_rejected": true,
      "status_id": 0,
      "total_lines": 0,
      "total_quantity": 0,
      "comment": "comment",
      "customer_name": "customer_name",
      "description": "description",
      "lines": [
        {
          "id": 0,
          "explicit_order": true,
          "is_picked": true,
          "is_template": true,
          "line_number": 0,
          "picked_quantity": 0,
          "price": 0,
          "quantity": 0,
          "stock_pool": 0,
          "store_walking_order": 0,
          "barcode": "barcode",
          "delivery_date": "2019-12-27T18:11:19.117Z",
          "delivery_qty": 0,
          "description": "description",
          "moved_quantity": 0,
          "next_ordering_datetime": "2019-12-27T18:11:19.117Z",
          "picked_username": "picked_username",
          "picking_stock_pool_array": [
            "string"
          ],
          "pickup_date": "2019-12-27T18:11:19.117Z",
          "preferred_location_code": "preferred_location_code",
          "product_number": "product_number",
          "reference": "reference",
          "stock_location": "stock_location",
          "store_locations": [
            {
              "location_order": 0,
              "quantity": 0,
              "customer_order_line_number": 0,
              "customer_order_number": "customer_order_number",
              "customer_order_shipment_line_number": 0,
              "customer_order_shipment_number": "customer_order_shipment_number",
              "default_stock_pool": "default_stock_pool",
              "location_code": "location_code",
              "most_likely_pool_1": 0,
              "most_likely_pool_10": 0,
              "most_likely_pool_2": 0,
              "most_likely_pool_3": 0,
              "most_likely_pool_4": 0,
              "most_likely_pool_5": 0,
              "most_likely_pool_6": 0,
              "most_likely_pool_7": 0,
              "most_likely_pool_8": 0,
              "most_likely_pool_9": 0,
              "tags": [
                "string"
              ]
            }
          ]
        }
      ],
      "order_number": "order_number",
      "order_type_code": "order_type_code",
      "order_type_description": "order_type_description",
      "pickup_date": "pickup_date",
      "reference": "reference",
      "rejection_reason_code": "rejection_reason_code",
      "rejection_reason_code_description": "rejection_reason_code_description",
      "sales_order_id": "sales_order_id",
      "store_number": "store_number",
      "stores_allowed": "stores_allowed",
      "total_delivery_quantity": 0
    }
  ],
  "list_body": {
    "foo": "bar"
  },
  "list_filters": {
    "foo": [
      "string"
    ]
  },
  "next_page": 0,
  "previous_page": 0,
  "project_last_modified_date": "project_last_modified_date",
  "scroll_id": "scroll_id",
  "server_time": "server_time",
  "sort_column": "sort_column",
  "sort_order": "sort_order",
  "task_last_modified_date": "task_last_modified_date"
}
```

## Create Customer Orders

**post** `/api/v2/public/stores/{store_number}/orders/customerorders`

Creates customer orders and their lines for one store. Every `product_number` must already exist in the catalogue; an unknown one rejects the whole request. Setting `flush` to true first deletes all existing customer orders and lines for the stores in the request, so only use it when you are sending the complete set.

### Path Parameters

- `store_number: string`

### Query Parameters

- `flush: optional boolean`

  Deletes all existing customer orders for the stores in the request before inserting.

### Body Parameters

- `orders: optional array of object { order_number, customer_city, customer_country, 23 more }`

  - `order_number: string`

  - `customer_city: optional string`

  - `customer_country: optional string`

  - `customer_email: optional string`

  - `customer_name: optional string`

  - `customer_number: optional string`

  - `customer_phone: optional string`

  - `customer_street: optional string`

  - `customer_zipcode: optional string`

  - `delivery_city: optional string`

  - `delivery_country: optional string`

  - `delivery_street: optional string`

  - `delivery_zipcode: optional string`

  - `description: optional string`

  - `file_name: optional string`

  - `is_active: optional boolean`

  - `is_picked: optional boolean`

  - `is_rejected: optional boolean`

  - `order_comment: optional string`

  - `order_lines: optional array of object { line_number, product_number, quantity, 14 more }`

    - `line_number: number`

    - `product_number: string`

    - `quantity: number`

    - `barcode: optional string`

    - `delivery_date: optional string`

    - `description: optional string`

    - `full_fillment_status: optional string`

    - `is_picked: optional boolean`

    - `is_picked_from_warehouse: optional boolean`

    - `ordering_datetime: optional string`

    - `picked_quantity: optional number`

    - `picking_stock_pool_array: optional array of string`

    - `pickup_date: optional string`

    - `preferred_location_code: optional string`

    - `price: optional number`

    - `reference: optional string`

    - `stock_pool: optional number`

  - `order_type: optional string`

  - `order_type_code: optional string`

  - `order_type_description: optional string`

  - `reference: optional string`

  - `sales_order_id: optional string`

  - `status_id: optional number`

### 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/$STORE_NUMBER/orders/customerorders \
    -X POST \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

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

## Create Multi Store Customer Orders

**post** `/api/v2/public/orders/customerorders`

Same as the single-store customer order endpoint, but each order names its own store, so one call can cover several stores. `flush` deletes existing customer orders for every store named in the request.

### Query Parameters

- `flush: optional boolean`

  Deletes all existing customer orders for the stores in the request before inserting.

### Body Parameters

- `orders: optional array of object { order_number, customer_city, customer_country, 19 more }`

  - `order_number: string`

  - `customer_city: optional string`

  - `customer_country: optional string`

  - `customer_email: optional string`

  - `customer_name: optional string`

  - `customer_number: optional string`

  - `customer_phone: optional string`

  - `customer_street: optional string`

  - `customer_zipcode: optional string`

  - `delivery_city: optional string`

  - `delivery_country: optional string`

  - `delivery_street: optional string`

  - `delivery_zipcode: optional string`

  - `description: optional string`

  - `is_picked: optional boolean`

  - `order_comment: optional string`

  - `order_lines: optional array of object { line_number, product_number, quantity, 10 more }`

    - `line_number: number`

    - `product_number: string`

    - `quantity: number`

    - `barcode: optional string`

    - `delivery_date: optional string`

    - `description: optional string`

    - `is_picked: optional boolean`

    - `is_picked_from_warehouse: optional boolean`

    - `ordering_datetime: optional string`

    - `picked_quantity: optional number`

    - `pickup_date: optional string`

    - `price: optional number`

    - `stock_pool: optional number`

  - `order_type_code: optional string`

  - `order_type_description: optional string`

  - `reference: optional string`

  - `store_number: optional string`

  - `stores_allowed: optional array of string`

### 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/orders/customerorders \
    -X POST \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

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

## Update Customer Order

**put** `/api/v2/public/stores/{store_number}/orders/customerorder`

Updates an existing customer order and its lines in one store. Use it to change quantities or status after the order was created, rather than deleting and recreating it.

### Path Parameters

- `store_number: string`

### Body Parameters

- `orders: optional object { order_number, is_active, is_claimed, 5 more }`

  - `order_number: string`

  - `is_active: optional boolean`

  - `is_claimed: optional boolean`

  - `is_picked: optional boolean`

  - `is_rejected: optional boolean`

  - `order_lines: optional array of object { line_number, product_number, barcode, 11 more }`

    - `line_number: number`

    - `product_number: string`

    - `barcode: optional string`

    - `delivery_date: optional string`

    - `description: optional string`

    - `is_picked: optional boolean`

    - `is_picked_from_warehouse: optional boolean`

    - `ordering_datetime: optional string`

    - `picked_quantity: optional number`

    - `pickup_date: optional string`

    - `preferred_location_code: optional string`

    - `price: optional number`

    - `quantity: optional number`

    - `stock_pool: optional number`

  - `rejection_reason_code: optional string`

  - `rejection_reason_code_description: optional string`

### 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/$STORE_NUMBER/orders/customerorder \
    -X PUT \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

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

## Create Customer Order Clearance

**post** `/api/v2/public/customerorders/clearance`

Creates movement assignments to clear warehouse stock held for customer orders, so the goods can be moved out to the shop floor. `location_code_tag` selects which locations are cleared, and `category_codes` narrows it to specific product categories.

### Query Parameters

- `location_code_tag: string`

  Tag identifying the locations to clear.

### Body Parameters

- `category_codes: optional array of string`

  Restricts the clearance to these product categories. Leave empty to clear every category.

### 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/customerorders/clearance \
    -H 'Content-Type: application/json' \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN" \
    -d '{}'
```

#### Response

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

## Domain Types

### Customer Order List Customer Orders Response

- `CustomerOrderListCustomerOrdersResponse object { is_active, is_claimed, is_picked, 19 more }`

  Properties

  - `is_active: boolean`

  - `is_claimed: boolean`

  - `is_picked: boolean`

  - `is_rejected: boolean`

  - `status_id: number`

  - `total_lines: number`

  - `total_quantity: number`

  - `comment: optional string`

  - `customer_name: optional string`

  - `description: optional string`

  - `lines: optional array of object { id, explicit_order, is_picked, 21 more }`

    - `id: number`

    - `explicit_order: boolean`

    - `is_picked: boolean`

    - `is_template: boolean`

    - `line_number: number`

    - `picked_quantity: number`

    - `price: number`

    - `quantity: number`

    - `stock_pool: number`

    - `store_walking_order: number`

    - `barcode: optional string`

    - `delivery_date: optional string`

    - `delivery_qty: optional number`

    - `description: optional string`

    - `moved_quantity: optional number`

    - `next_ordering_datetime: optional string`

    - `picked_username: optional string`

    - `picking_stock_pool_array: optional array of string`

    - `pickup_date: optional string`

    - `preferred_location_code: optional string`

    - `product_number: optional string`

    - `reference: optional string`

    - `stock_location: optional string`

    - `store_locations: optional array of object { location_order, quantity, customer_order_line_number, 16 more }`

      - `location_order: number`

      - `quantity: number`

      - `customer_order_line_number: optional number`

      - `customer_order_number: optional string`

      - `customer_order_shipment_line_number: optional number`

      - `customer_order_shipment_number: optional string`

      - `default_stock_pool: optional string`

      - `location_code: optional string`

      - `most_likely_pool_1: optional number`

      - `most_likely_pool_10: optional number`

      - `most_likely_pool_2: optional number`

      - `most_likely_pool_3: optional number`

      - `most_likely_pool_4: optional number`

      - `most_likely_pool_5: optional number`

      - `most_likely_pool_6: optional number`

      - `most_likely_pool_7: optional number`

      - `most_likely_pool_8: optional number`

      - `most_likely_pool_9: optional number`

      - `tags: optional array of string`

  - `order_number: optional string`

  - `order_type_code: optional string`

  - `order_type_description: optional string`

  - `pickup_date: optional string`

  - `reference: optional string`

  - `rejection_reason_code: optional string`

  - `rejection_reason_code_description: optional string`

  - `sales_order_id: optional string`

  - `store_number: optional string`

  - `stores_allowed: optional string`

  - `total_delivery_quantity: optional number`

### Customer Order Create Customer Orders Response

- `CustomerOrderCreateCustomerOrdersResponse object { success, data, message }`

  Standard success response returned by mutation endpoints.

  - `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.

### Customer Order Create Multi Store Customer Orders Response

- `CustomerOrderCreateMultiStoreCustomerOrdersResponse object { success, data, message }`

  Standard success response returned by mutation endpoints.

  - `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.

### Customer Order Update Customer Order Response

- `CustomerOrderUpdateCustomerOrderResponse object { success, data, message }`

  Standard success response returned by mutation endpoints.

  - `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.

### Customer Order Create Customer Order Clearance Response

- `CustomerOrderCreateCustomerOrderClearanceResponse object { success, data, message }`

  Standard success response returned by mutation endpoints.

  - `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.
