Hi Square Dev Team,
We’re encountering an issue when searching for orders using the Search Orders API.
The response sometimes includes multiple versions of what appears to be the same order, but each with a different id. This causes us to store the same order multiple times on our end.
Here are two examples from our recent API response:
Order A
{
"id": "EGLZJbmHhDw9JabgPtMiKwZAzj9YY",
"location_id": "L7V12XD2KYKCC",
"line_items": [
{
"uid": "d4hoCp1kd6irtQovXJlcQB",
"catalog_object_id": "I7V7IUDAHXXISOBQCRNYRD4C",
"catalog_version": 1758094724005,
"quantity": "1",
"name": "Fleece Popover Jacket - Pink & Blue $ Check",
"variation_name": "S",
"base_price_money": { "amount": 7000, "currency": "USD" }
}
],
"fulfillments": [
{
"uid": "NDK73jFVJsbniWRxpMFlrB",
"type": "SHIPMENT",
"state": "PROPOSED",
}
}
],
"created_at": "2025-09-17T08:19:18.355Z",
"updated_at": "2025-09-17T08:43:33.958Z",
"state": "OPEN",
"version": 30,
"reference_id": "468842787"
}
Order B
{
"id": "IKwvRKILEG0BNUBIoJxAPc5YjzSZY",
"location_id": "L7V12XD2KYKCC",
"line_items": [
{
"uid": "XyZTeSnVWObsBsyeQ6XH0B",
"catalog_object_id": "I7V7IUDAHXXISOBQCRNYRD4C",
"catalog_version": 1758094724005,
"quantity": "1",
"name": "Fleece Popover Jacket - Pink & Blue $ Check",
"variation_name": "S",
"base_price_money": { "amount": 7000, "currency": "USD" }
}
],
"fulfillments": [
{
"uid": "j66fll1CvYZblwdUiNs6XC",
"type": "SHIPMENT",
"state": "PROPOSED",
}
}
],
"created_at": "2025-09-17T08:46:46.128Z",
"updated_at": "2025-09-17T08:48:50.026Z",
"state": "OPEN",
"version": 27,
"reference_id": "733284391"
}
Both of these represent the same order in the Square Dashboard — same customer, same products — but they have different id and reference_id values.
We understand that the version field represents updates to the order, but in this case, it looks like two separate order objects entirely.
Question:
How should we determine the actual or canonical order reference when multiple IDs exist for what is clearly the same order? Is there a field or linking identifier we can rely on to group or deduplicate these?