cart-token and checkout-token

Highlighted
Shopify Partner
3 0 2

I'm writing a function that will put an order to Shopify through the API.  I don't know how the cart-token and checkout-token are generated on the Shopify side when an order is created.  Does anyone know how I can set those to be generated by Shopify when the order is put?

2 Likes
Highlighted
Shopify Staff
Shopify Staff
93 0 16

Can you provide a few more details on what you're trying to do?

Creating orders through our Order API won't require you to worry about either of these tokens as these are generated on Shopify's side for each action (cart creation and checkout creation, neither of which happen when creating only an order). 

1 Like
Highlighted
Shopify Partner
3 0 2

I'm trying to use the API for the company I work for, which can create an order, then push that order to the Shopify API.  

0 Likes
Highlighted
Shopify Staff
Shopify Staff
93 0 16

Great, so you don't need to worry about those tokens :) You can create the Orders directly through the Order API 

0 Likes
Highlighted
New Member
1 0 0

As you mentioned cart_token is generated on Shopify side. I just want to know that if this token remains same all the time when one add to cart from a specific store or changes after some time. Is there any expiry for this cart_token?

0 Likes
Highlighted
Shopify Partner
50 5 21

If you use Order API, you will have to:

 

  1. Calculate taxes based on billing address (quite hard)
  2. Calculate appropriate shipping rates (quite hard)

So you can't just simply create Orders without doing a BUNCH more work on other (unrelated) things. The checkout API neatly calculates taxes and appropriate shipping rates for you.

If these were supported in the Order API, it would be lovely though. This is by far my biggest pain point in the Order API.

0 Likes