Draft Order API

Solved
abdul81
Excursionist
13 1 0

We have developed a Shopify app and working on adding new features.

 

For our latest feature in development, we are using draft order api and creating draft orders and redirecting user to draft checkout preview.

 

Feature: User add the products to cart our server creates a draft order and redirects customer to draft checkout.

 

There are 2 cases:

 

Case1: Customer completes the checkout, draft order will automatically be completed and order is created. (pretty straight forward.)

 

Case2: Customer abandoned the checkout, now the draft order is appearing in Shop admin as open. (This is where we are stuck and unable to find any API solution).

 

Question Based on Case 2. Is there a way to delete that particular draft order if customer abandoned the checkout? so merchant don't see tons of open draft order and app cleans up every-time when there is an Abandoned draft checkout created by the app. We don't see any webhook or api related to that. If someone direct us in right direction that will really be helpful.

 

Best Regards

Product Manager at Developer's Capital

Accepted Solution (1)

Accepted Solutions
abdul81
Excursionist
13 1 0

This is an accepted solution.

Since the app creates draft order and redirect user to draft checkout in run time (same time when the draft order is created) the best solution is to subscribe to draft/order_create topic and after redirecting the user to checkout delete the open draft order, customer can still checkout. This is the best solution we can develop so-far. Hope this helps someone.

 

Thanks

Product Manager at Developer's Capital

View solution in original post

Replies 2 (2)
abdul81
Excursionist
13 1 0

Just adding a reply so the topic don't die, We are still knee deep in mud with this. If any can give an idea of direct us in a right direction (Any API solution) That's would be very helpful

 

Thanks

Product Manager at Developer's Capital

abdul81
Excursionist
13 1 0

This is an accepted solution.

Since the app creates draft order and redirect user to draft checkout in run time (same time when the draft order is created) the best solution is to subscribe to draft/order_create topic and after redirecting the user to checkout delete the open draft order, customer can still checkout. This is the best solution we can develop so-far. Hope this helps someone.

 

Thanks

Product Manager at Developer's Capital

View solution in original post