# Deliveries

## Retrieves a paginated list of delivery orders.

**get** `/api/v2/public/orders/deliveries`

Retrieves a paginated list of delivery orders.

### Query Parameters

- `delivery_date: optional string`

  Filter by delivery date.

- `group_code: optional string`

  Filter by group code.

- `is_submitted: optional boolean`

  Filter by submission status.

- `last_modified_date: optional string`

  Filter by last modified date.

- `order_number: optional string`

  Filter by order number.

- `page_size: optional string`

- `page_start: optional string`

- `secondary_order_number: optional string`

  Filter by secondary order number.

- `status: optional string`

  Filter by order status.

- `store_number: optional string`

  Filter by store number.

- `supplier_code: optional string`

  Filter by supplier code.

- `supplier_name: optional string`

  Filter by supplier name.

### 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 { datetime_created, datetime_expected, import_id, 14 more }`

  Collection of items for the current page.

  - `datetime_created: string`

  - `datetime_expected: string`

  - `import_id: number`

  - `is_downloaded: boolean`

  - `updated_on: string`

  - `external_reference_number: optional string`

  - `no_of_containers: optional number`

  - `order_lines: optional array of object { line_number, quantity, received_quantity, 16 more }`

    - `line_number: number`

    - `quantity: number`

    - `received_quantity: number`

    - `target_stock_pool: number`

    - `barcode: optional string`

    - `base_unit: optional string`

    - `category_code: optional string`

    - `container_barcode: optional string`

    - `customer_order_number: optional string`

    - `customer_order_shipment_number: optional string`

    - `customer_order_shipment_number_line_number: optional number`

    - `description: optional string`

    - `group_code: optional string`

    - `product_number: optional string`

    - `purchase_unit_barcode: optional string`

    - `purchase_unit_product_number: optional string`

    - `purchase_unit_quantity: optional number`

    - `rounded_quantity: optional number`

    - `secondary_order_number: optional string`

  - `order_number: optional string`

  - `order_type: optional string`

  - `status: optional string`

  - `store_gln: optional string`

  - `store_number: optional string`

  - `store_origin: optional string`

  - `supplier_code: optional string`

  - `supplier_name: optional string`

  - `tracing_url: optional string`

- `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/orders/deliveries \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

```json
{
  "page_size": 0,
  "page_start": 0,
  "total_count": 0,
  "list": [
    {
      "datetime_created": "2019-12-27T18:11:19.117Z",
      "datetime_expected": "2019-12-27T18:11:19.117Z",
      "import_id": 0,
      "is_downloaded": true,
      "updated_on": "2019-12-27T18:11:19.117Z",
      "external_reference_number": "external_reference_number",
      "no_of_containers": 0,
      "order_lines": [
        {
          "line_number": 0,
          "quantity": 0,
          "received_quantity": 0,
          "target_stock_pool": 0,
          "barcode": "barcode",
          "base_unit": "base_unit",
          "category_code": "category_code",
          "container_barcode": "container_barcode",
          "customer_order_number": "customer_order_number",
          "customer_order_shipment_number": "customer_order_shipment_number",
          "customer_order_shipment_number_line_number": 0,
          "description": "description",
          "group_code": "group_code",
          "product_number": "product_number",
          "purchase_unit_barcode": "purchase_unit_barcode",
          "purchase_unit_product_number": "purchase_unit_product_number",
          "purchase_unit_quantity": 0,
          "rounded_quantity": 0,
          "secondary_order_number": "secondary_order_number"
        }
      ],
      "order_number": "order_number",
      "order_type": "order_type",
      "status": "status",
      "store_gln": "store_gln",
      "store_number": "store_number",
      "store_origin": "store_origin",
      "supplier_code": "supplier_code",
      "supplier_name": "supplier_name",
      "tracing_url": "tracing_url"
    }
  ],
  "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"
}
```

## Creates delivery orders for a specific store.

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

Creates delivery orders for a specific store.

### Path Parameters

- `store_number: string`

### Header Parameters

- `container_override: optional boolean`

### Body Parameters

- `orders: optional array of object { datetime_expected, no_of_containers, order_number, 10 more }`

  The list of delivery orders to create.

  - `datetime_expected: string`

    The expected delivery datetime.

  - `no_of_containers: number`

    The number of containers in the delivery.

  - `order_number: string`

    The unique order number.

  - `order_type: number`

    The order type identifier (e.g. 1 = purchase, 2 = transfer).

  - `datetime_created: optional string`

    The datetime the order was created. Defaults to UTC now if omitted.

  - `description: optional string`

    A description of the delivery order.

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

    The order lines in this delivery.

    - `line_number: number`

      The order line number.

    - `product_number: string`

      The product number.

    - `quantity: number`

      The quantity being delivered.

    - `target_stock_pool: number`

      The target stock pool for the delivered goods.

    - `barcode: optional string`

      The product barcode.

    - `container_barcode: optional string`

      The barcode of the container this line belongs to.

    - `customer_order_line_number: optional number`

      The line number on the customer order.

    - `customer_order_number: optional string`

      The customer order number this line fulfills.

    - `customer_order_shipment_number: optional string`

      The customer order shipment number.

    - `customer_order_shipment_number_line_number: optional number`

      The line number on the customer order shipment.

    - `description: optional string`

      A description of the order line.

    - `ordered_quantity: optional number`

      The originally ordered quantity.

    - `product_description: optional string`

      A description of the product.

    - `purchase_price: optional number`

      The purchase price per unit.

    - `reference: optional string`

      An external reference for the order line.

    - `secondary_order_line_number: optional number`

      The line number on the secondary order.

    - `secondary_order_number: optional string`

      A secondary/external order number.

  - `reason_code: optional number`

    The reason code for the delivery.

  - `reference: optional string`

    An external reference for the delivery order.

  - `store_origin: optional string`

    The origin store number (for inter-store transfers).

  - `supplier_code: optional string`

    The unique supplier code.

  - `supplier_name: optional string`

    The name of the supplier.

  - `tracing_url: optional string`

    URL for tracking the delivery shipment.

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

#### Response

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

## Creates delivery orders across multiple stores.

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

Creates delivery orders across multiple stores.

### Header Parameters

- `container_override: optional boolean`

### Body Parameters

- `orders: optional array of object { datetime_expected, no_of_containers, order_number, 9 more }`

  The list of multi-store delivery orders to create.

  - `datetime_expected: string`

    The expected delivery datetime.

  - `no_of_containers: number`

    The number of containers.

  - `order_number: string`

    The unique order number.

  - `order_type: number`

    The order type identifier.

  - `store_number: string`

    The target store number.

  - `supplier_name: string`

    The name of the supplier.

  - `datetime_created: optional string`

    The datetime the order was created.

  - `description: optional string`

    A description of the delivery order.

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

    The order lines in this delivery.

    - `line_number: number`

      The order line number.

    - `quantity: number`

      The quantity being delivered.

    - `target_stock_pool: number`

      The target stock pool for the delivered goods.

    - `barcode: optional string`

      The product barcode.

    - `container_barcode: optional string`

      The barcode of the container this line belongs to.

    - `customer_order_line_number: optional number`

      The line number on the customer order.

    - `customer_order_number: optional string`

      The customer order number this line fulfills.

    - `customer_order_shipment_number: optional string`

      The customer order shipment number.

    - `customer_order_shipment_number_line_number: optional number`

      The line number on the customer order shipment.

    - `description: optional string`

      A description of the order line.

    - `product_number: optional string`

      The product number.

    - `secondary_order_line_number: optional number`

      The line number on the secondary order.

    - `secondary_order_number: optional string`

      A secondary/external order number.

  - `reason_code: optional number`

    The reason code for the delivery.

  - `supplier_code: optional string`

    The unique supplier code.

  - `tracing_url: optional string`

    URL for tracking the delivery shipment.

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

#### Response

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

## Domain Types

### Delivery List Deliveries Response

- `DeliveryListDeliveriesResponse object { page_size, page_start, total_count, 11 more }`

  Generic paginated response wrapper.

  - `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 { datetime_created, datetime_expected, import_id, 14 more }`

    Collection of items for the current page.

    - `datetime_created: string`

    - `datetime_expected: string`

    - `import_id: number`

    - `is_downloaded: boolean`

    - `updated_on: string`

    - `external_reference_number: optional string`

    - `no_of_containers: optional number`

    - `order_lines: optional array of object { line_number, quantity, received_quantity, 16 more }`

      - `line_number: number`

      - `quantity: number`

      - `received_quantity: number`

      - `target_stock_pool: number`

      - `barcode: optional string`

      - `base_unit: optional string`

      - `category_code: optional string`

      - `container_barcode: optional string`

      - `customer_order_number: optional string`

      - `customer_order_shipment_number: optional string`

      - `customer_order_shipment_number_line_number: optional number`

      - `description: optional string`

      - `group_code: optional string`

      - `product_number: optional string`

      - `purchase_unit_barcode: optional string`

      - `purchase_unit_product_number: optional string`

      - `purchase_unit_quantity: optional number`

      - `rounded_quantity: optional number`

      - `secondary_order_number: optional string`

    - `order_number: optional string`

    - `order_type: optional string`

    - `status: optional string`

    - `store_gln: optional string`

    - `store_number: optional string`

    - `store_origin: optional string`

    - `supplier_code: optional string`

    - `supplier_name: optional string`

    - `tracing_url: optional string`

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

### Delivery Create Store Deliveries Response

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

### Delivery Create Multi Store Deliveries Response

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