I’m working within the Square API to try to re-create the Export Orders option for all online orders. So far, I’m working with the following payload:
let payload = {
"return_entries": false,
"limit": 5000,
"location_ids": ["xxxxx"],
"query": {
"filter": {
"state_filter": {
"states": ["OPEN"]
}
},
"source_filter": {
"source_names": [
"Square Online",
]
},
},
};
This is doing a pretty good job, but a few things don’t seem to be quite right. The IDs associated with each order do not match the format from the raw export (raw export Order ID #s are 10-digit strings, here I’m getting 25 or 29-digit ID values); but the most important thing is the customer_id field, which just isn’t populating in about 70-80% of cases. When I do the online export, I can always get the customer name and email, but I don’t see a clear way to do that if I can’t hit the customers api when I have an order in hand. In Stripe, this would be done simply by “extending” the API queries, which makes it WAY easier to just quickly and simply get the customer info–is there an equivalent version in Square? If not, are there other endpoints I should be looking at?