API INVENTORIES ADJUSTORSET
Các mục liên quan
- 1. Api tạo phiếu điều chỉnh tồn kho của sản phẩm
- 1.1 Request
- 1.2 Response
- 2. API liên quan
- 3. REST Admin API rate limits
1 Api tạo phiếu điều chỉnh tồn kho của sản phẩm
1.1 Request
Method | URL |
POST | https://apis.haravan.com/com/inventories/adjustorset.json |
Header:
Content-Type : application/json
Authorization : Bearer + access_token
// Tham khảo cách lấy access_token: https://docs.haravan.com/blogs/omni/omni-oauth2
Body raw json:
{
"inventory":
{
"location_id": 92,
"type": "set",
"reason" : "newproduct",
"note" : "thêm mới",
"line_items": [
{
"product_id":10000014909,
"product_variant_id": 10000081464,
"quantity": 3
}
]
}
}
STT | Thuộc tính | Mô tả |
1 | location_id (number) | - là id của chi nhánh, lấy từ danh sách địa chỉ của shop. - tham khảo api location. |
2 | type (string) | - Kiểu phiếu điều chỉnh, gồm : |
3 | reason (string) | - Lý do tạo phiếu, gồm : |
4 | note (string) | Ghi chú |
5 | line_items (array) | - Danh sách variant. |
6 | product_id (number) | Id sản phẩm |
7 | product_variant_id (number) | Id variant |
8 | quantity (number) | Số lượng điều chỉnh hoặc ghi đè của variant |
1.2 Response
Status | Response |
200 | { "inventory": { "id": 1000100210, "created_at": "2016-05-23T06:54:38.2086642Z", "updated_at": "2016-05-23T06:54:38.2086642Z", "adjust_number": "IA1000100200", "tran_date": "2016-05-23T06:54:17.3838322Z", "location_id": 92, "total_quantity": 3, "reason": "newproduct", "note" : "thêm mới", "total_cost": 0, "line_items": [ { "id": 1000100207, "product_id": 10000014909, "product_variant_id": 10000081464, "quantity": 3, "cost_amount": 0 } ] } } |
200 | // type = "set" và quantity bằng với số lượng hiện có của variant { "inventory": [] } |
401 | Unauthorized |
403 | Forbidden |
403 | Not Found |
429 | Rate limit |
STT | Thuộc tính | Mô tả |
1 | id (number) | Id của phiếu điều chỉnh |
2 | created_at (datetime) | Ngày khởi tạo |
3 | updated_at (datetime) | Ngày update |
4 | adjust_number (string) | Mã phiếu điều chỉnh |
5 | tran_date (datetime) | Thời gian phát sinh giao dịch điều chỉnh |
6 | location_id (number) | - là id của chi nhánh, lấy từ danh sách địa chỉ của shop. |
7 | total_quantity (number) | Tổng số lượng có trong line_items |
8 | reason (string) | - Lý do tạo phiếu, gồm : |
9 | note (string) | Ghi chú |
10 | total_cost (number) | Tổng số lượng có trong line_items |
11 | line_items (array) | - Danh sách variant. |
12 | id (number) | Id variant trong line_items |
13 | product_id (number) | Id sản phẩm |
14 | product_variant_id (number) | Id variant |
15 | quantity (number) | Số lượng điều chỉnh hoặc ghi đè của variant |
16 | cost_amount (number) | Giá của variant |
2. API liên quan
- API lấy thông tin sản phẩm:
- API Location, lấy thông tin chi nhánh cửa hàng: