We are having webhook duplicates logged on square side too, can you fix it?

Hi @Bryan-Square, it’s impossible to look for changes if more than 1 notifications are produced at the same time. I think your answers are based on notifications being sent one after the other, so we/any system can look for changes, but the issue is that you can’t look for changes when the notifications are triggered at the same time.

Let me explain with an example to see if we finally get to the root of the issue:

  • Let say you create an order #0342 for 1 chocolate (version 1).
  • 5 minutes later, you enter and add 1 donut (version 2).
  • and 3 minutes later you enter and change your address apt from #4 to #9 (version 3).

If you receive those 3 notifications 1 after the other, it would make sense because you know how the order was created only with 1 chocolate, then you know it was added 1 donut and then the address apt was changed to #9. So, the right order #0342 finally has 1 chocolate, 1 donut and address apt #9.

Now, suppose all 3 notifications at sent the same time, the receiving system gets 3 notifications as this:

  • Order #0342 created. It has 1 chocolate and address apt #4 (version 1).
  • Order #0342 updated. It has 1 chocolate, 1 donut and address apt #4 (version 2).
  • Order #0342 updated. It has 1 chocolate, 1 donut and address apt #9 (version 3).

The issue, as explained before many times, is that these 3 notifications are produced simultaneously, so, there is no time to create any order #0342 before the others, and all 3 duplicates are created exactly at the same time because order #0342 is not found in the system. So, when you say “look for chages” or “when you receceive the first event” or “you can create a filter to look for changes” it’s completely non sense because there is nothing in the system to compare to.

And an additional explanation that may be useful to understand the issue, the payload is “not” coming in the notification, so, the system needs to retrieve the order to get it’s payload, but guess what… all notifications for the different versions are sent “at the same time”, so the retrieved order payload is “the same”, do you get it? How can the different version’s payloads can be retrieved if all notifications are triggered at the same time?

And you could say, if all payloads are the same take the 1st one and ignore the others. But again we fall in the same “none sense” fact of thinking that the system can receive 1 notification before the other, so, again, as in the example, if all notifications are produced simultaneously, the receiving system has no time to create/save the 1st record to compare to the next ones, so when 3 notifications are received simultaneously and there is nothing yet in the system the only option for the system is to create 3 different orders for the same Square order. Again, because all notification come simultaneously and none came before the others.

Is it clear now?