> For the complete documentation index, see [llms.txt](https://docs.salework.net/salework-tai-lieu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.salework.net/salework-tai-lieu/he-thong-ho-tro/salework-open-api/order-create-self-logistics-v2.md).

# Order Create Self Logistics V2

POST: https\://salework.net/api/open/stock/v2

Tạo đơn trong Salework Kho Vận và liên kết với các đơn vị vận chuyển

#### Request Headers

```
client-id: 123456
token: 50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg
```

#### Request Body

{% code overflow="wrap" lineNumbers="true" %}

```json
{
    "method": "orderCreateSelfLogistics",
    "params": {
        "warehouse_id": "warehouse_id",
        "order": {
            "selected_payment": "cash",
            "price_policy": "retail_price",
            "discount": 0,
            "discount_type": "VND",
            "prepaid": 0,
            "note": "This is order note!",
            "complete_now": false
        },
        "products": [
            {
                "productCode": "PRODUCT_CODE",
                "amount": 1
            }
        ],
        "customer": {
            "name": "John Doe",
            "phone": "0123456789",
            "phone_alt": "",
            "address": "123 ABC Street",
            "province_id": "01",
            "district_id": "011",
            "ward_id": "00111",
            "note": "This is customer note!",
            "use_new_address": false,
            "buyer_invoice": {}
        },
        "delivery": {
            "logistic": "JNT",
            "delivery_fee_paid_by": 1,
            "shipping_fee": 111,
            "additional_fee": 222,
            "note": "This is delivery note!",
            "package": {
                "height": 10,
                "width": 10,
                "length": 10,
                "weight": 0.2
            }
        }
    }
}
```

{% endcode %}

#### Response Body

{% code overflow="wrap" lineNumbers="true" %}

```json
{
    "status": "success",
    "data": {}
}
```

{% endcode %}

#### Parameters

<table><thead><tr><th width="282">Parameters</th><th width="121">Type</th><th width="104">Required</th><th width="254">Note</th></tr></thead><tbody><tr><td>warehouse_id</td><td>string</td><td>yes</td><td></td></tr><tr><td>order</td><td>object</td><td>yes</td><td></td></tr><tr><td>      selected_payment</td><td>string</td><td>yes</td><td><code>cash</code> || <code>bank_transfer</code> || <code>card</code></td></tr><tr><td>      price_policy</td><td>string</td><td>yes</td><td><code>retail_price</code> ||  <code>wholesale_price</code></td></tr><tr><td>      discount</td><td>number</td><td>no</td><td></td></tr><tr><td>      discount_type</td><td>string</td><td>no</td><td><code>percent</code> || <code>VND</code></td></tr><tr><td>      prepaid</td><td>number</td><td>no</td><td><code>Khách trả trước</code></td></tr><tr><td>      note</td><td>string</td><td>no</td><td></td></tr><tr><td>      complete_now</td><td>boolean</td><td>no</td><td>Đơn hoàn thành luôn (chỉ áp dụng với đơn hàng <code>TVC</code> và <code>inStore</code> )</td></tr><tr><td>products</td><td>object[]</td><td>yes</td><td>Danh sách <a href="https://docs.salework.net/salework-tai-lieu/he-thong-ho-tro/salework-open-api/product-get-list">sản phẩm</a> trong đơn hàng</td></tr><tr><td>      productCode</td><td>string</td><td>yes</td><td>Mã sản phẩm</td></tr><tr><td>      amount</td><td>number</td><td>yes</td><td>Số lượng</td></tr><tr><td>customer</td><td>object</td><td>yes</td><td>Thông tin người mua</td></tr><tr><td>      name</td><td>string</td><td>yes</td><td></td></tr><tr><td>      phone</td><td>number</td><td>yes</td><td></td></tr><tr><td>      address</td><td>string</td><td>yes</td><td></td></tr><tr><td>      province_id</td><td>number</td><td>yes</td><td>Mã tỉnh thành( mã <a href="https://docs.salework.net/salework-tai-lieu/he-thong-ho-tro/salework-open-api/address-get-list">địa chỉ hành chính</a>)</td></tr><tr><td>      district_id</td><td>number</td><td>no</td><td>Mã huyện (áp dụng với địa chỉ hành chính 3 cấp)</td></tr><tr><td>      ward_id</td><td>number</td><td>yes</td><td>Mã xã</td></tr><tr><td>      note</td><td>string</td><td>no</td><td>Ghi chú đơn hàng</td></tr><tr><td>      use_new_address</td><td>boolean</td><td>no</td><td><code>yes</code> : sử dụng địa chỉ hành chính mới<br><code>no</code> : yêu cầu district_id có giá trị hợp lệ</td></tr><tr><td>delivery</td><td>object</td><td>yes</td><td></td></tr><tr><td>      logistic</td><td>string</td><td>yes</td><td><code>GHN</code>, <code>GHTK</code>, <code>JNT</code>, <code>CNTSHIP</code>, <code>SUPERSHIP</code>, <code>Viettel Post</code>, <code>Shopee Express</code>: các <a href="https://docs.salework.net/salework-tai-lieu/he-thong-ho-tro/salework-open-api/logistics-get-list">đơn vị vận chuyển</a> được hỗ trợ<br><code>TVC</code>: đơn tự vận chuyển<br><code>inStore</code>: bán tại cửa hàng</td></tr><tr><td>      delivery_fee_paid_by</td><td>number</td><td>yes</td><td>Bên trả phí vận chuyển:<br> <code>1</code>: Người bán<br> <code>2</code>: Người mua</td></tr><tr><td>      shipping_fee</td><td>number</td><td>yes</td><td>Phí vận chuyển</td></tr><tr><td>      additional_fee</td><td>number</td><td>yes</td><td>Phí khác</td></tr><tr><td>      note</td><td>string</td><td>no</td><td>Ghi chú vận chuyển</td></tr><tr><td>      package</td><td>object</td><td>yes</td><td>Thông tin đóng gói đơn hàng</td></tr><tr><td>            height</td><td>number</td><td>yes</td><td></td></tr><tr><td>            width</td><td>number</td><td>yes</td><td></td></tr><tr><td>            length</td><td>number</td><td>yes</td><td></td></tr><tr><td>            weight</td><td>number</td><td>yes</td><td></td></tr></tbody></table>
