Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cart API vs. Checkout API #907

Open
zmonteca opened this issue Jul 11, 2022 · 2 comments
Open

Cart API vs. Checkout API #907

zmonteca opened this issue Jul 11, 2022 · 2 comments

Comments

@zmonteca
Copy link

Hello all...

So we have two apps / systems trying to add and update our headless Shopify "cart"...

One part of the app uses the Checkout API and Checkout mutations like checkoutCreate & checkoutLineItemsAdd to create and add to our "cart"

In the other part of the system (adding selling plan subscriptions to our "cart"), we're working with Cart API and Cart mutations like cartCreate & cartLinesAdd to create and add to our "cart".

With the Checkout API, we have things like the checkoutId that we're working with to locate existing sessions and put new "cart" items in the right place.

With the Cart API, we have things like the cartId that we're working with to locate existing sessions and put new "cart" items in the right place.

It seems absolutely incomprehensible that the architects of these two systems created such walled gardens between these two layers that you can't put Cart API lines into a "cart" with the checkoutId in the Checkout API. And vice versa, you can't put Checkout API lineItems into the same "cart" as other Cart API items.

Am I missing something really obvious or big here or is there a reason for keeping these two implementations–Cart & Checkout–completely separate and isolated so they can NOT work together?

@dmytro-kushnir
Copy link
Contributor

They can not work together; those are the different levels of "payment." The cart API is the first "step" of the checkout process. The Checkout API is the second one.

Use the cart API if you want to interact with your Shop store (there is a Cookie called cart that can be synchronized with a cookie on your third-party site). https://github.com/Shopify/js-buy-sdk doesn't support it from the box, but you can always create GRAPHQL Queries.

Use Checkout API if you don't need the first step.

@idank
Copy link

idank commented Dec 25, 2022

Can you please clarify Use the cart API if you want to interact with your Shop store? When would one use the cart API as opposed to just the checkout API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants