mutation

addItemsToCart

Add to cart request schema which has items data to be added in cart.
Arguments
The unique identifier of the cart.
areaCode
String
Customer servicable area_code.
includeBreakup
Boolean
This is a boolean value. Select `true` to retrieve the price breakup of cart items.
buyNow
Boolean
This is a boolen value. Select `true` to set/initialize buy now cart.
includeAllItems
Boolean
This is a boolean value. Select `true` to retrieve all the items added to the cart.
addCartRequestInput
AddCartRequestInput
Specify the item details as shown below. Refer `AddCartRequest` for more details.
orderType
String
The order type of shipment HomeDelivery - If the customer wants the order home-delivered PickAtStore - If the customer wants the handover of an order at the store itself.
Response
cart
Cart
Get cart detail API response schema which includes applied promo details, breakup values, buy_now, cart id, checkout mode, comment common config, coupon, coupon text, gstin etc.
message
String
Message of add to cart API response.
partial
Boolean
When adding multiple items check if all added. True if only few are added.
success
Boolean
True if all items are added successfully. False if partially added or not added.
Mutation
1mutation addItemsToCart(
2 $id: String
3 $areaCode: String
4 $includeBreakup: Boolean
5 $buyNow: Boolean
6 $includeAllItems: Boolean
7 $addCartRequestInput: AddCartRequestInput
8 $orderType: String
9) {
10 addItemsToCart(
11 id: $id
12 areaCode: $areaCode
13 includeBreakup: $includeBreakup
14 buyNow: $buyNow
15 includeAllItems: $includeAllItems
16 addCartRequestInput: $addCartRequestInput
17 orderType: $orderType
18 ) {
19 cart {
20 buy_now
21 cart_id
22 checkout_mode
23 comment
24 coupon_text
25 delivery_charge_info
26 gstin
27 id
28 is_valid
29 last_modified
30 message
31 notification
32 pan_config
33 pan_no
34 restrict_checkout
35 user_cart_items_count
36 staff_user_id
37 uid
38 success
39 custom_cart_meta
40 }
41 message
42 partial
43 success
44 }
45}
Try it
Input Variables
1{
2 "id": "08a16b83-9094-4e89-8c05-2ccadd5c1c7e",
3 "areaCode": "areaCode",
4 "includeBreakup": true,
5 "buyNow": true,
6 "includeAllItems": true,
7 "addCartRequestInput": {
8 "items": [
9 {
10 "_custom_json": {},
11 "article_assignment": {},
12 "article_id": "article_id",
13 "display": "display",
14 "extra_meta": {},
15 "item_id": 42,
16 "item_size": "item_size",
17 "meta": {},
18 "parent_item_identifiers": [
19 {}
20 ],
21 "pos": true,
22 "product_group_tags": [
23 "product_group_tags"
24 ],
25 "quantity": 42,
26 "seller_id": 42,
27 "store_id": 42,
28 "seller_identifier": "seller_identifier"
29 }
30 ],
31 "new_cart": true
32 },
33 "orderType": "orderType"
34}
Response
1{
2 "addItemsToCart": {
3 "cart": {
4 "buy_now": true,
5 "cart_id": 42,
6 "checkout_mode": "checkout_mode",
7 "comment": "comment",
8 "coupon_text": "coupon_text",
9 "delivery_charge_info": "delivery_charge_info",
10 "gstin": "gstin",
11 "id": "08a16b83-9094-4e89-8c05-2ccadd5c1c7e",
12 "is_valid": true,
13 "last_modified": "last_modified",
14 "message": "message",
15 "notification": {},
16 "pan_config": {},
17 "pan_no": "pan_no",
18 "restrict_checkout": true,
19 "user_cart_items_count": 42,
20 "staff_user_id": "staff_user_id",
21 "uid": "uid",
22 "success": true,
23 "custom_cart_meta": {}
24 },
25 "message": "message",
26 "partial": true,
27 "success": true
28 }
29}