Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

How can I delete or invalidate a checkout URL using the storefront API?

asmerkin
Shopify Partner
15 1 1

I'm creating some checkout using the Storefront API. Everything seems to work well, and I get the webUrl along with the ID. 

Now, I need some checkouts to expire after 5 minutes (as an example), or sometimes I need to invalidate some checkout URLs, but I don't see a clear way to do this in the Storefront API docs. 

Is there a way to invalidate a checkout? 

 

Thank you so much! 

Replies 7 (7)

kneeki
Shopify Partner
23 2 4

Have you looked into closing an order? This can't be done using the Storefront API and requires a Server accessing the Admin API.

---
asmerkin
Shopify Partner
15 1 1
As far as I know, creating a checkout via Storefront does not create an
order in the admin. It does not create a draft order.

Is there any other solution?
--
--
============== Andrés Smerkin Lead Developer Riess Group
support@riessgroup.com
https://riessgroup.com
866-209-8484 Toll Free
kneeki
Shopify Partner
23 2 4

Well, is it an app that you're building that keeps track of the checkout id? If so, couldn't you just forget the Id and request new?

---
asmerkin
Shopify Partner
15 1 1
The problem is that the checkout url is given to the customer in an email.
So I want it to expire after a few minutes. I need to invalidate a checkout
after few minutes. Maybe I could remove all line items after X minutes, but
I don't think that is allowed.
ameliabennet
Shopify Partner
4 0 0

Did you find a solution for this?  

asmerkin
Shopify Partner
15 1 1

Sadly, no.

 

ameliabennet
Shopify Partner
4 0 0

Ah that's unfortunate! Thanks anyway