# The payment.update event delayed

**URL:** <https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068>\
**Category:** Questions\
**Tags:** orders-api, payments-api, webhooks-api\
**Created:** [July 24, 2023, 5:19pm UTC](https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068 "2023-07-24T17:19:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsdzy2010](https://avatars.discourse-cdn.com/v4/letter/w/58f4c7/32.png) [@wsdzy2010](https://developer.squareup.com/forums/u/wsdzy2010)\
**Post date:** [July 24, 2023, 5:19pm UTC](https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068/1 "2023-07-24T17:19:50Z")

</div>

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:

```auto
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'
        }
      ]
    },

```

---

<div class="post-metadata">

**Author:** ![Lance-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/lance-square/32/2704_2.png) [@Lance-Square](https://developer.squareup.com/forums/u/Lance-Square)\
**Post date:** [July 24, 2023, 10:37pm UTC](https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068/2 "2023-07-24T22:37:36Z")

</div>

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](https://developer.squareup.com/apps) API logs showing the 404 response?

---

<div class="post-metadata">

**Author:** ![wsdzy2010](https://avatars.discourse-cdn.com/v4/letter/w/58f4c7/32.png) [@wsdzy2010](https://developer.squareup.com/forums/u/wsdzy2010)\
**Post date:** [July 25, 2023, 5:08pm UTC](https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068/3 "2023-07-25T17:08:07Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/square/original/2X/3/3739635584d0e4f710b87aa42ec90f1fdd807366.png)

---

<div class="post-metadata">

**Author:** ![Lance-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/lance-square/32/2704_2.png) [@Lance-Square](https://developer.squareup.com/forums/u/Lance-Square)\
**Post date:** [July 25, 2023, 10:59pm UTC](https://developer.squareup.com/forums/t/the-payment-update-event-delayed/10068/5 "2023-07-25T22:59:10Z")

</div>

@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.
