# Product
# Add/Remove/Edit Product
Sử dụng API này để thêm/xóa/sửa sản phẩm
# Endpoint
# Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| items | Object | ✔️ |
# Note
Các params có trong object của items khi thêm/xóa/sửa sản phẩm
| Name | Type | Description | Required |
|---|---|---|---|
| $add | Array | ✔️ | |
| $remove | Array | ✔️ | |
| $update | Array | ✔️ | |
| $delete | Array | ✔️ |
Các params có trong mảng $add khi thêm sản phẩm
| Name | Type | Description | Required |
|---|---|---|---|
| name | String | ✔️ | |
| mpn | String | Manufacturer part number | |
| uom | String | Unit of Measurement | |
| tags | String | ✔️ | |
| companyId | Number | ✔️ | |
| categoryId | Number | ✔️ | |
| supplierId | Number | ✔️ | |
| description | Number | ||
| specification | String | ||
| content | String | ||
| images | String | ✔️ | |
| thumbnail | String | ✔️ | |
| price | Number | ||
| supplierPrice | Number | ||
| markerPrice | Number | ||
| discountRate | Number | ||
| stock | Number | ✔️ | |
| moq | Number | ✔️ | |
| promotionCode | String | ||
| shipMethodId | Number | ||
| specialRequest | String | ||
| rate | String | ||
| brandId | Number | ||
| optionData | Array | ||
| optionGroupId | Number | ||
| variantData | Array | ||
| variantTemplateTypeId | Number | ||
| startDate | Date | ✔️ | |
| endDate | Date | ||
| upSellId | Number | ||
| crossSells | Array | ||
| groupingId | Number | ||
| productCustomIds | Array | ||
| bulkDiscounts | Array | ||
| warrantyPolicy | String | ||
| titleSeo | String | ||
| descriptionSeo | String | ||
| keywordSeo | String |
Các params có trong mảng $update khi chỉnh sửa sản phẩm
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | ✔️ | |
| name | String | ✔️ | |
| mpn | String | Manufacturer part number | |
| uom | String | Unit of Measurement | |
| tags | String | ✔️ | |
| companyId | Number | ✔️ | |
| categoryId | Number | ✔️ | |
| supplierId | Number | ✔️ | |
| description | Number | ||
| specification | String | ||
| content | String | ||
| images | String | ✔️ | |
| thumbnail | String | ✔️ | |
| price | Number | ||
| supplierPrice | Number | ||
| markerPrice | Number | ||
| discountRate | Number | ||
| stock | Number | ✔️ | |
| moq | Number | ✔️ | |
| promotionCode | String | ||
| shipMethodId | Number | ||
| specialRequest | String | ||
| rate | String | ||
| brandId | Number | ||
| optionData | Array | ||
| optionGroupId | Number | ||
| variantData | Array | ||
| variantTemplateTypeId | Number | ||
| startDate | Date | ✔️ | |
| endDate | Date | ||
| upSellId | Number | ||
| crossSells | Array | ||
| groupingId | Number | ||
| productCustomIds | Array | ||
| bulkDiscounts | Array | ||
| warrantyPolicy | String | ||
| titleSeo | String | ||
| descriptionSeo | String | ||
| keywordSeo | String |
Các params có trong mảng $remove khi xóa vĩnh viễn sản phẩm
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | ✔️ |
Các params có trong mảng $delete khi xóa tạm thời sản phẩm
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [{
"id": 111,
"name": "New Product",
"slug": "New Product",
"eic": "EIC-EIC-123123",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": "1|2|3",
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": "1|2",
"crossSells": "|1|2|",
"images": "|1|2|",
"thumbnail": "|1|2|",
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}],
"$rltUpdate": [{
"id": 111,
"name": "New Product",
"slug": "New Product",
"eic": "EIC-EIC-123123",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": "1|2|3",
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": "1|2",
"crossSells": "|1|2|",
"images": "|1|2|",
"thumbnail": "|1|2|",
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}],
"$rltRemove": [{
"id": 111,
"name": "New Product",
"slug": "New Product",
"eic": "EIC-EIC-123123",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": "1|2|3",
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": "1|2",
"crossSells": "|1|2|",
"images": "|1|2|",
"thumbnail": "|1|2|",
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}],
"$rltDelete": [{
"id": 111,
"name": "New Product",
"slug": "New Product",
"eic": "EIC-EIC-123123",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": "1|2|3",
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": "1|2",
"crossSells": "|1|2|",
"images": "|1|2|",
"thumbnail": "|1|2|",
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}]
}
}
curl -X POST http://localhost:3000/quotation/add \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
$add: [{
"name": "New Product",
"slug": "New Product",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": [1,2,3],
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"optionData": [],
"variantData": [],
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": [1,2],
"crossSells": [1,2],
"images": [1,2],
"thumbnail": [1,2],
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}],
$update: [{
"name": "New Product",
"slug": "New Product",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": [1,2,3],
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"optionData": [],
"variantData": [],
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": [1,2],
"crossSells": [1,2],
"images": [1,2],
"thumbnail": [1,2],
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}],
$remove: [{
"id": "111"
}],
$delete: [{
"id": "111"
}],
}
}'
# Get list Paging
Sử dụng API này để lấy danh sách sản phẩm
# Endpoint
# Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| name | String | ✔️ | |
| tags | Array | ✔️ | |
| categoryId | Number | ✔️ | |
| supplierId | Number | ✔️ | |
| currentPage | Number | ✔️ | |
| isGetAll | Boolean | ✔️ |
# Response
{
"status": true,
"message": "success",
"totalRows": 1,
"rows": [{
"id": 111,
"name": "New Product",
"slug": "New Product",
"eic": "EIC-EIC-123123",
"mpn": "MPN",
"uom": 1,
"moq": 1,
"tags": "1|2|3",
"price": 100000,
"salePrice": 90000,
"supplierPrice": 100000,
"markerPrice": 100000,
"discountRate": 10,
"companyId": 1,
"categoryId": 1,
"supplierId": 1,
"stock": 100,
"shipMethodId": 0,
"rate": 0,
"brandId": 0,
"upSellId": 0,
"groupingId": 0,
"variantTemplateTypeId": 0,
"categoryPath": "[{"id":229,"name":"BẢO HỘ LAO ĐỘNG","slug":"bao-ho-lao-dong","parentId":0},{"id":253,"name":"Quần Áo Bảo Hộ","slug":"quan-ao-bao-ho","parentId":229}]",
"supplierName": "supplierName",
"companyName": "EI Industrial",
"brandName": "EI Industrial",
"warrantyPolicy": "warrantyPolicy",
"productCustomIds": "1|2",
"crossSells": "|1|2|",
"images": "|1|2|",
"thumbnail": "|1|2|",
"promotionCode": "promotionCode",
"warrantyZone": "warrantyZone",
"description": "description",
"content": "content",
"specification": "specification",
"specialRequest": "specialRequest",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo",
"startDate": "2021-08-10 02:14:14.386",
"endDate": "2021-08-19 02:14:14.386",
"index": 1,
"createdBy": 1,
"updatedBy": 1
}]
}
curl -X POST http://localhost:3000/quotation/add \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"name": "name",
"tags": [1],
"categoryId": 1,
"supplierId": 1,
"currentPage": 1,
"isGetAll": false,
}
}'
← Supplier installation →