简体   繁体   中英

How to retrieve orders list from Square using Square API V2

I'm attempting to get a list of recent transactions/orders from the Square Connect API V2 that lists out exactly what was purchased.

I tried the suggestion posted here: How to retrieve Square orderIds for Call to BatchRetrieveORders

and received the error "Provided merchant_id and merchant_id in authorization do not match up."

I also attempted "v2/locations/(locationID)/orders/batch-retrieve" and received the error:

     {
  "success": false,
  "message": {
    "resource_bundle_name": "com.squareup.webservice.WebserviceMessages",
    "key": "there.was.a.problem.processing.this.request",
    "arguments": []
  },
  "debug_info": ""
}

I am able to get a list of transactions, but it isn't useful to me without the item information.

I'm using a personal account with the Personal Access Token.

This looks like a well-handled error in terms of its messaging. I suspect that the error message is telling you what you need to know. From this post , a Square employee mentioned that the cause is likely that you are:

using OAuth credentials for one merchant but attempting to retrieve data for another merchant. For example, if you have OAuth tokens for merchant A with location B but try to list payments for location token X that belongs to a different merchant Y, you will get this error.

You should validate that the token you're using is correct for the merchant you're trying to retrieve data for. If you're certain it's correct, I'd reach out to Square directly as there may be an issue with this token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM