# Tạo phiếu xuất kho

## Create Order

<mark style="color:green;">`POST`</mark> `http://ws.ems.com.vn/api/v1/orders/logistic-order`

API tạo phiếu xuất kho chỉ sử dụng cho những khách hàng sử dụng phần mềm Merchant site và lưu trữ hàng tại kho hàng của EMS.

#### Path Parameters

| Name            | Type   | Description |
| --------------- | ------ | ----------- |
| merchant\_token | string | *`Token`*   |

#### Headers

| Name   | Type   | Description            |
| ------ | ------ | ---------------------- |
| Accept | string | application/javascript |

#### Request Body

| Name             | Type    | Description                               |
| ---------------- | ------- | ----------------------------------------- |
| products\_detail | array   | *`Danh sách sản phẩm`*                    |
| ProductCode      | string  | *`Mã sản phẩm`*                           |
| Grade            | string  | *`Ngăn/Giá để sản phẩm`*                  |
| DescriptionLine  | string  | *`Mô tả sản phẩm`*                        |
| TotalPrice       | integer | *`Giá trị sản phẩm (vnđ)`*                |
| Quantity         | integer | *`Số lượng sản phẩm`*                     |
| inventory        | integer | *`Mã điểm lấy hàng`*                      |
| to\_name         | string  | *`Tên người nhận`*                        |
| to\_phone        | string  | *`Số điện thoại người nhận`*              |
| to\_province     | string  | *`Mã tỉnh/thành phố nhận`*                |
| to\_district     | string  | *`Mã quận/huyện nhận`*                    |
| to\_ward         | string  | *`Mã phường/xã nhận`*                     |
| to\_address      | string  | *`Địa chỉ người nhận`*                    |
| order\_code      | string  | *`Mã đơn hàng`*                           |
| product\_name    | string  | *`Tên sản phẩm`*                          |
| total\_amount    | integer | *`Tổng số chi phí (vnđ)`*                 |
| total\_quantity  | integer | *`Tổng số lượng`*                         |
| total\_weight    | integer | *`Tổng khối lượng (gram)`*                |
| money\_collect   | integer | *`Tiền thu hộ (vnđ)`*                     |
| description      | string  | *`Mô tả thêm`*                            |
| service          | integer | *`Mã dịch vụ`*                            |
| checked          | boolean | *`Cho xem hàng (True: Có, False: Không)`* |
| fragile          | boolean | *`Hàng dễ vỡ (True: Có, False: Không)`*   |

{% tabs %}
{% tab title="200 C1ake successfully retrieved." %}

```php
{
    "code": "success",
    "message": "Thành công",
    "data": {
        "fee": {
            "fee": 10120,
            "remote_fee": 0
        },
        "vas": {
            "total_vas": 13000,
            "vas_detail": [
                {
                    "code": "cod",
                    "fee": 13000
                }
            ]
        },
        "money_collect": 250000,
        "estimate": 72,
        "tracking_code": "ExxxxxxxxxxVN",
        "status_code": "X"
    }
}
```

{% endtab %}
{% endtabs %}

{% code title="Sample request json body" %}

```php
{
  "order_code": "EMSN_13",
  "to_name": "Tôn",
  "to_phone": "0978013623",
  "to_province": "10",
  "to_district": "1430",
  "to_address": "23/5 Phạm Hùng, Nam Từ Liêm, Hà Nội",
  "product_name": "TSU",
  "products_detail": [
    {
      "ProductCode": "TEST02",
      "Grade": "A",
      "DescriptionLine": "TL123",
      "TotalPrice": 1580000,
      "Quantity": 3
    }
  ],
  "description":  "sản phẩm demo",
  "total_weight": 1000,
  "money_collect": 1580000,
  "service": 1,
  "checked": 1,
  "fragile": false,
  "inventory": 349,
  "total_amount": 0,
  "total_quantity": 0
}
```

{% endcode %}


---

# 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://docws.ems.com.vn/tieng-viet/buu-gui/tao-phieu-xuat-kho.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.
