# Create an *Outbound* Delivery based on specified Products.

This scenario appiles when you want to create an *outbound* Delivery based on Products with a given quantity.

## Selection

In this scenario the input items are selected based on two things:
the product(s) required for the outbound delivery and whether to select the *inbound* items based on "First-In-First-Out" (FIFO) or "Last-In-First-Out" (LIFO).

### FIFO

The system will look for matching *inbound* items that have enough remaining quantity to fulfil the *outbound* delivery ordered by *oldest* first.
*Oldest* first will be based on the Delivery Date of the *inbound* items.

### LIFO

The system will look for matching *inbound* items that have enough remaining quantity to fulfil the *outbound* delivery ordered by *newest* first.
*Newset* first will be based on the Delivery Date of the *inbound* items.

## Flow

In this example, there is an outbound delivery that has two line items for two different products.
In the Picking processes, to fulfil the quantites required, both products require picking from two different *inbound* Items that are selected based on the Delivery Date.


```mermaid
flowchart LR
    inbound1["`Delivery:001`"]
    inbound2["`Delivery:002`"]
    outbound["`Delivery:003`"]

    item1["`**Item:001**
    *Product:PC001*
    *Qty:100*`"]

    item2["`**Item:002**
    *Product:PC002*
    *Qty:200*`"]

    item3["`**Item:004**
    *Product:PC001*
    *Qty:200*`"]

    item4["`**Item:004**
    *Product:PC002*
    *Qty:400*`"]


    item5["`**Item:005**
    *Product:PC001*
    *Qty:150*`"]

    item6["`**Item:006**
    *Product:PC002*
    *Qty:300*`"]

    process["`Process:PR001`"]
    inputs["`inputs`"]
    outputs["`outputs`"]

    inbound1 --> item1
    inbound1 --> item2

    inbound2 --> item3
    inbound2 --> item4

    item1 --> inputs
    item2 --> inputs
    item3 --> inputs
    item4 --> inputs

    subgraph Workflow
    inputs --- process
    process --- outputs

    outputs --> item5
    outputs --> item6

    item5 --> outbound
    item6 --> outbound
    end
```

br
Using the base API constructs, fulfilling this example would take at least **12** API calls.

## API Call

Proposed Endpoint
The API within the documentation is a Proposed Endpoint. That means it is subject to change but you also can provide feedback and influence the final outcome.