The payment.update event delayed

Hi,

We are using the payment.updated event to listen to the order created from Square POS, once we receive the event, we call the retrieve order API to get the Square order details. Most of the time it works find, but we found there was a time the retrieve order API doesn’t work as expected.

The order id is qLl2pAdxKUmuY3e2eF62QveeV which is created at: 2023-07-22T21:31:26Z on Square, and we received the payment.updated even for this order at

  1. 2023-07-22T21:31:35.399Z with event: a0be38b0-c2ef-37bb-b2d4-5282c2379808
  2. 2023-07-22T21:31:40.320Z with event: ca8046a5-5328-3fe3-9162-7896c89b3c52
  3. 2023-07-22T21:32:06.320Z with event: 93263ef8-d0e6-3c37-88ff-287e87304e0c

However, each time when our endpoint try to get the order, all returns the error:

body: '{"errors": [{"code": "NOT_FOUND","detail": "Order not found for id qLl2pAdxKUmuY3e2eF62QveeV","category": "INVALID_REQUEST_ERROR"}]}\n',

Since we implemented the retry system for Square webhook, it finally succeeded at 2023-07-22T21:38:39.320Z, which has been delayed almost 7 minutes. It seems the order was not getable durning that time.

Error details:

request: {
    method: 'GET',
    url: 'https://connect.squareup.com/v2/orders/qLl2pAdxKUmuY3e2eF62QveeV',
    headers: {
      'user-agent': 'Square-TypeScript-SDK/15.0.0',
      authorization: 'Bearer xxxxxx',
      'Square-Version': '2021-10-20',
      accept: 'application/json'
    }
  },
  statusCode: 404,
  body: '{"errors": [{"code": "NOT_FOUND","detail": "Order not found for id qLl2pAdxKUmuY3e2eF62QveeV","category": "INVALID_REQUEST_ERROR"}]}\n',
    result: [Object: null prototype] {
      errors: [
        [Object: null prototype] {
          code: 'NOT_FOUND',
          detail: 'Order not found for id qLl2pAdxKUmuY3e2eF62QveeV',
          category: 'INVALID_REQUEST_ERROR'
        }
      ]
    },

Hi @wsdzy2010 ,
I have taken a look, and I can see the webhook events in one application. But in the application that received the 3 webhook events, I did not see API calls regarding qLl2pAdxKUmuY3e2eF62QveeV that had a statusCode of 404. Could you confirm what application id called the Orders API, and can I see screenshots from the Developer Dashboard API logs showing the 404 response?

This is a weird part, I cannot see the 404 logs on dashboard either. But our service did call that API multiple times and it records the Square error returned. In addition, our another service called the search order API at that time, but its response doesn’t have this order as well. I think there might be sth wrong on Square order service.

Screenshots for retrieve order API response:

@wsdzy2010

Taking a look at your Developer Dashboard API logs, I can see that since you have been able to successfully call Retrieve Order.

I am not seeing anything in the logs on my side of the 404 error. I believe it might be a transient issue. Let me know if this has been reoccurring. Feel free to reach out if it happens again in the future.