BigCommerce REST / GraphQL – Adding item to cart for Customer, but calling the customer’s cart returns null

BigCommerce REST / GraphQL – Adding item to cart for Customer, but calling the customer’s cart returns null


3

Either via using GraphQL or the Rest API, I create a cart for a customer (Either by sending customer_id in REST, or x-bc-customer-id in GraphQL).
GraphQL: Create customer Impersonation Token and Create Cart
Note: There’s also an Assign Cart to Customer mutation, but it only took a cart and didn’t do anything.

REST: Create a Cart (With customer_id)

However, when I try to obtain a cart for a customer using GraphQL and x-bc-customer-id using:

Get a Cart

I find that I only receive null results. As such, I’m not able to obtain the cart ID anymore post cart-creation.


I’ve created 3 links:

/login (Saves the customer ID in a cookie)

/get-cart?cust={CustId} (Gets the customer’s cart, null if one doesn’t exist)

/add-to-cart?part={ProductEntityId} (Creates a cart for the customer ID if cart doesn’t exist, otherwise adds to the existing cart)

My issue is that despite my program creating a cart (Either thru GraphQL or REST), the /get-cart function still returns a null result.

1

  • I have the same problem. Did you already find a solution?

    – N. Richli

    1 hour ago


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *