Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hi,
We create cart with Storefront APIs cartCreate mutation and attach customer to cart with cartBuyerIdentityUpdate mutation. I know I can query cart with cart id, but can i query cart with customer access token or customer email address?
Hi Hmmaen,
Have you been able to create a cart with line items in it? When I do so, the cart is always returned empty.
Yes, with createCart-mutation like:
mutation createCart($cartInput: CartInput) {
cartCreate(input: $cartInput) {
cart {
id
createdAt
updatedAt
lines(first:10) {
edges {
node {
id
merchandise {
... on ProductVariant {
id
sku
}
}
}
}
}
}
}
}
cartInput where merchandiseId value is variants storefrontid:
{
"cartInput": {
"lines": [
{
"quantity": 6,
"merchandiseId": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8zOTgwNTMzMjY1MjIwOA=="
}
]
}
}
That looks remarkably similar to the mutation I'm using, yet I always end up with an empty cart.
Thanks for responding.
User | RANK |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |