createCart

Create a new shopping cart with the specified items from Amazon and/or Shopify stores. Allows users to add products (for Amazon) or product variants (for Shopify) along with their quantities to a new cart.

Arguments

input : CartCreateInput!

The input object contains items with their quantities and optionally the identity of the buyer.


Returns

CartResponse.*: CartResponse

Any requested field from the CartResponse object.


Examples

{
    "input": {
        "items": {
            "amazonCartItemsInput": [{
                "quantity": 1,
                "productId": "{{productId}}"
            }],
            "shopifyCartItemsInput": [{
                "quantity": 1,
                "variantId": "{{variantId}}"
            }]
        },
        "buyerIdentity": {
            "firstName": "{{firstName}}",
            "lastName": "{{lastName}}",
            "email": "{{email}}",
            "phone": "{{phone}}",
            "address1": "{{address1}}",
            "address2": "{{address2}}",
            "city": "{{city}}",
            "provinceCode": "{{provinceCode}}",
            "countryCode": "US",
            "postalCode": "{{postalCode}}"
        }
    }
}
mutation ($input: CartCreateInput!) {
    createCart(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
                        }
                    }
                }
            }
        }
    }
}