I’m planning to integrate a website with eBay using PHP, but first I’m using Postman to test everything.
Authorization took me an entire day, but I think I’ve got it working now. (I had to update to the latest version of Postman, then I got it to create a token for me.)
I say I think because I haven’t managed to get a single request to work. I deliberately chose bulkGetInventoryItem (documentation) as it seemed like one of the easier authorized requests to get working. I just know that when the authentication settings are wrong, I get a different error message to when they are right.
For troubleshooting reasons, I made a token with all the scopes:
- https://api.ebay.com/oauth/api_scope
- https://api.ebay.com/oauth/api_scope/sell.marketing
- https://api.ebay.com/oauth/api_scope/sell.inventory
- https://api.ebay.com/oauth/api_scope/sell.account
- https://api.ebay.com/oauth/api_scope/sell.fulfillment
- https://api.ebay.com/oauth/api_scope/sell.finances
- https://api.ebay.com/oauth/api_scope/sell.payment.dispute
- https://api.ebay.com/oauth/api_scope/commerce.identity.readonly
(added as space-separated list of links)
I have changed one of the eBay listings to have an SKU of “123456” just for this test, however the error I get is exactly the same as if I change "sku": "123456"
to "sku": "anObviouslyFakeSKU"
, but anything else I change creates a new error, so I’m suspecting the issue to be SKU related, but maybe it isn’t. (I’ve found the eBay API to be very poor at sending relevant error messages.)
I’m quite new to Postman, so it’s likely a rookie mistake.
Earlier errors have shown to be minor punctuation issues or wrong radio buttons ticked, so hopefully whatever the error is this time, it should appear in this screenshot.
What did I do wrong this time? (Let me know if there are any other screenshots I can send that might help.)
To help, both with the post’s SEO, and ease of copy/pasting, I am transcribing the important text in the screenshot above:
url
POST https://api.ebay.com/sell/inventory/v1/bulk_get_inventory_item
body, raw
{
"requests": [
{
"sku": "123456"
}
]
}
output
{
"errors": [
{
"errorId": 2003,
"domain": "ACCESS",
"category": "APPLICATION",
"message": "Internal error",
"longMessage": "There was a problem with an eBay internal system or process. Contact eBay developer support for assistance",
"parameters": [
{
"name": "reason",
"value": "Failed to transform underlying error response, see logs."
}
]
}
]
}
2
Answers
I figured out the issue. My biggest mistake was choosing
bulkGetInventoryItem
as the "simplest" call. I should have chosengetInventoryItem
, as the error reporting on that function is far more user friendly.So the error I got, for exactly the same request was "We didn't find the entity you are requesting. Please verify the request"
A quick google of the error found me this page https://forums.developer.ebay.com/questions/17883/cannot-get-my-listed-product-by-get-inventory-api.html which led me to the correct answer!
The inventory item I was trying to access was unreachable because it was not created through the developer API.
I hope this answer helps others, as it wasted a full day of my life trying
getInventoryItem
before tacklingbulkGetInventoryItem
.A few things you need to check for in Postman.
When you authenticate and receive a token are you posting that token with your api calls like this one
POST https://api.ebay.com/sell/inventory/v1/bulk_get_inventory_item
?Have you set the Authorization HTTP header for authentication authorization?
Have you set the Content-Type header for the call to
application/json
?More info here: https://developer.ebay.com/api-docs/sell/inventory/resources/inventory_item/methods/bulkGetInventoryItem
Update
Authorization with environment variable in Postman:
Postman environment variables documentation:
https://learning.postman.com/docs/postman/variables-and-environments/variables/