addCartItems
is responsible for adding new items to an existing shopping cart. It only adds non-existing products to the cart, skipping items that are already in the cart.
Arguments
input
: CartItemsAddInput!
The input
object contains the unique identifier (ID) for the cart and the items that need to be added.
Returns
Any requested field from the CartResponse
object.
Examples
{
"input": {
"id": "{{cartId}}",
"items": {
"amazonCartItemsInput": [{
"quantity": 1,
"productId": "{{productId}}"
}],
"shopifyCartItemsInput": [{
"quantity": 1,
"variantId": "{{variantId}}"
}]
}
}
}
mutation ($input: CartItemsAddInput!) {
addCartItems(input: $input) {
id
buyerIdentity {
firstName
lastName
address1
address2
city
provinceCode
countryCode
postalCode
email
phone
}
stores {
... on AmazonStore {
store
cartLines {
quantity
product {
id
}
}
offer {
subtotal {
value
displayValue
currency
}
margin {
value
displayValue
currency
}
notAvailableIds
shippingMethods {
id
label
price {
value
displayValue
currency
}
taxes {
value
displayValue
currency
}
total {
value
displayValue
currency
}
}
}
}
... on ShopifyStore {
store
cartLines {
quantity
variant {
id
}
}
offer {
subtotal {
value
displayValue
currency
}
margin {
value
displayValue
currency
}
notAvailableIds
shippingMethods {
id
label
price {
value
displayValue
currency
}
taxes {
value
displayValue
currency
}
total {
value
displayValue
currency
}
}
}
}
}
}
}