# Customer Orders

## List Customer Orders

`customer_orders.list_customer_orders(strstore_number, CustomerOrderListCustomerOrdersParams**kwargs)  -> SyncCursorPage[CustomerOrderListCustomerOrdersResponse]`

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

### Parameters

- `store_number: str`

- `fulfillment_status: Optional[str]`

  Filter on the fulfillment status of the order.

- `include_locations: Optional[bool]`

  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[bool]`

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

- `is_picked: Optional[bool]`

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

- `order_number: Optional[str]`

  Returns the single order with this order number.

- `page_size: Optional[int]`

  Number of orders per page.

- `page_start: Optional[int]`

  Page number, starting at 1.

- `pickup_offset: Optional[int]`

  Shifts the pickup-date window by this many days.

- `reference: Optional[str]`

  Returns orders carrying this reference.

- `search_text: Optional[str]`

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

- `show_lines: Optional[bool]`

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

### Returns

- `class CustomerOrderListCustomerOrdersResponse: …`

  Properties

  - `is_active: bool`

  - `is_claimed: bool`

  - `is_picked: bool`

  - `is_rejected: bool`

  - `status_id: int`

  - `total_lines: int`

  - `total_quantity: float`

  - `comment: Optional[str]`

  - `customer_name: Optional[str]`

  - `description: Optional[str]`

  - `lines: Optional[List[Line]]`

    - `id: int`

    - `explicit_order: bool`

    - `is_picked: bool`

    - `is_template: bool`

    - `line_number: int`

    - `picked_quantity: float`

    - `price: float`

    - `quantity: float`

    - `stock_pool: int`

    - `store_walking_order: int`

    - `barcode: Optional[str]`

    - `delivery_date: Optional[datetime]`

    - `delivery_qty: Optional[float]`

    - `description: Optional[str]`

    - `moved_quantity: Optional[float]`

    - `next_ordering_datetime: Optional[datetime]`

    - `picked_username: Optional[str]`

    - `picking_stock_pool_array: Optional[List[str]]`

    - `pickup_date: Optional[datetime]`

    - `preferred_location_code: Optional[str]`

    - `product_number: Optional[str]`

    - `reference: Optional[str]`

    - `stock_location: Optional[str]`

    - `store_locations: Optional[List[LineStoreLocation]]`

      - `location_order: int`

      - `quantity: float`

      - `customer_order_line_number: Optional[int]`

      - `customer_order_number: Optional[str]`

      - `customer_order_shipment_line_number: Optional[int]`

      - `customer_order_shipment_number: Optional[str]`

      - `default_stock_pool: Optional[str]`

      - `location_code: Optional[str]`

      - `most_likely_pool_1: Optional[float]`

      - `most_likely_pool_10: Optional[float]`

      - `most_likely_pool_2: Optional[float]`

      - `most_likely_pool_3: Optional[float]`

      - `most_likely_pool_4: Optional[float]`

      - `most_likely_pool_5: Optional[float]`

      - `most_likely_pool_6: Optional[float]`

      - `most_likely_pool_7: Optional[float]`

      - `most_likely_pool_8: Optional[float]`

      - `most_likely_pool_9: Optional[float]`

      - `tags: Optional[List[str]]`

  - `order_number: Optional[str]`

  - `order_type_code: Optional[str]`

  - `order_type_description: Optional[str]`

  - `pickup_date: Optional[str]`

  - `reference: Optional[str]`

  - `rejection_reason_code: Optional[str]`

  - `rejection_reason_code_description: Optional[str]`

  - `sales_order_id: Optional[str]`

  - `store_number: Optional[str]`

  - `stores_allowed: Optional[str]`

  - `total_delivery_quantity: Optional[float]`

### Example

```python
import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
page = client.customer_orders.list_customer_orders(
    store_number="store_number",
)
page = page.list[0]
print(page.status_id)
```

#### 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

`customer_orders.create_customer_orders(strstore_number, CustomerOrderCreateCustomerOrdersParams**kwargs)  -> CustomerOrderCreateCustomerOrdersResponse`

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

### Parameters

- `store_number: str`

- `flush: Optional[bool]`

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

- `orders: Optional[Iterable[Order]]`

  - `order_number: str`

  - `customer_city: Optional[str]`

  - `customer_country: Optional[str]`

  - `customer_email: Optional[str]`

  - `customer_name: Optional[str]`

  - `customer_number: Optional[str]`

  - `customer_phone: Optional[str]`

  - `customer_street: Optional[str]`

  - `customer_zipcode: Optional[str]`

  - `delivery_city: Optional[str]`

  - `delivery_country: Optional[str]`

  - `delivery_street: Optional[str]`

  - `delivery_zipcode: Optional[str]`

  - `description: Optional[str]`

  - `file_name: Optional[str]`

  - `is_active: Optional[bool]`

  - `is_picked: Optional[bool]`

  - `is_rejected: Optional[bool]`

  - `order_comment: Optional[str]`

  - `order_lines: Optional[Iterable[OrderOrderLine]]`

    - `line_number: int`

    - `product_number: str`

    - `quantity: float`

    - `barcode: Optional[str]`

    - `delivery_date: Optional[Union[str, datetime]]`

    - `description: Optional[str]`

    - `full_fillment_status: Optional[str]`

    - `is_picked: Optional[bool]`

    - `is_picked_from_warehouse: Optional[bool]`

    - `ordering_datetime: Optional[Union[str, datetime]]`

    - `picked_quantity: Optional[float]`

    - `picking_stock_pool_array: Optional[Sequence[str]]`

    - `pickup_date: Optional[Union[str, datetime, null]]`

    - `preferred_location_code: Optional[str]`

    - `price: Optional[float]`

    - `reference: Optional[str]`

    - `stock_pool: Optional[int]`

  - `order_type: Optional[str]`

  - `order_type_code: Optional[str]`

  - `order_type_description: Optional[str]`

  - `reference: Optional[str]`

  - `sales_order_id: Optional[str]`

  - `status_id: Optional[int]`

### Returns

- `class CustomerOrderCreateCustomerOrdersResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Example

```python
import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.customer_orders.create_customer_orders(
    store_number="store_number",
)
print(response.success)
```

#### Response

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

## Create Multi Store Customer Orders

`customer_orders.create_multi_store_customer_orders(CustomerOrderCreateMultiStoreCustomerOrdersParams**kwargs)  -> CustomerOrderCreateMultiStoreCustomerOrdersResponse`

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

### Parameters

- `flush: Optional[bool]`

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

- `orders: Optional[Iterable[Order]]`

  - `order_number: str`

  - `customer_city: Optional[str]`

  - `customer_country: Optional[str]`

  - `customer_email: Optional[str]`

  - `customer_name: Optional[str]`

  - `customer_number: Optional[str]`

  - `customer_phone: Optional[str]`

  - `customer_street: Optional[str]`

  - `customer_zipcode: Optional[str]`

  - `delivery_city: Optional[str]`

  - `delivery_country: Optional[str]`

  - `delivery_street: Optional[str]`

  - `delivery_zipcode: Optional[str]`

  - `description: Optional[str]`

  - `is_picked: Optional[bool]`

  - `order_comment: Optional[str]`

  - `order_lines: Optional[Iterable[OrderOrderLine]]`

    - `line_number: int`

    - `product_number: str`

    - `quantity: float`

    - `barcode: Optional[str]`

    - `delivery_date: Optional[Union[str, datetime]]`

    - `description: Optional[str]`

    - `is_picked: Optional[bool]`

    - `is_picked_from_warehouse: Optional[bool]`

    - `ordering_datetime: Optional[Union[str, datetime]]`

    - `picked_quantity: Optional[float]`

    - `pickup_date: Optional[Union[str, datetime]]`

    - `price: Optional[float]`

    - `stock_pool: Optional[int]`

  - `order_type_code: Optional[str]`

  - `order_type_description: Optional[str]`

  - `reference: Optional[str]`

  - `store_number: Optional[str]`

  - `stores_allowed: Optional[Sequence[str]]`

### Returns

- `class CustomerOrderCreateMultiStoreCustomerOrdersResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Example

```python
import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.customer_orders.create_multi_store_customer_orders()
print(response.success)
```

#### Response

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

## Update Customer Order

`customer_orders.update_customer_order(strstore_number, CustomerOrderUpdateCustomerOrderParams**kwargs)  -> CustomerOrderUpdateCustomerOrderResponse`

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

### Parameters

- `store_number: str`

- `orders: Optional[Orders]`

  - `order_number: str`

  - `is_active: Optional[bool]`

  - `is_claimed: Optional[bool]`

  - `is_picked: Optional[bool]`

  - `is_rejected: Optional[bool]`

  - `order_lines: Optional[Iterable[OrdersOrderLine]]`

    - `line_number: int`

    - `product_number: str`

    - `barcode: Optional[str]`

    - `delivery_date: Optional[Union[str, datetime, null]]`

    - `description: Optional[str]`

    - `is_picked: Optional[bool]`

    - `is_picked_from_warehouse: Optional[bool]`

    - `ordering_datetime: Optional[Union[str, datetime, null]]`

    - `picked_quantity: Optional[float]`

    - `pickup_date: Optional[Union[str, datetime, null]]`

    - `preferred_location_code: Optional[str]`

    - `price: Optional[float]`

    - `quantity: Optional[float]`

    - `stock_pool: Optional[int]`

  - `rejection_reason_code: Optional[str]`

  - `rejection_reason_code_description: Optional[str]`

### Returns

- `class CustomerOrderUpdateCustomerOrderResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Example

```python
import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.customer_orders.update_customer_order(
    store_number="store_number",
)
print(response.success)
```

#### Response

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

## Create Customer Order Clearance

`customer_orders.create_customer_order_clearance(CustomerOrderCreateCustomerOrderClearanceParams**kwargs)  -> CustomerOrderCreateCustomerOrderClearanceResponse`

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

### Parameters

- `location_code_tag: str`

  Tag identifying the locations to clear.

- `category_codes: Optional[Sequence[str]]`

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

### Returns

- `class CustomerOrderCreateCustomerOrderClearanceResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Example

```python
import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.customer_orders.create_customer_order_clearance(
    location_code_tag="location_code_tag",
)
print(response.success)
```

#### Response

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

## Domain Types

### Customer Order List Customer Orders Response

- `class CustomerOrderListCustomerOrdersResponse: …`

  Properties

  - `is_active: bool`

  - `is_claimed: bool`

  - `is_picked: bool`

  - `is_rejected: bool`

  - `status_id: int`

  - `total_lines: int`

  - `total_quantity: float`

  - `comment: Optional[str]`

  - `customer_name: Optional[str]`

  - `description: Optional[str]`

  - `lines: Optional[List[Line]]`

    - `id: int`

    - `explicit_order: bool`

    - `is_picked: bool`

    - `is_template: bool`

    - `line_number: int`

    - `picked_quantity: float`

    - `price: float`

    - `quantity: float`

    - `stock_pool: int`

    - `store_walking_order: int`

    - `barcode: Optional[str]`

    - `delivery_date: Optional[datetime]`

    - `delivery_qty: Optional[float]`

    - `description: Optional[str]`

    - `moved_quantity: Optional[float]`

    - `next_ordering_datetime: Optional[datetime]`

    - `picked_username: Optional[str]`

    - `picking_stock_pool_array: Optional[List[str]]`

    - `pickup_date: Optional[datetime]`

    - `preferred_location_code: Optional[str]`

    - `product_number: Optional[str]`

    - `reference: Optional[str]`

    - `stock_location: Optional[str]`

    - `store_locations: Optional[List[LineStoreLocation]]`

      - `location_order: int`

      - `quantity: float`

      - `customer_order_line_number: Optional[int]`

      - `customer_order_number: Optional[str]`

      - `customer_order_shipment_line_number: Optional[int]`

      - `customer_order_shipment_number: Optional[str]`

      - `default_stock_pool: Optional[str]`

      - `location_code: Optional[str]`

      - `most_likely_pool_1: Optional[float]`

      - `most_likely_pool_10: Optional[float]`

      - `most_likely_pool_2: Optional[float]`

      - `most_likely_pool_3: Optional[float]`

      - `most_likely_pool_4: Optional[float]`

      - `most_likely_pool_5: Optional[float]`

      - `most_likely_pool_6: Optional[float]`

      - `most_likely_pool_7: Optional[float]`

      - `most_likely_pool_8: Optional[float]`

      - `most_likely_pool_9: Optional[float]`

      - `tags: Optional[List[str]]`

  - `order_number: Optional[str]`

  - `order_type_code: Optional[str]`

  - `order_type_description: Optional[str]`

  - `pickup_date: Optional[str]`

  - `reference: Optional[str]`

  - `rejection_reason_code: Optional[str]`

  - `rejection_reason_code_description: Optional[str]`

  - `sales_order_id: Optional[str]`

  - `store_number: Optional[str]`

  - `stores_allowed: Optional[str]`

  - `total_delivery_quantity: Optional[float]`

### Customer Order Create Customer Orders Response

- `class CustomerOrderCreateCustomerOrdersResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Customer Order Create Multi Store Customer Orders Response

- `class CustomerOrderCreateMultiStoreCustomerOrdersResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Customer Order Update Customer Order Response

- `class CustomerOrderUpdateCustomerOrderResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.

### Customer Order Create Customer Order Clearance Response

- `class CustomerOrderCreateCustomerOrderClearanceResponse: …`

  Standard success response returned by mutation endpoints.

  - `success: bool`

    Indicates whether the operation completed successfully.

  - `data: Optional[str]`

    Optional data payload returned by the operation.

  - `message: Optional[str]`

    Human-readable message describing the result.
