# Thêm phiếu nhập khác

* API này dùng để thêm phiếu nhập kho khác.

## Request

* Xem [common request params](/v3/readme.md#request-params).

```curl
curl --location --globoff 'https://pos.open.nhanh.vn/v3.0/inventory/importother?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
  "depotId": 1000,
  "customer": {
    "id": "20184482",
    "mobile": "0987654321",
    "name": "Test API V3"
  },
  "description": "test api V3",
  "products": [
    {
      "id": 1231275955,
      "discount": {"type": "cash", "value": 0},
      "quantity": 2,
      "description": "",
      "expiredDate": "",
      "price": 50000,
      "weight": 0,
      "unitId": 0,
      "batchId": 0,
      "vat": {
        "type": "cash",
        "value": 0
      }
    }
  ],
  "payment": {
    "manualDiscountType": "percent",
    "manualDiscount": 10,
    "cash": {
      "value": 0,
      "accountId": 0
    },
    "transfer": {
      "value": 90000,
      "accountId": 263475
    }
  }
}'
```

* Thông tin nhập khác:

| Key               | Type                       | Description                                                                                    |
| ----------------- | -------------------------- | ---------------------------------------------------------------------------------------------- |
| depotId           | int $$^{{\color{red}\*}}$$ | ID kho hàng                                                                                    |
| customer          | object                     | [Thông tin khách hàng](#customer)                                                              |
| products          | array                      | [Thông tin sản phẩm](#products)                                                                |
| description       | string                     | Ghi chú                                                                                        |
| tagIds            | array                      | List ID nhãn muốn gắn cho phiếu nhập                                                           |
| payment           | object                     | [Thông tin thanh toán](#payment)                                                               |
| debtDueDate       | string                     | Ngày hẹn thanh toán (Y-m-d)                                                                    |
| updateImportPrice | int                        | Cập nhật giá nhập của sản phẩm theo giá trong lần nhập này (1: Có cập nhật, 0: Không cập nhật) |

### customer

* Thông tin khách hàng

| Key     | Type   | Description              |
| ------- | ------ | ------------------------ |
| id      | int    | ID khách hàng            |
| name    | string | Tên khách hàng           |
| mobile  | string | Số điện thoại khách hàng |
| email   | string | Email khách hàng         |
| address | string | Địa chỉ khách hàng       |

### products

* Thông tin sản phẩm

| Key              | Type                          | Description                                                                                                       |
| ---------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| id               | int $$^{{\color{red}\*}}$$    | ID sản phẩm                                                                                                       |
| quantity         | double $$^{{\color{red}\*}}$$ | Số lượng sản phẩm                                                                                                 |
| price            | double                        | Giá bán sản phẩm                                                                                                  |
| discount         | object                        | <p>Chiết khấu sản phẩm<br>- type: Loại chiết khấu (percent: %, cash: Tiền mặt)<br>- value: Giá trị chiết khấu</p> |
| vat              | object                        | <p>VAT sản phẩm<br>- type: Loại VAT (percent: %, cash: Tiền mặt)<br>- value: Giá trị VAT</p>                      |
| imeis            | array                         | Danh sách IMEI nhập kho (Bắt buộc nhập nếu sản phẩm là loại bán theo IMEI)                                        |
| unitId           | int                           | [ID đơn vị tính](/v3/product/unit.md) (bắt buộc nếu sản phẩm loại nhiều đơn vị tính)                              |
| batchId          | int                           | [ID lô sản phẩm](/v3/product/batch.md) (bắt buộc nếu sản phẩm bán theo lô)                                        |
| weight           | int                           | Cân nặng sản phẩm (Tính theo Gram)                                                                                |
| expiredDate      | string                        | Ngày hết hạn (Áp dụng cho những sản phẩm có ngày hết hạn Y-m-d)                                                   |
| priorWarningDays | int                           | Cảnh báo hết hạn trước bao nhiêu ngày?                                                                            |
| description      | string                        | Ghi chú sản phẩm                                                                                                  |

### payment

* Thông tin thanh toán

| Key                | Type   | Description                                                                                                                                            |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| manualDiscountType | string | Loại chiết khấu tổng đơn                                                                                                                               |
| manualDiscount     | double | Giá trị chiết khấu tổng đơn (Nếu nhập cả chiết khấu tổng đơn và chiết khấu sản phẩm sẽ ưu tiên chiết khấu tổng đơn, không tính chiết khấu sản phẩm)    |
| cash               | array  | <p>Thanh toán bằng hình thức tiền mặt<br>- accountId: Tài khoản tiền mặt trên Nhanh (nếu có dùng kế toán)<br>- value: Giá trị tiền mặt</p>             |
| transfer           | array  | <p>Thanh toán bằng hình thức chuyển khoản<br>- accountId: Tài khoản chuyển khoản trên Nhanh (nếu có dùng kế toán)<br>- value: Giá trị chuyển khoản</p> |

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
    "code": 1,
    "data": {
        "id": "(int) ID phiếu nhập kho vừa tạo",
        "totalAmount": "(double) Giá trị phiếu nhập kho"
    }
}
```


---

# 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://apidocs.nhanh.vn/v3/inventory/importother.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.
