Add product to cart with API from another platform

Hi,

I want to add a particular product/products to a respective (logged-in) user’s cart from another platform like php/laravel.

Is this possible with Shopify?

There’s a couple of things working against you.

  • Carts are not tied to a user but rather a session.
  • There isn’t a cart object exposed via the Admin API.

You could look to approach it in a different way. For example, add a metafield to the customer object with the product details and when they log in, you add that to the cart using the AJAX API.