Phiếu đếm
Mô tả
Các API hỗ trợ:
- GET /countingTickets: Danh sách
- POST /countingTickets: Tạo phiếu đếm
- GET /{id}/countingTicketDetails: Chi tiết
- DELETE /{id}: Xóa
API
GET /api/countingTickets
Danh sách phiếu đếm:
Tham số query:
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
name | string | Tên phiếu | Không |
created_from | string | yyyy-MM-dd'T'HH:mm:ss | Không |
created_to | string | yyyy-MM-dd'T'HH:mm:ss | Không |
page | integer | Trang | Không |
size | integer | Số bản ghi trên trang | Không |
sort | string | Tên trường sắp xếp | Không |
order | string | asc / desc | Không |
GET /api/countingTickets?page=1&size=10
result là mảng phiếu đếm: id, code, name, total_quantity, source, source_id, warehouse_id, zone_id, area_id, surplus, strange, created_at, created_by, updated_at, updated_by.
Response Body
{
"code": 200,
"message": "Success",
"result": [
{
"id": "{uuid}",
"code": "IVT_13102026_103000",
"name": "Đếm 1",
"total_quantity": 2,
"source": "counting_ticket",
"source_id": null,
"warehouse_id": "{uuid}",
"zone_id": null,
"area_id": null,
"surplus": 0,
"strange": 0,
"created_at": "2026-10-13T09:00:00",
"created_by": "merchant_user",
"updated_at": null,
"updated_by": null
}
],
"page": 1,
"page_size": 20,
"total": 1
}
POST /api/countingTickets
Tạo phiếu đếm theo danh sách EPC/RFID.
Request Body
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
name | string | Tên phiếu (tối đa 150) | Có |
source | string | inventory_in_ticket | inventory_out_ticket |
source_id | string | Id phiếu nguồn | Không |
warehouse_id | string | Id kho (tối đa 36) | Có |
zone_id | string | Id zone | Không |
area_id | string | Id vị trí | Không |
tags | object[] | Danh sách thẻ | Có |
tags[].epc | string | EPC/RFID (tối đa 128) | Có |
tags[].merchant_product_id | string | Mã hàng hóa (encode) | Không |
tags[].merchant_product_detail_id | string | Mã mẫu / SKU | Không |
POST /api/countingTickets
Request Body
{
"name": "Đếm 1",
"warehouse_id": "{uuid}",
"tags": [{ "epc": "E2801191A50300683..." }]
}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
DELETE /api/countingTickets/{id}
Xóa phiếu đếm.
DELETE /api/countingTickets/\{id\}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
GET /api/countingTickets/{id}/countingTicketDetails
Chi tiết dòng phiếu đếm:
Tham số query:
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
product_id | string | Lọc theo sản phẩm | Không |
page | integer | Trang | Không |
size | integer | Số bản ghi / trang | Không |
GET /api/countingTickets/\{id\}/countingTicketDetails?page=1&size=50
Không có product_id: gom theo hàng cha, thêm has_variants, variant_count. Có product_id: thêm product_detail_id. rfid là chuỗi các mã, cách nhau bởi dấu phẩy.
Response Body
{
"code": 200,
"message": "Success",
"result": [
{
"product_id": "{uuid}",
"product_detail_id": null,
"merchant_product_id": "408798",
"rfid": "E280…",
"product_name": "Andie Shirt",
"category": "Ready",
"quantity": 2,
"price": 500000,
"col_1": null,
"col_2": null,
"col_3": null,
"col_4": null,
"col_5": null,
"col_6": null,
"col_7": null,
"col_8": null,
"col_9": null,
"col_10": null,
"has_variants": false,
"variant_count": 0
}
],
"page": 1,
"page_size": 50,
"total": 1
}