Problem with Amazon SP-API: Invalid query parameter [marketplaceIds] Error Persists

Describe the problem/error/question

I’m encountering a persistent 400 Bad Request error when trying to fetch FBA inventory summaries from the Amazon Selling Partner API (SP-API) using n8n’s HTTP Request node.

Despite my troubleshooting, the API consistently returns the same error message, indicating that the marketplaceIds query parameter is invalid, even after I’ve removed it from the node’s configuration.

Here is the error message I’m getting:

{
  "errorMessage": "Bad request - please check your parameters",
  "errorDescription": "This is an invalid input",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - \"{\\n  \\\"errors\\\": [\\n    {\\n      \\\"code\\\": \\\"InvalidInput\\\",\\n      \\\"message\\\": \\\"This is an invalid input\\\",\\n      \\\"details\\\": \\\"Invalid query parameter [marketplaceIds] value entered. \\\"\\n    }\\n  ]\\n}\""
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "Inventory US",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 4,
    "itemIndex": 0,
    "time": "9/3/2025, 5:49:29 PM",
    "n8nVersion": "1.107.4 (Cloud)",
    "binaryDataMode": "filesystem"
  }
}

What is the error message (if any)?

As above.

Please share your workflow

Share the output returned by the last node

400 - “{\n \“errors\”: [\n {\n \“code\”: \“InvalidInput\”,\n \“message\”: \“This is an invalid input\”,\n \“details\”: \“Invalid query parameter [marketplaceIds] value entered. \”\n }\n ]\n}”

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Windows 11
    

Hey @WalterLin

It probably happens even if you remove the marketplaceIds because marketplaceIds is a required field (so as granularityType and granularityId).

In any way, is there a successful curl request that works for you (just so we know that the parameters you pass are correct)?

2 Likes

Hey @jabbson

Thank you so much for your reply! Your insight gave me a crucial new direction to think in, and I’ve finally solved the problem.

The final solution was:

The issue was not with the parameters themselves, but with how n8n processes them. When I disabled the “Send Query Parameters” option in the HTTP Request node and instead put all the parameters (including both marketplaceIds and granularityId) directly into the URL, the request was successful!


Successful URL example:

https://sellingpartnerapi-na.amazon.com/fba/inventory/v1/summaries?details=true&granularityType=Marketplace&granularityId=ATVPDKIKX0DER&marketplaceIds=ATVPDKIKX0DER&pageSize=50

It appears that the Amazon SP-API is very strict about URL formatting, and n8n’s parameter handling might have been creating a format that the API didn’t expect.

Thanks again for the inspiration. Without your tip, I might still be stuck. This will be very helpful for me and for anyone else running into the same issue!:smiley:

1 Like