Webhook terminal.checkout.created is not found, and terminal.checkout.update is found

This is a new problem as of 2022.06.25 today.

Square is sending webhook for terminal.checkout.updated and payment.updated without terminal.checkout.created. Log has a lot of 500 status errors rather than 200. Of course, I understand webhook will not be in perfect order but more than 25 min. is kind of an issue.

Later terminal.checkout.created is found (reported about 25 to 30 min. later). I can provide Square terminal checkout id to search log on this issue. This is new. So far, I was updating as terminal.checkout.created → terminal.checkout.updated(completed).

Here is my solution. I was inserting terminal.checkout.created by webhook. I will insert from site now, not by webhook.

Has any of you encountered this issue today (well, today is the first time on this issue)?

1 Like

We are experiencing the same issue with Square terminals in our Kiosk installations. 20-30min delays.

Follow ups on this issue.

  1. Insert (data to your host database for webhook) terminal.checkout.created from “POS”, not by webhook. It is possible and verified that Square’s webhook for terminal.checkout.created may send ‘terminal.checkout.created’ after 25 to 30 min. from the initial creation from the site.

  2. Check both [terminal.checkout.updated (COMPLETED)] and [payment.updated (COMPLETED)].

  • For terminal.checkout.updated on COMPLETED, and ‘record on database’ is not found on your online DB, insert. (ex: site lost Internet connection to update online database on initial terminal.checkout.created.)
  • For payment.updated on COMPLETED, and ‘record on database’ is not found on your online DB, read serialized object of payment. This is almost impossible case but it happens. Get string from payment object as [[“terminal_checkout_id” : “TeRmiNaLCHeckoutiDxxYY38_OR_WHATEVER.”]] Insert into your online DB with this checkout id. Remember, we are handling only ‘COMPLETED’ payment here.

There is no way to get “terminal_checkout_id” from payment object. However, you will see “terminal_checkout_id” from developers’ Log on Square developer page. This is the reason why you need to get string from payment object as [[“terminal_checkout_id” : “TeRmiNaLCHeckoutiDxxYY38_OR_WHATEVER.”]]. I wish Square’s payment object include terminal.checkoutID all the time but this is not the case.

This is how I am handling on cases when Square webhook update on payment. If you have better method in coding, please let me know.

:wave: The team was able to identify and resolve the issue. :slightly_smiling_face: