96 lines
3.2 KiB
Bash
96 lines
3.2 KiB
Bash
ADD TO CART
|
|
curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.user_cart.add_to_cart' \
|
|
--header 'Cookie: sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; full_name=PublicAPI; sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; system_user=no; user_id=public_api%40dbiz.com; user_image=' \
|
|
--header 'X-Frappe-Csrf-Token: 52e3deff2accdc4d990312508dff6be0ecae61e01da837f00b2bfae9' \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"items": [
|
|
{
|
|
"item_id": "Bình giữ nhiệt Euroutile",
|
|
"amount": 3000000,
|
|
"quantity" : 5.78
|
|
},
|
|
{
|
|
"item_id": "Gạch ốp Signature SIG.P-8806",
|
|
"amount": 4000000,
|
|
"quantity" : 33
|
|
}
|
|
]
|
|
}'
|
|
|
|
ADD to cart response
|
|
{
|
|
"message": [
|
|
{
|
|
"item_id": "Bình giữ nhiệt Euroutile",
|
|
"success": true,
|
|
"message": "Updated quantity in cart"
|
|
},
|
|
{
|
|
"item_id": "Gạch ốp Signature SIG.P-8806",
|
|
"success": true,
|
|
"message": "Updated quantity in cart"
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
REMOVE FROM CART
|
|
curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.user_cart.remove_from_cart' \
|
|
--header 'Cookie: sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; full_name=PublicAPI; sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; system_user=no; user_id=public_api%40dbiz.com; user_image=' \
|
|
--header 'X-Frappe-Csrf-Token: 52e3deff2accdc4d990312508dff6be0ecae61e01da837f00b2bfae9' \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"item_ids": [
|
|
"Gạch ốp Signature SIG.P-8806"
|
|
]
|
|
}'
|
|
|
|
remove_from_cart response
|
|
{
|
|
"message": [
|
|
{
|
|
"item_id": "Gạch ốp Signature SIG.P-8806",
|
|
"success": true,
|
|
"message": "Removed from cart successfully"
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
|
|
GET ALL CART ITEMS
|
|
curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.user_cart.get_user_cart' \
|
|
--header 'Cookie: sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; full_name=PublicAPI; sid=723d7a4c28209a1c5451d2dce1f7232c04addb2e040a273f3a56ea77; system_user=no; user_id=public_api%40dbiz.com; user_image=' \
|
|
--header 'X-Frappe-Csrf-Token: 52e3deff2accdc4d990312508dff6be0ecae61e01da837f00b2bfae9' \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"limit_start": 0,
|
|
"limit_page_length" : 0
|
|
}'
|
|
|
|
get_user_cart items response
|
|
{
|
|
"message": [
|
|
{
|
|
"name": "rfsbgqusrj",
|
|
"item": "Gạch ốp Signature SIG.P-8806",
|
|
"quantity": 33.0,
|
|
"amount": 4000000.0,
|
|
"item_code": "Gạch ốp Signature SIG.P-8806",
|
|
"item_name": "Gạch ốp Signature SIG.P-8806",
|
|
"image": null,
|
|
"conversion_of_sm": 0.0
|
|
},
|
|
{
|
|
"name": "ir0ngdi60p",
|
|
"item": "Bình giữ nhiệt Euroutile",
|
|
"quantity": 5.78,
|
|
"amount": 3000000.0,
|
|
"item_code": "Bình giữ nhiệt Euroutile",
|
|
"item_name": "Bình giữ nhiệt Euroutile",
|
|
"image": null,
|
|
"conversion_of_sm": 0.0
|
|
}
|
|
]
|
|
} |