# Configurations for order fulfillment

The order fulfillment with the fulfillmenttools mobile app has three stages:

* [Picking](configurations-for-order-fulfillment/picking-configuration)
* [Packing](configurations-for-order-fulfillment/packing-configuration)
* [Handover](configurations-for-order-fulfillment/handover-configuration)

First the order items need to be picked, then packed into boxes and after that they need to be handed over to the carrier or the customer. Let's configure the behaviour!

This page serves as an introduction to the configurations. **Please see the sub-pages of this site for more detailed information.**

### Picking

As discovered in earlier parts of our tutorial, the entity involved in the picking process is the pickjob. To configure the app's behaviour in that process, we need to adjust the PickJob tag configuration. This is made using the [tag configuration endpoint](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/configurations/tags/pickjob). Let's first get our information how it is currently configured:

```bash
curl --location 'https://your.api.fulfillmenttools.com/api/configurations/tags/pickjob' \
--header 'Authorization: Bearer <TOKEN>'
```

The platform responds with a `200 OK` response showing us the configuration:

```json
{
  "version": 0,
  "offeredDocumentsPerTag": [],
  "offeredDocumentsByDefault": [
    {
      "documentCategory": "SENDLABEL"
    },
    {
      "documentCategory": "RETURNNOTE"
    }
  ]
}
```

As we do not need special documents in the picking step, the default settings fit our needs here. In further stages of the integration something like a sticker shown in the app for some tags might be imaginable, but LU.XY does not need anything special for now.

### Packing

Now let's have a look at the PackJob's configuration:

```bash
curl --location 'https://your.api.fulfillmenttools.com/api/configurations/tags/packjob' \
--header 'Authorization: Bearer <TOKEN>'
```

Again we will receive a `200 OK` response showing the configuration:

```json
{
  "id": "tag_packjob",
  "version": 1,
  "created": "2024-02-06T13:13:49.810Z",
  "lastModified": "2024-02-06T13:13:49.810Z",
  "offeredDocumentsByDefault": [
    {
      "documentCategory": "SENDLABEL"
    },
    {
      "documentCategory": "RETURNNOTE"
    }
  ],
  "offeredDocumentsPerTag": [],
  "packJobCreationPerTag": []
}
```

The offeredDocumentsByDefault property shows us which documents are offered for printing inside the packing process. Per default, these are the shipping label and a return note. LU.XY does not need a return note, as the information is shown on the delivery note. They want to print these documents:

* Shipping label
* Return label
* External documents (delivery note from some marketplaces)
* Delivery note

This is configured by the [PUT PackJob configuration endpoint](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#put-/api/configurations/tags/packjob):

```bash
curl --location --request PUT 'https://your.api.fulfillmenttools.com/api/configurations/tags/packjob' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <TOKEN>' \
--data '{
    "version": 1,
    "offeredDocumentsByDefault": [
        {
            "documentCategory": "SENDLABEL"
        },
        {
            "documentCategory": "RETURNLABEL"
        },
        {
            "documentCategory": "EXTERNAL"
        },
        {
            "documentCategory": "DELIVERYNOTE"
        }
    ],
    "offeredDocumentsPerTag": [],
    "packJobCreationPerTag": []
}'
```

As you might have noticed, the list of `offeredDocumentsByDefault` is a bit longer and contains different items. The response is a `200 OK` reading back the uploaded information:

```json
{
    "id": "tag_packjob",
    "version": 2,
    "created": "2023-11-23T12:21:01.256Z",
    "lastModified": "2024-02-06T13:24:10.747Z",
    "offeredDocumentsByDefault": [
        {
            "documentCategory": "SENDLABEL"
        },
        {
            "documentCategory": "RETURNLABEL"
        },
        {
            "documentCategory": "EXTERNAL"
        },
        {
            "documentCategory": "DELIVERYNOTE"
        }
    ],
    "offeredDocumentsPerTag": [],
    "packJobCreationPerTag": []
}
```

#### Handover

The process of giving the package to the parcel courier is called the handover. When using a label generated with the fulfillmenttools platform, the HandoverJob will automatically be closed. However, let's look at the configuring using [GET endpoint](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/configurations/tags/handoverjob):

```bash
curl --location 'https://your.api.fulfillmenttools.com/api/configurations/tags/handoverjob' \
--header 'Authorization: Bearer <TOKEN>'
```

The `200 OK` response again informs us about the current configuration:

```json
{
    "version": 0,
    "offeredDocumentsPerTag": [],
    "offeredDocumentsByDefault": [
        {
            "documentCategory": "SENDLABEL"
        },
        {
            "documentCategory": "RETURNNOTE"
        }
    ]
}
```
