I’m building a frontend for a checkout experience, and am planning on storing the Storefront Checkout GraphQL ID in my DB after the Checkout is created. Will this ID be valid forever, or is there some expiry period where the Checkout gets cleaned up in Shopify? Similarly, if an order is placed for that Checkout, will I still be able to fetch the Checkout via the Storefront API?
Thanks!
Hey @chris217 ,
Using the Storefront API, you will only have access to the last incomplete checkout from a customer. (https://shopify.dev/docs/storefront-api/reference/object/customer#lastincompletecheckout-2020-01)
If an order is made from a checkout, it is considered as “completed” from Shopify’s perspective and you will not be able to fetch that Checkout anymore. If an order is not made from it, it is considered “incomplete” or “abandoned”. In this case with the Storefront API you will be able to keep track of a Customer’s last incomplete checkout for about 3 months, before the record of it will be purged from Shopify.
1 Like
Thanks @hassain ! This was just the info I was looking for.
So is it safe to say that checkoutUrl is valid for 30 days?