# Create an Inward Consignment

## Create inward consignment

<mark style="color:green;">`POST`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/createConsignmentApi`

This endpoint allows you to create an inward consignment using the following JSON request

#### Headers

| Name                                        | Type   | Description                                              |
| ------------------------------------------- | ------ | -------------------------------------------------------- |
| Authentication                              | string | The Bearer token which allows to grant access to the API |
| proxyHost<mark style="color:red;">\*</mark> | String | Account Slug                                             |

#### Request Body

| Name                                               | Type     | Description                                                                                                                                                                                                     |
| -------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| documentNumber<mark style="color:red;">\*</mark>   | String   | Invoice number of the consignment created in your ERP.                                                                                                                                                          |
| referenceNumber                                    | String   | Purchase order number of the consignment created in your ERP.                                                                                                                                                   |
| toLocationCode<mark style="color:red;">\*</mark>   | String   | Location or plant code created in your ERP for the location to which you are sending the inventory.                                                                                                             |
| fromLocationCode<mark style="color:red;">\*</mark> | String   | Location or plant code created in your ERP for the location from which you are sending the inventory. Please ensure that the location from where are sending the inventory in added in your Eshopbox workspace. |
| productId<mark style="color:red;">\*</mark>        | String   | Any scannable identifier of the product created in your Eshopbox workspace. (ESIN/SKU)                                                                                                                          |
| documentDate<mark style="color:red;">\*</mark>     | DateTime | Date when document was created.                                                                                                                                                                                 |
| manufacturing\_date                                | String   | The manufacturing date of the product id batch tracking is enabled, and the method is the manufacturing date.                                                                                                   |
| quantity<mark style="color:red;">\*</mark>         | String   | Total count of the product that you are sending.                                                                                                                                                                |
| batch\_code                                        | String   | The batch code of the product id batch tracking is enabled, and the method is batch code.                                                                                                                       |
| expiry\_date                                       | String   | The expiry date of the product id whose batch tracking is enabled and the method is the expiry date.                                                                                                            |

{% tabs %}
{% tab title="200 Inward consignment successfully created." %}

```
{
 "id": "7633",
 "accountId": "28",
 "consignmentNumber": "CON/45/873",
 "documentNumber": "INV/001",
 "referenceNumber": "PO/24/A001",
 "consignmentType": "INWARD",
 "fromPartyID": "8",
 "toPartyID": "72",
 "itemsFileUrl": "https://storage.cloud.google.com/fileItems.appspot.com/items.pdf",
 "status": "CREATING",
 "totalBoxes": 0,
 "processedBoxes": 0,
 "pendingBoxes": 0
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location -g --request POST 'https://{{workspace}}.myeshopbox.com/api/v1/createConsignmentApi' \
--header 'ProxyHost: <<accountSlug>>' \
--header 'Authorization: Bearer XXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "documentNumber": "INV/001",
    "referenceNumber": "PO/24/A001",
    "documentDate": "2022-12-18 00:00:00",
    "fromLocationCode": "XXLG",
    "toLocationCode": "ERAY",
    "productDetails": [
        {
            "productId": "testing5",
            "quantity": 3,
            "manufacturing_date": "",
            "expiry_date": "",
            "batch_code": ""
        },
        {
            "productId": "testing1",
            "quantity": 9,
            "manufacturing_date": "02-Jun-22",
            "expiry_date": "",
            "batch_code": ""
        },
        {
            "productId": "testing",
            "quantity": 9,
            "manufacturing_date": "",
            "expiry_date": "02-Jun-23",
            "batch_code": ""
        },
        {
            "productId": "testing2",
            "quantity": 9,
            "manufacturing_date": "",
            "expiry_date": "",
            "batch_code": "batch11"
        }
    ]
}'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eshop.gitbook.io/eshopbox-developers/consignment/inward-consignment/create-an-inward-consignment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
