Order Deletion Webhook

68 views
Skip to first unread message

Ryan Alyea

unread,
Sep 27, 2012, 7:01:11 PM9/27/12
to shopify-a...@googlegroups.com
Hey there Shopify API Team,

Is there a method to detect deleted orders? (Orders were the shopowner clicks the trash icon.) As of right now, there does not appear to be, as deleted orders are hidden from the API. That's all well and good, but DeepMine never gets the information that the order was deleted so it still shows those deleted orders as valid.

* An order/deletion webhook
* Orders.json?status=deleted page.

(Alternatively, you can just remove the ability to delete orders and use the cancellation feature, it's definitely better.)

Edward Ocampo-Gooding

unread,
Sep 28, 2012, 1:02:35 PM9/28/12
to shopify-a...@googlegroups.com
Hey Ryan,

Fair point – we’ll investigate and see what makes the most sense.

--
 
 
 

Edward Ocampo-Gooding

unread,
Sep 28, 2012, 1:08:54 PM9/28/12
to shopify-a...@googlegroups.com
Hey Ryan,

We’ve added having an order/delete webhook to our list of future features. It should be pretty straightforward.

Look for it announced in an upcoming notice here and in a dev newsletter.

Yan Sarazin

unread,
Oct 1, 2012, 11:01:27 AM10/1/12
to shopify-a...@googlegroups.com
Looking forward to this as well.

On Fri, Sep 28, 2012 at 1:08 PM, Edward Ocampo-Gooding <edw...@shopify.com> wrote:
Hey Ryan,

We’ve added having an order/delete webhook to our list of future features. It should be pretty straightforward.

Look for it announced in an upcoming notice here and in a dev newsletter.


On Fri, Sep 28, 2012 at 1:02 PM, Edward Ocampo-Gooding <edw...@shopify.com> wrote:
Hey Ryan,

Fair point – we’ll investigate and see what makes the most sense.


On Thu, Sep 27, 2012 at 7:01 PM, Ryan Alyea <ry...@fangamer.com> wrote:
Hey there Shopify API Team,

Is there a method to detect deleted orders? (Orders were the shopowner clicks the trash icon.) As of right now, there does not appear to be, as deleted orders are hidden from the API. That's all well and good, but DeepMine never gets the information that the order was deleted so it still shows those deleted orders as valid.

* An order/deletion webhook
* Orders.json?status=deleted page.

(Alternatively, you can just remove the ability to delete orders and use the cancellation feature, it's definitely better.)

--
 
 
 


--
 
 
 

Ryan Alyea

unread,
Oct 1, 2012, 11:17:44 PM10/1/12
to shopify-a...@googlegroups.com
Awesome about the webhooks.

But what about when/if webhooks fail? (Not even on the Shopify side, but events such as when AWS does it's tri-monthly fail.) DeepMine's fall back is to download the entire order history. Ugly, but it works to keep everything up-to-date. When downloading the entire history, it doesn't delete DeepMine's entire history and start over again, it just checks for changes and updates those. During that process, deleted orders are nowhere in the order history it downloads from Shopify, and it doesn't update those, even though it should.

There needs a method to see historically deleted orders. If it just simply returned the order id of deleted orders, I can delete those lingering in my database from broken webhooks.

John Duff

unread,
Oct 2, 2012, 3:52:30 AM10/2/12
to shopify-a...@googlegroups.com
Isn't the fact that it isn't in the whole download the exact same thing?

John Duff
Software Developer @ Shopify

Sent from my iPhone
--
 
 
 

Ryan Alyea

unread,
Oct 2, 2012, 4:17:35 AM10/2/12
to shopify-a...@googlegroups.com
Not really, since how whole order downloads work. It needs download all for "financial_status" = "any", then "financial_status" = "abandoned", "financial_status" = "refunded", "financial_status" = "voided". (There's no singular download for "give me ALL orders, regardless of status".) Those are then counted and their page numbers are then set to individual jobs. Because if one job fails, it's most likely hit an API limit, which is very possible on very large stores.

If there's no need to worry about deleted orders, it just happily downloads from all four categories, where one [financial_status,page] == one job. They have no dependency, no tracking, no worries. Just simple downloading.

Now there's a dependency: There is now a job that needs to wait for it's download jobs to get done. The download jobs need to be tracked (like a download_job_id), and we job has to track [download_job_id,order_id]. Then it needs to look at all order_ids and find the missing one. When there are stores with 500,000+ orders, finding the missing one becomes troublesome... if there even is a missing one.

It's much easier to have a fifth category then an entire architecture devoted to find the missing needle in a distributed haystack.

I shutter at the fact that I have no information on deleted orders, and if one of my 500,000+ order stores needs to know where the missing order is, that's horrific. I can't just download a half million orders just to find the missing one.

John Duff

unread,
Oct 2, 2012, 7:43:56 AM10/2/12
to shopify-a...@googlegroups.com
So, you're actually over complicating your download logic right now. Financial_status=any will find orders with financial status set to anything, abandoned will find orders without a financial status. Those are the two queries you would need to find all the orders.

If you already need todo this then determining if orders have been deleted is trivial. Use since id or created_at_min and keep track of where you are with that. You can then make anything that wasn't downloaded and is older then the latest as deleted.

I don't think you will need to do that though since deleting orders is fairly rare and the webhook should cover you.

Maybe there is a case for needing to download all the deleted orders, but it really doesn't seem that useful to me.

Anyways, I will keep it in mind and we can look into doing it down the road.


John Duff
Software Developer @ Shopify

Sent from my iPhone
--
 
 
 

Ryan Alyea

unread,
Oct 4, 2012, 2:39:10 AM10/4/12
to shopify-a...@googlegroups.com
API documentation says: "any - Show all authorized, pending, and paid orders (default). Will not return abandoned orders.". It may need to be updated to include "refunded" and "voided".

Reply all
Reply to author
Forward
0 new messages