# Intermittent "Order Not Found" When Fetching Order Details After Receiving Loyalty Event Webhook

**URL:** <https://developer.squareup.com/forums/t/intermittent-order-not-found-when-fetching-order-details-after-receiving-loyalty-event-webhook/23128>\
**Category:** Questions\
**Tags:** orders-api\
**Created:** [July 7, 2025, 7:16am UTC](https://developer.squareup.com/forums/t/intermittent-order-not-found-when-fetching-order-details-after-receiving-loyalty-event-webhook/23128 "2025-07-07T07:16:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![murphyzhang](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@murphyzhang](https://developer.squareup.com/forums/u/murphyzhang)\
**Post date:** [July 7, 2025, 7:16am UTC](https://developer.squareup.com/forums/t/intermittent-order-not-found-when-fetching-order-details-after-receiving-loyalty-event-webhook/23128/1 "2025-07-07T07:16:27Z")

</div>

Hi Square Team,

When I receive **Square Loyalty Event webhooks** , if the event includes an `order_id`, I use this `order_id` to retrieve the order details from Square.

However, I have noticed that sometimes this retrieval **throws an “Order Not Found” exception** immediately after receiving the webhook. If I retry the same request after some time, I am then able to retrieve the order details successfully.

 ![image](https://global.discourse-cdn.com/square/original/2X/f/ff0a47f56afdf5a61bd7d1dae00921ecd33329e4.png)  
 ![image](https://global.discourse-cdn.com/square/original/2X/2/2253cc2649c776171c2cde31041aa639e3a12138.png)  
 ![image](https://global.discourse-cdn.com/square/original/2X/d/dbf5c6a754297d6b9fa8b27eaf19f2259f145cf0.png)

Could you please help me understand:

- Why does this intermittent “Order Not Found” issue occur after receiving a Loyalty Event webhook?
- Is there a recommended delay or best practice for retrieving the order details after receiving the webhook to avoid this issue?

Thank you in advance for your help.

Best regards,  
Murphy

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 7, 2025, 7:16am UTC](https://developer.squareup.com/forums/t/intermittent-order-not-found-when-fetching-order-details-after-receiving-loyalty-event-webhook/23128/2 "2025-07-07T07:16:39Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Loyalty API Example Walkthrough 1](https://developer.squareup.com/docs/loyalty-api/walkthrough1)**
>
> Learn about the Square loyalty program using an example walkthrough.

> **[Orders API](https://developer.squareup.com/docs/orders-api/what-it-does)**
>
> Learn more about processing orders with the Square Orders API.

> **Additional Documentation**
>
> [Retrieve Orders](https://developer.squareup.com/docs/orders-api/manage-orders/retrieve-orders)  
> [Refunds API Webhooks](https://developer.squareup.com/docs/refunds-api/webhooks)  
> [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [July 7, 2025, 6:02pm UTC](https://developer.squareup.com/forums/t/intermittent-order-not-found-when-fetching-order-details-after-receiving-loyalty-event-webhook/23128/3 "2025-07-07T18:02:50Z")

</div>

Hey @murphyzhang! Webhooks get sent out as part of a number of asynchronous server events, which sometimes results in the webhook being dispatched before all objects within its payload are ready to be retrieved. We recommend implementing a retry system to attempt to re-retrieve objects that have not been found after a few seconds delay.
