API cập nhật giá, tồn kho của sản phẩm
Note:
- Trong thời điểm đang áp dụng khuyến mãi sẽ không được cập nhật giá khuyến mãi
- Sản phẩm đang áp dụng khuyến mãi nếu thay đổi giá gôc thì sẽ hủy giá khuyến mãi
Truyền vào Array []
Tham số |
Mô tả |
kiểu dữ liệu |
Ví dụ |
|
---|---|---|---|---|
|
Id sản phẩm, bắt buộc |
int |
|
|
|
sản phẩm được tạo theo cấu hình cơ bản hay thuộc tính |
boolean |
is_config_variant: true |
|
|
Giá khuyến mãi |
decimal |
special_price: 100000 |
|
|
Thời gian băt đầu khuyến mãi |
date |
|
|
|
Thời gian kết thúc khuyến mãi |
date |
|
|
|
tồn kho |
int |
|
|
|
trạng thái còn hàng hết hàng |
boolean |
|
|
|
Danh sách sp con trong sản phẩm cấu hình thuộc tính (isConfigVariant = true) |
Array |
|
**Attributes:
Tên field |
Tên diễn giải |
kiểu dữ liệu |
Dùng trong Tạo/ Cập nhật |
Bắt buộc |
Mô tả |
|
---|---|---|---|---|---|---|
|
Id thuộc tính |
int |
có |
có |
|
|
|
|
int |
Không |
Không |
|
|
|
Mã thuộc tính |
text |
Không |
Không |
|
Variant: Sản phẩm con
Tên field |
Tên diễn giải |
Kiểu dữ liệu |
Dùng trong cập nhật/ Tạo |
Bắt buộc |
Mô tả |
|
---|---|---|---|---|---|---|
variant_attributes |
thuộc tính đã chọn của sp con |
array |
có |
có |
xem table **Attribute |
|
|
mã sản phẩm con |
text |
có |
có |
không được trùng trong 1 sản phẩm |
|
|
Giá |
decimal |
có |
có |
|
|
|
Giá khuyến mãi |
decimal |
Có |
không |
Giá khuyến mãi |
|
|
Tồn kho |
int |
Có |
Không |
|
|
|
Ngày bắt đầu khuyến mãi |
date |
Có |
Không |
|
|
|
Ngày kết thức khuyến mãi |
date |
Có |
Không |
|
Request cập nhật giá tồn kho theo thuộc tính
Sample Request
curl -X PUT \ https://open.sendo.vn/api/partner/product/config/variant-price \ -H 'authorization: bearer your_access_token' \ -H 'content-type: application/json' \ -d '[ { "product_id": 16674262, "price": 777777, "stock_quantity": 3, "is_config_variant": true, "stock_availability": true, "special_price": null, "promotion_start_date": null, "promotion_end_date": null, "variants": [ { "variant_attributes": [ { "attribute_id": 698, "attribute_code": "mau_sac_elt", "option_id": 12526 } ], "variant_sku": "string1", "variant_price": 7077777, "variant_special_price":91000, "variant_quantity": 5, "variant_promotion_start_date": "2020-06-04T04:22:12.674Z", "variant_promotion_end_date": "2020-06-13T04:22:12.674Z", } ] }, ............ ]' |
Request cập nhật giá tồn kho theo cấu hình cơ bản
Sample Request
curl -X PUT \ https://open.sendo.vn/api/partner/product/config/variant-price \ -H 'authorization: bearer your_access_token' \ -H 'content-type: application/json' \ -d '[ { "product_id": 16674262, "price": 777777, "stock_quantity": 3, "is_config_variant": false, "stock_availability": true, "special_price": 10000, "promotion_start_date": "2020-06-04T04:22:12.674Z", "promotion_end_date": "2020-06-13T04:22:12.674Z", "variants": [] }, ........... ]' |
Response
{ "result": { "success_list": [ { "product_id": 0, "message": "string", "is_config_variant": true, "variants": [] } ], "error_list": [ { "product_id": 0, "message": "string", "is_config_variant": false, "variants": [ { "variant_attributes": [ { "attribute_id": 0, "attribute_code": "string", "option_id": 0 } ], "variant_is_promotion": 0, "variant_sku": "string", "variant_price": 0, "variant_special_price": 0, "variant_quantity": 0, "variant_promotion_start_date_timestamp": "2020-06-05T03:15:19.361Z", "variant_promotion_end_date_timestamp": "2020-06-05T03:15:19.361Z", "variant_is_flash_sales": true, "variant_campaign_status": 0 "variant_attribute_hash": null, "message": "Giá KM không hợp lệ." } ] }, "success": true, "error": { "message": "string", "details": "string", "error_details": [ { "property_name": "string", "message": "string", "value": {}, "code": "string" } ] }, "status_code": 200 } |