# Customer Orders

## List Customer Orders

`CustomerOrderListCustomerOrdersPageResponse CustomerOrders.ListCustomerOrders(CustomerOrderListCustomerOrdersParamsparameters, CancellationTokencancellationToken = default)`

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

- `CustomerOrderListCustomerOrdersParams parameters`

  - `required string storeNumber`

    The store the orders belong to.

  - `string fulfillmentStatus`

    Filter on the fulfillment status of the order.

  - `Boolean includeLocations`

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

  - `Boolean isActive`

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

  - `Boolean isPicked`

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

  - `string orderNumber`

    Returns the single order with this order number.

  - `Int pageSize`

    Number of orders per page.

  - `Int pageStart`

    Page number, starting at 1.

  - `Int pickupOffset`

    Shifts the pickup-date window by this many days.

  - `string reference`

    Returns orders carrying this reference.

  - `string searchText`

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

  - `Boolean showLines`

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

### Returns

- `class CustomerOrderListCustomerOrdersPageResponse:`

  Generic paginated response wrapper.

  - `required Int PageSize`

    Maximum number of items returned per page.

  - `required Int PageStart`

    Current page number (1-based).

  - `required Long TotalCount`

    Total number of records matching the query across all pages.

  - `IReadOnlyList<CustomerOrderListCustomerOrdersResponse>? List`

    Collection of items for the current page.

    - `required Boolean IsActive`

    - `required Boolean IsClaimed`

    - `required Boolean IsPicked`

    - `required Boolean IsRejected`

    - `required Int StatusID`

    - `required Int TotalLines`

    - `required Double TotalQuantity`

    - `string? Comment`

    - `string? CustomerName`

    - `string? Description`

    - `IReadOnlyList<Line>? Lines`

      - `required Long ID`

      - `required Boolean ExplicitOrder`

      - `required Boolean IsPicked`

      - `required Boolean IsTemplate`

      - `required Long LineNumber`

      - `required Double PickedQuantity`

      - `required Double Price`

      - `required Double Quantity`

      - `required Int StockPool`

      - `required Long StoreWalkingOrder`

      - `string? Barcode`

      - `DateTimeOffset? DeliveryDate`

      - `Double? DeliveryQty`

      - `string? Description`

      - `Double? MovedQuantity`

      - `DateTimeOffset? NextOrderingDatetime`

      - `string? PickedUsername`

      - `IReadOnlyList<string>? PickingStockPoolArray`

      - `DateTimeOffset? PickupDate`

      - `string? PreferredLocationCode`

      - `string? ProductNumber`

      - `string? Reference`

      - `string? StockLocation`

      - `IReadOnlyList<StoreLocation>? StoreLocations`

        - `required Int LocationOrder`

        - `required Double Quantity`

        - `Int? CustomerOrderLineNumber`

        - `string? CustomerOrderNumber`

        - `Int? CustomerOrderShipmentLineNumber`

        - `string? CustomerOrderShipmentNumber`

        - `string? DefaultStockPool`

        - `string? LocationCode`

        - `Double? MostLikelyPool1`

        - `Double? MostLikelyPool10`

        - `Double? MostLikelyPool2`

        - `Double? MostLikelyPool3`

        - `Double? MostLikelyPool4`

        - `Double? MostLikelyPool5`

        - `Double? MostLikelyPool6`

        - `Double? MostLikelyPool7`

        - `Double? MostLikelyPool8`

        - `Double? MostLikelyPool9`

        - `IReadOnlyList<string>? Tags`

    - `string? OrderNumber`

    - `string? OrderTypeCode`

    - `string? OrderTypeDescription`

    - `string? PickupDate`

    - `string? Reference`

    - `string? RejectionReasonCode`

    - `string? RejectionReasonCodeDescription`

    - `string? SalesOrderID`

    - `string? StoreNumber`

    - `string? StoresAllowed`

    - `Double? TotalDeliveryQuantity`

  - `IReadOnlyDictionary<string, JsonElement>? ListBody`

    Additional body-level metadata for the list.

  - `IReadOnlyDictionary<string, IReadOnlyList<string>>? ListFilters`

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

  - `Int? NextPage`

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

  - `Long? PreviousPage`

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

  - `string? ProjectLastModifiedDate`

    Last modified date/time of the project.

  - `string? ScrollID`

    Opaque scroll identifier for deep-pagination scenarios.

  - `string? ServerTime`

    Server UTC date/time when the response was generated.

  - `string? SortColumn`

    Column name the results are sorted by.

  - `string? SortOrder`

    Sort direction (asc or desc).

  - `string? TaskLastModifiedDate`

    Last modified date/time of the task.

### Example

```csharp
CustomerOrderListCustomerOrdersParams parameters = new()
{
    StoreNumber = "store_number"
};

var page = await client.CustomerOrders.ListCustomerOrders(parameters);
await foreach (var item in page.Paginate())
{
    Console.WriteLine(item);
}
```

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

`CustomerOrderCreateCustomerOrdersResponse CustomerOrders.CreateCustomerOrders(CustomerOrderCreateCustomerOrdersParamsparameters, CancellationTokencancellationToken = default)`

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

- `CustomerOrderCreateCustomerOrdersParams parameters`

  - `required string storeNumber`

    Path param: The store the orders are for.

  - `Boolean flush`

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

  - `IReadOnlyList<Order>? orders`

    Body param

    - `required string OrderNumber`

    - `string? CustomerCity`

    - `string? CustomerCountry`

    - `string? CustomerEmail`

    - `string? CustomerName`

    - `string? CustomerNumber`

    - `string? CustomerPhone`

    - `string? CustomerStreet`

    - `string? CustomerZipcode`

    - `string? DeliveryCity`

    - `string? DeliveryCountry`

    - `string? DeliveryStreet`

    - `string? DeliveryZipcode`

    - `string? Description`

    - `string? FileName`

    - `Boolean? IsActive`

    - `Boolean IsPicked`

    - `Boolean? IsRejected`

    - `string? OrderComment`

    - `IReadOnlyList<OrderLine>? OrderLines`

      - `required Long LineNumber`

      - `required string ProductNumber`

      - `required Double Quantity`

      - `string? Barcode`

      - `DateTimeOffset DeliveryDate`

      - `string? Description`

      - `string? FullFillmentStatus`

      - `Boolean IsPicked`

      - `Boolean IsPickedFromWarehouse`

      - `DateTimeOffset OrderingDatetime`

      - `Double PickedQuantity`

      - `IReadOnlyList<string>? PickingStockPoolArray`

      - `DateTimeOffset? PickupDate`

      - `string? PreferredLocationCode`

      - `Double Price`

      - `string? Reference`

      - `Int StockPool`

    - `string? OrderType`

    - `string? OrderTypeCode`

    - `string? OrderTypeDescription`

    - `string? Reference`

    - `string? SalesOrderID`

    - `Int? StatusID`

### Returns

- `class CustomerOrderCreateCustomerOrdersResponse:`

  Standard success response returned by mutation endpoints.

  - `required Boolean Success`

    Indicates whether the operation completed successfully.

  - `string? Data`

    Optional data payload returned by the operation.

  - `string? Message`

    Human-readable message describing the result.

### Example

```csharp
CustomerOrderCreateCustomerOrdersParams parameters = new()
{
    StoreNumber = "store_number"
};

var response = await client.CustomerOrders.CreateCustomerOrders(parameters);

Console.WriteLine(response);
```

#### Response

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

## Create Multi Store Customer Orders

`CustomerOrderCreateMultiStoreCustomerOrdersResponse CustomerOrders.CreateMultiStoreCustomerOrders(CustomerOrderCreateMultiStoreCustomerOrdersParams?parameters, CancellationTokencancellationToken = default)`

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

- `CustomerOrderCreateMultiStoreCustomerOrdersParams parameters`

  - `Boolean flush`

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

  - `IReadOnlyList<Order>? orders`

    Body param

    - `required string OrderNumber`

    - `string? CustomerCity`

    - `string? CustomerCountry`

    - `string? CustomerEmail`

    - `string? CustomerName`

    - `string? CustomerNumber`

    - `string? CustomerPhone`

    - `string? CustomerStreet`

    - `string? CustomerZipcode`

    - `string? DeliveryCity`

    - `string? DeliveryCountry`

    - `string? DeliveryStreet`

    - `string? DeliveryZipcode`

    - `string? Description`

    - `Boolean IsPicked`

    - `string? OrderComment`

    - `IReadOnlyList<OrderLine>? OrderLines`

      - `required Long LineNumber`

      - `required string ProductNumber`

      - `required Double Quantity`

      - `string? Barcode`

      - `DateTimeOffset DeliveryDate`

      - `string? Description`

      - `Boolean IsPicked`

      - `Boolean IsPickedFromWarehouse`

      - `DateTimeOffset OrderingDatetime`

      - `Double PickedQuantity`

      - `DateTimeOffset PickupDate`

      - `Double Price`

      - `Int StockPool`

    - `string? OrderTypeCode`

    - `string? OrderTypeDescription`

    - `string? Reference`

    - `string? StoreNumber`

    - `IReadOnlyList<string>? StoresAllowed`

### Returns

- `class CustomerOrderCreateMultiStoreCustomerOrdersResponse:`

  Standard success response returned by mutation endpoints.

  - `required Boolean Success`

    Indicates whether the operation completed successfully.

  - `string? Data`

    Optional data payload returned by the operation.

  - `string? Message`

    Human-readable message describing the result.

### Example

```csharp
CustomerOrderCreateMultiStoreCustomerOrdersParams parameters = new();

var response = await client.CustomerOrders.CreateMultiStoreCustomerOrders(parameters);

Console.WriteLine(response);
```

#### Response

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

## Update Customer Order

`CustomerOrderUpdateCustomerOrderResponse CustomerOrders.UpdateCustomerOrder(CustomerOrderUpdateCustomerOrderParamsparameters, CancellationTokencancellationToken = default)`

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

- `CustomerOrderUpdateCustomerOrderParams parameters`

  - `required string storeNumber`

    The store the order belongs to.

  - `Orders orders`

    - `required string OrderNumber`

    - `Boolean? IsActive`

    - `Boolean? IsClaimed`

    - `Boolean? IsPicked`

    - `Boolean? IsRejected`

    - `IReadOnlyList<OrderLine>? OrderLines`

      - `required Long LineNumber`

      - `required string ProductNumber`

      - `string? Barcode`

      - `DateTimeOffset? DeliveryDate`

      - `string? Description`

      - `Boolean IsPicked`

      - `Boolean? IsPickedFromWarehouse`

      - `DateTimeOffset? OrderingDatetime`

      - `Double PickedQuantity`

      - `DateTimeOffset? PickupDate`

      - `string? PreferredLocationCode`

      - `Double? Price`

      - `Double? Quantity`

      - `Int StockPool`

    - `string? RejectionReasonCode`

    - `string? RejectionReasonCodeDescription`

### Returns

- `class CustomerOrderUpdateCustomerOrderResponse:`

  Standard success response returned by mutation endpoints.

  - `required Boolean Success`

    Indicates whether the operation completed successfully.

  - `string? Data`

    Optional data payload returned by the operation.

  - `string? Message`

    Human-readable message describing the result.

### Example

```csharp
CustomerOrderUpdateCustomerOrderParams parameters = new()
{
    StoreNumber = "store_number"
};

var response = await client.CustomerOrders.UpdateCustomerOrder(parameters);

Console.WriteLine(response);
```

#### Response

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

## Create Customer Order Clearance

`CustomerOrderCreateCustomerOrderClearanceResponse CustomerOrders.CreateCustomerOrderClearance(CustomerOrderCreateCustomerOrderClearanceParamsparameters, CancellationTokencancellationToken = default)`

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

- `CustomerOrderCreateCustomerOrderClearanceParams parameters`

  - `required string locationCodeTag`

    Query param: Tag identifying the locations to clear.

  - `IReadOnlyList<string>? categoryCodes`

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

### Returns

- `class CustomerOrderCreateCustomerOrderClearanceResponse:`

  Standard success response returned by mutation endpoints.

  - `required Boolean Success`

    Indicates whether the operation completed successfully.

  - `string? Data`

    Optional data payload returned by the operation.

  - `string? Message`

    Human-readable message describing the result.

### Example

```csharp
CustomerOrderCreateCustomerOrderClearanceParams parameters = new()
{
    LocationCodeTag = "location_code_tag"
};

var response = await client.CustomerOrders.CreateCustomerOrderClearance(parameters);

Console.WriteLine(response);
```

#### Response

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