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
- 2023-07-22T21:31:35.399Z with event: a0be38b0-c2ef-37bb-b2d4-5282c2379808
- 2023-07-22T21:31:40.320Z with event: ca8046a5-5328-3fe3-9162-7896c89b3c52
- 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'
}
]
},