# Orders

## Order

<mark style="color:green;">`POST`</mark> [{domain}](https://wms.eshopbox.com)[/api/](https://wms.eshopbox.com/api/)v1/shipping/order

This API is used to enable quick order and shipment creation and automatic shipping label generation.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th>Name</th><th width="122.1744384765625">Required</th><th width="286.5850830078125">Remarks</th><th>Type</th></tr></thead><tbody><tr><td>channelId</td><td> No</td><td>Unique identifier for the sales channel. If not provided, Eshopbox will create order on the custom sales channel.</td><td>string</td></tr><tr><td>customerOrderId</td><td> No</td><td>Identifier for the order.</td><td>string</td></tr><tr><td>shipmentId</td><td> Yes</td><td>Unique identifier for the shipment.</td><td>string</td></tr><tr><td>orderDate</td><td> No</td><td>Date when the order was placed.</td><td>datetime</td></tr><tr><td>isCOD</td><td> Yes</td><td>Indicates if the order is Cash on Delivery (COD). true if order is COD, false if order is prepaid</td><td>Boolean</td></tr><tr><td>invoiceTotal</td><td>Yes</td><td>Total amount of the invoice. Including the shipping charges and other additional amounts.</td><td>number</td></tr><tr><td>invoice.number</td><td>No</td><td>Invoice number</td><td>string</td></tr><tr><td>invoice.date</td><td>No</td><td>Date of the invoice</td><td>datetime</td></tr><tr><td>ewaybillNumber</td><td>No</td><td>E-way bill number for the shipment</td><td>string</td></tr><tr><td>shippingMode</td><td>No</td><td>You can define the shipping customer preference for this order. Using the value that you pass in this field, you need to create a shipping mode rule on your Eshopbox workspace to ensure that required shipping mode is assigned to the order.</td><td>string</td></tr><tr><td>balanceDue</td><td>No</td><td>Amount due for payment. Mandatory for Cash on delivery (COD) orders. Please ensure you enter the amount to be collected from the customer.</td><td>number</td></tr><tr><td>shippingAddress.customerName</td><td>Yes</td><td>Name of the customer </td><td>string</td></tr><tr><td>shippingAddress.addressLine1</td><td>Yes</td><td>First line of the shipping address </td><td>string</td></tr><tr><td>shippingAddress.addressLine2</td><td>No</td><td>Second line of the shipping address </td><td>string</td></tr><tr><td>shippingAddress.city</td><td>Yes</td><td>City of the shipping address</td><td>string</td></tr><tr><td>shippingAddress.state</td><td>Yes</td><td>State of the shipping address</td><td>string</td></tr><tr><td>shippingAddress.pincode</td><td>Yes</td><td>Pincode of the shipping address</td><td>string</td></tr><tr><td>shippingAddress.country</td><td>Yes</td><td>Country of the shipping address. Example: India.</td><td>string</td></tr><tr><td>shippingAddress.email</td><td>No</td><td>Email of the customer</td><td>string</td></tr><tr><td>shippingAddress.gstin</td><td>No</td><td>GSTIN of the customer  in case of a B2B order</td><td>string</td></tr><tr><td>billingIsShipping</td><td>No</td><td>Mandatory if you want to keep the billing address same as the shipping address</td><td>string</td></tr><tr><td>billingAddress.customerName</td><td>No</td><td>Name of the customer</td><td>string</td></tr><tr><td>billingAddress.addressLine1</td><td>No</td><td>First line of the billing address</td><td>string</td></tr><tr><td>billingAddress.addressLine2</td><td>No</td><td>Second line of the billing address </td><td>string</td></tr><tr><td>billingAddress.city</td><td>No</td><td>City of the billing address</td><td>string</td></tr><tr><td>billingAddress.state</td><td>No</td><td>State of the billing address</td><td>string</td></tr><tr><td>billingAddress.pincode</td><td>Yes</td><td>pincode of the billing address</td><td>string</td></tr><tr><td>billingAddress.country</td><td>No</td><td>country of the billing address</td><td>string</td></tr><tr><td>billingAddress.email</td><td>No</td><td>Email of the billing address</td><td>string</td></tr><tr><td>billingAddress.gstin</td><td>No</td><td>gstin of the billing address</td><td>string</td></tr><tr><td>items.itemID</td><td>Yes</td><td>Unique identifier for the item like sku, ESIN, EAN etc</td><td>string</td></tr><tr><td>items.productTitle</td><td>Yes</td><td>Title of the product</td><td>string</td></tr><tr><td>items.quantity</td><td>Yes</td><td>Quantity of the item ordered </td><td>number</td></tr><tr><td>items.itemTotal</td><td>Yes</td><td>Total price for the item (inclusive of taxes).<br>In case of multiple qyu, enter amount of single unit including the shipping charges and other additional amounts.<br><br>If you have multiple items and shipping charges, you can divide the same in proportion of selling price for each item.</td><td>number</td></tr><tr><td>items.hsn</td><td>No</td><td> HSN code for the item</td><td>string</td></tr><tr><td>items.mrp</td><td>No</td><td>Maximum Retail Price (MRP) of the item</td><td>number</td></tr><tr><td>items.discount</td><td>No</td><td>Discount applied to the item </td><td>number</td></tr><tr><td>items.taxPercentage</td><td>No</td><td>Tax percentage applied to the item </td><td>number</td></tr><tr><td>items.itemLength</td><td>No</td><td>Length of the item (in cm)</td><td>number</td></tr><tr><td>items.itemBreadth</td><td>No</td><td>Breadth of the item (in cm)</td><td>number</td></tr><tr><td>items.itemHeight</td><td>No</td><td>Height of the item (in cm)</td><td>number</td></tr><tr><td>items.productImageUrl</td><td>No</td><td>Image of item</td><td>string</td></tr><tr><td>items.itemWeight</td><td>No</td><td>Weight of the item (in gram)</td><td>string</td></tr><tr><td>shipmentLength</td><td>Yes</td><td>Length of the shipment (in cm)</td><td>string</td></tr><tr><td>shipmentBreadth</td><td>Yes</td><td>Breadth of the shipment (in cm)</td><td>string</td></tr><tr><td>shipmentHeight</td><td>Yes</td><td>Height of the shipment  (in cm)</td><td>string</td></tr><tr><td>shipmentWeight</td><td>Yes</td><td>Weight of the shipment (in gram)</td><td>string</td></tr><tr><td>pickupLocation.locationCode</td><td> Yes</td><td>Code for the pickup location. It is unique for each location.</td><td>string</td></tr><tr><td>pickupLocation.locationName</td><td>No</td><td>Name of the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox.</td><td>string</td></tr><tr><td>pickupLocation.companyName</td><td>No </td><td>Name of the company.  *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.contactPerson</td><td>No</td><td>Contact person at the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.contactNumber</td><td>No</td><td>Contact number of the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.addressLine1</td><td>No</td><td>First line of the pickup location address. *Mandatory if location code is blank or location is not created in Eshopbox.</td><td>string</td></tr><tr><td>pickupLocation.addressLine2</td><td>No</td><td>Second line of the pickup location address. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.city</td><td>No</td><td>City of the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.state</td><td>No</td><td>State of the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.pincode</td><td>No</td><td>Pincode of the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>pickupLocation.contactPhone</td><td>No</td><td>Phone contact for the pickup location. *Mandatory if location code is blank or location is not created in Eshopbox. </td><td>string</td></tr><tr><td>package.code</td><td>No</td><td>Code for the package </td><td>string</td></tr><tr><td>package.type</td><td>No</td><td> Type of the package. (e.g. box, flyer)</td><td>string</td></tr><tr><td>package.description</td><td>No</td><td>Description of the package </td><td>string</td></tr><tr><td>package.length</td><td>No</td><td>Length of the package (in cm) </td><td>string</td></tr><tr><td>package.breadth</td><td>No</td><td>Breadth of the package (in cm)</td><td>string</td></tr><tr><td>package.height</td><td>No</td><td>Height of the package (in cm) </td><td>string</td></tr><tr><td>package.weight</td><td>No</td><td>Weight of the package (in gram)</td><td>string</td></tr></tbody></table>

**Response**

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

```json
{
    "courierName": "Delhivery",
    "trackingId": "758912398798",
    "label_url": "https://storage.googleapis.com/1.pdf",
    "shipmentId": "test1",
    "routingCode": "",
    "labelStream": "",
    "shippingMode": "Express",
    "gstin": "36AAACC1206D2ZG",
    "transporterID": ""
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "badRequest",
                "message": "Label couldn't be generated due to pincode not serviceable"
            }
        ],
        "code": 400,
        "message": "Label couldn't be generated due to pincode not serviceable"
    }
}
```

{% endtab %}
{% endtabs %}

```json
curl --location 'https://wms.eshopbox.com/api/v1/shipping/order' \
--header 'Authorization: Bearer <>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "channelId": "CH001",
    "customerOrderId": "test1",
    "shipmentId": "ORtest1",
    "orderDate": "2024-01-01 09:00:00",
    "isCOD": true,
    "invoiceTotal": 4049.09,
    "shippingMode": "Eshopbox Standard",
    "invoice": {
        "number": "C00011323A000002",
        "date": "2024-01-04 09:00:00"
    },
    "ewaybillNumber": "123422267332",
    "balanceDue": 4049.09, 
    "shippingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "pincode": "560005",
        "country": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com",
        "gstin": "344633257673"
    },
    "billingIsShipping": true,
    "billingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "pincode": "560005",
        "country": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com"
    },
    "items": [
        {
            "itemID": "DB9U03FMGWZ",
            "productTitle": "Pace Barnes",
            "quantity": 1,
            "itemTotal": 4049.09,
            "hsn": "ESBGST2",
            "mrp": 1500.12,
            "discount": 124.50,
            "taxPercentage": 12.00,
            "itemLength": 12.00,
            "itemBreadth": 14.23,
            "itemHeight": 56.22,
            "itemWeight": 200.64,
            "ean": "4550329693705",
            "productImageUrl": "https://cdn.filestackcontent.com/NTocrjGYSZqKif1e9W7k"
        }
    ],
    "shipmentDimension": {
        "length": 13.12,
        "breadth": 15.32,
        "height": 56.39,
        "weight": 201.23
    },
    "pickupLocation": {
        "locationCode": "MCFL00395",
        "locationName": "TEST Warehouse",
        "companyName": "TEST",
        "contactPerson": "SAM",
        "contactNumber": "898898989",
        "addressLine1": "Khasra no 5/16/2,17, Near Subash Chowk, Sohana Road Village Behrampur",
        "addressLine2": "Khasra no 5/16/2,17, Near Subash Chowk",
        "city": "Gurgaon",
        "state": "HARYANA",
        "country" : "India",
        "pincode": "121005",
        "gstin": "06AAFCM7888Q1ZE"
    },
    "package": {
        "type": "box",
        "code": "PC20240613141533",
        "description": "Test1",
        "length": 45.00,
        "breadth": 54.13,
        "height": 45.22,
        "weight": 45.80
    }
}'
```


---

# 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/order/shipper-integration-wrapper-api/orders.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.
