# Create an Order

## create order

<mark style="color:green;">`POST`</mark> `https://wms.eshopbox.com/api/order`

This endpoint allows you to create order

#### Headers

| Name           | Type   | Description                             |
| -------------- | ------ | --------------------------------------- |
| Authentication | string | Bearer Token to grant access to the api |

#### Request Body

| Name                                          | Type    | Description                                                                                                                                                                                                                                              | Mandatory |
| --------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| externalChannelID                             | string  | Sales channel name of client                                                                                                                                                                                                                             | Yes       |
| customerOrderNumber                           | string  | Unique number against each sales channel                                                                                                                                                                                                                 | Yes       |
| shipMethod                                    | string  | Shipping method                                                                                                                                                                                                                                          | No        |
| orderDate                                     | string  | <p>Order created date time <br>eg: 2020-03-13 00:00:00</p>                                                                                                                                                                                               | No        |
| expectedShipDate                              | string  | <p>expected date on which order should be shipped from facility<br>eg: 2020-03-13 00:00:00</p>                                                                                                                                                           | No        |
| promiseDeliveryDate                           | string  | <p>Delivery date on which order should be delivered<br>eg: 2020-03-13 00:00:00</p>                                                                                                                                                                       | No        |
| isCOD                                         | string  | 1 if order is COD, 0 if order is prepaid                                                                                                                                                                                                                 | Yes       |
| paymentType                                   | string  | Payment method of order e.g : COD, credit card etc                                                                                                                                                                                                       | Yes       |
| taxAmount                                     | number  | Tax amount of order (if order Total is inclusive of tax then pass 0.00)                                                                                                                                                                                  | Yes       |
| shipChargeAmount                              | number  | Total shipping charge on order                                                                                                                                                                                                                           | No        |
| subtotal                                      | number  | Total sum of all lineItemTotal                                                                                                                                                                                                                           | Yes       |
| orderTotal                                    | number  | Invoice total of order                                                                                                                                                                                                                                   | yes       |
| balanceDue                                    | number  | Amount the customer has to pay (0 in case of prepaid order)                                                                                                                                                                                              | Yes       |
| thirdPartyShipping                            | boolean | true= if shipping is not managed by Eshopbox,false = if shipping is arranged by Eshopbox                                                                                                                                                                 | Yes       |
| shippingAddress                               | object  | Shipping address object                                                                                                                                                                                                                                  | Yes       |
| shippingAddress.customerName                  | string  | Shipping address customer name                                                                                                                                                                                                                           | Yes       |
| shippingAddress.addressLine1                  | string  | First Line of shipping address                                                                                                                                                                                                                           | yes       |
| shippingAddress.addressLine2                  | string  | Second line of shipping address                                                                                                                                                                                                                          | No        |
| shippingAddress.city                          | string  | Shipping city                                                                                                                                                                                                                                            | No        |
| shippingAddress.state                         | string  | Shipping state                                                                                                                                                                                                                                           | No        |
| shippingAddress.postalCode                    | string  | Shipping postal code                                                                                                                                                                                                                                     | Yes       |
| <p>shippingAddress.gstin<br>(coming soon)</p> | string  | Shipping GSTIN                                                                                                                                                                                                                                           | No        |
| shippingAddress.countryCode                   | string  | Shipping country code                                                                                                                                                                                                                                    | No        |
| shippingAddress.countryName                   | string  | Shipping country name                                                                                                                                                                                                                                    | No        |
| shippingAddress.contactPhone                  | string  | Shipping address contact number                                                                                                                                                                                                                          | Yes       |
| shippingAddress.email                         | string  | Shipping address email Id                                                                                                                                                                                                                                | Yes       |
| billingAddress                                | object  | Billing address object                                                                                                                                                                                                                                   | Yes       |
| billingAddress.customerName                   | string  | Billing name of customer                                                                                                                                                                                                                                 | Yes       |
| billingAddress.addressLine1                   | string  | First line of billing address                                                                                                                                                                                                                            | Yes       |
| billingAddress.addressLine2                   | string  | Second line of billing address                                                                                                                                                                                                                           | No        |
| billingAddress.city                           | string  | Billing city                                                                                                                                                                                                                                             | No        |
| billingAddress.state                          | string  | Billing state                                                                                                                                                                                                                                            | No        |
| billingAddress.postalCode                     | string  | Billing postal code                                                                                                                                                                                                                                      | Yes       |
| billingAddress.countryCode                    | string  | Billing country code                                                                                                                                                                                                                                     | No        |
| billingAddress.countryName                    | string  | Billing country name                                                                                                                                                                                                                                     | No        |
| billingAddress.contactPhone                   | string  | Billing person contact number                                                                                                                                                                                                                            | Yes       |
| billingAddress.email                          | string  | Billing person email Id                                                                                                                                                                                                                                  | Yes       |
| items                                         | array   | The order items object                                                                                                                                                                                                                                   | Yes       |
| items.lineItemSequenceNumber                  | number  | Unique id of a item in client system                                                                                                                                                                                                                     | No        |
| items.itemID                                  | string  | product availability identifier on a channel                                                                                                                                                                                                             | yes       |
| items.sellerSkuOnChannel                      | string  | Channel SKU of the product                                                                                                                                                                                                                               | no        |
| items.productName                             | string  | product name                                                                                                                                                                                                                                             | Yes       |
| items.quantity                                | number  | quantity of product                                                                                                                                                                                                                                      | yes       |
| items.customerPrice                           | number  | Unit Price of item                                                                                                                                                                                                                                       | yes       |
| items.discount                                | number  | discount on item                                                                                                                                                                                                                                         | yes       |
| items.lineItemTotal                           | number  | total price of item                                                                                                                                                                                                                                      | yes       |
| items.productUrl                              | string  | product url of item                                                                                                                                                                                                                                      | yes       |
| items.customFields                            |         | Enter the custom fields created in your workspace along with the value. Please ensure the custom field is created in your workspace beforehand. [Learn how to create custom field.](https://help.eshopbox.com/en/articles/4227000-creating-custom-field) | No        |

> **Note: sellerSkuOnChannel is a mandatory if the products are not already created on Eshopbox.**

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

```php
{
    "id": 1497564,
    "externalChannelID": "TATA CLIQ VELOCY KAPAS KRAFT",
    "customerOrderNumber": "OD119208447831346000",
    "vendorOrderNumber": "11920832654052201",
    "shipMethod": "STD",
    "orderDate": "2020-02-29 15:39:11",
    "expectedShipDate": "2020-03-02 15:00:00",
    "promiseDeliveryDate": "0000-00-00 00:00:00",
    "isCOD": "0",
    "paymentType": "DebitCard",
    "shipChargeAmount": 0,
    "subtotal": 4049.09,
    "orderTotal": 4049.09,
    "balanceDue": 0,
    "thirdPartyShipping": true,
    "onHold": false,
    "created_at": "2020-02-24 15:48:27",
    "updated_at": "2020-03-01 13:01:10",
    "shippingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "postalCode": "560005",
        "countryCode": "IN",
        "countryName": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com"
    },
    "billingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "postalCode": "560005",
        "countryCode": "IN",
        "countryName": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com"
    },
    "items": [
        {
            "lineItemSequenceNumber": 112988,
            "orderItemID": "11920832654052201",
            "itemID": "DB9U03FMGWZ",
            "sku": "1234_S",
            "productName": "Pace Barnes",
            "quantity": 1,
            "customerPrice": 4499,
            "discount": 449.89,
            "lineItemTotal": 4049.09,
            "returnPolicyCode": "",
            "cancellationPolicyCode": "",
            "customFields": [
                {
                    "order_item_id": 49465801,
                    "customFieldKey": "Entity_id",
                    "customFieldValue": "123456"
                },
                {
                    "order_item_id": 49465801,
                    "customFieldKey": "Plant",
                    "customFieldValue": "W1019"
                }
            "productAdditionalInfo": {
                "size": "",
                "color": ""
            },
            "productUrl":"https://montecarlo.auperator.co/product/edit-product/BBAPLMC144105_44 ",
            "productImageUrl": "https://s3-eu-west-1.amazonaws.com/imagebucketeshopbox/Uzip/219045371-1-40/1.JPG"
        },
    ]
}
```

{% endtab %}
{% endtabs %}

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

```php
curl -X POST https://wms.eshopbox.com/api/order \
-H "Authorization: Bearer XXXX" \
    -H "Content-Type: application/json" \
    -d $'{
     
    "externalChannelID": "TATA CLIQ VELOCY KAPAS KRAFT",
   "customerOrderNumber": "OD119208447831346000",
    "orderDate": "2020-02-29 15:39:11",
    "isCOD": "0",
    "paymentType": "DebitCard",
    "shipChargeAmount": 0,
    "subtotal": 4049.09,
    "orderTotal": 4049.09,
    "balanceDue": 0,
    "thirdPartyShipping": false,
    "shippingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "postalCode": "560005",
        "gstin": "27ABCGN5397X1XX",
        "countryCode": "IN",
        "countryName": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com"
    },
    "billingAddress": {
        "customerName": "John Doe",
        "addressLine1": "Kapas Kraft Apparels Limited",
        "addressLine2": "Banglore",
        "city": "bengluru",
        "state": "Karnataka",
        "postalCode": "560005",
        "countryCode": "IN",
        "countryName": "India",
        "contactPhone": "9998889998",
        "email": "johndoe@gmail.com"
    },
    "items": [
        {
            "lineItemSequenceNumber": 112988,
            "itemID": "DB9U03FMGWZ",
            "sellerSkuOnChannel":"ABD-123"
            "productName": "Pace Barnes",
            "quantity": 1,
            "customerPrice": 4499,
            "discount": 449.89,
            "lineItemTotal": 4049.09,
            "mrp" : 6000,
            "customFields": {
                "Entity_id": "123456",
                "Plant": "W1019"
            },
            "productAdditionalInfo": {
                "size": "",
                "color": "",
                "weight": 20.99, --(grams)
                "height": 12.13, --(cm)
                "length": 11.13, --(cm)
                "width": 8.13, --(cm)
                "taxPercentage": 12.00,
                "hsnCode": "HSN1324"
            },
           "productUrl":"https://montecarlo.auperator.co/product/edit-product/BBAPLMC144105_44 ",
            "productImageUrl": "https://s3-eu-west-1.amazonaws.com/imagebucketeshopbox/Uzip/219045371-1-40/1.JPG"
        }
    ]

      
 }
```

{% endtab %}
{% endtabs %}
