[SP-API] getOrders API in production mode always returns HTTP Code 400 - InvalidInput and empty cause


#1

Hi Guy,
My marketplace app (known as Merchize) has just migrated from MWS to SP-API, but when I tests getOrders API in production mode, it always returns HTTP Code 400 - InvalidInput and empty cause details --> I don’t know the reason it failed, please tell me why?

I have tested successful with getOrders API in sandbox mode before.

My request id is b47d6b09-5a9f-43cb-a498-15514fc297f8 that requested at 2022-07-28 06:54 UTC+0.

This is my request details below:
- Request URL: https://sellingpartnerapi-na.amazon.com/orders/v0/orders?CreatedAfter=2022-06-28T13%3A54%3A19%2B07%3A00&OrderStatuses=Unshipped%2CPartiallyShipped&MarketplaceIds=ATVPDKIKX0DER
- Request Headers:
_header: ‘GET /orders/v0/orders?CreatedAfter=2022-06-28T13%3A54%3A19%2B07%3A00&OrderStatuses=Unshipped%2CPartiallyShipped&MarketplaceIds=ATVPDKIKX0DER HTTP/1.1\r\n’ +
‘user-agent: @scaleleap/selling-partner-api-sdk/6.4.0\r\n’ +
‘x-amz-access-token: Atz.sprdt|AYABeHNjZcrPd4iDc7R3TAVkkbAAAAABAAdhd3Mta21zAEthcm46YXdzOmttczp1cy1lYXN0LTE6MzA0NTMyMDIzMjU2OmtleS82ZTc0YTIxMC0zM2YyLTRiNmMtYTRmNi04NjY1OWIyMmMxNzkAuAECAQB4MdNMljpSsG+D02o6N4tL2ZU1vMcomSBBC+9lvGa66m4BH2XQgElHgcSV8/wsffFZ2wAAAH4wfAYJKoZIhvcNAQcGoG8wbQIBADBoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDOVmU2vzKACCEPeDNwIBEIA7G3RgSa8YKgUDty11ol9cjrhqIr7imd9vfL/6aZsBMVnfp4YdldgoA9a5Nm/F8b+sWTbOkAtesJH7L04CAAAAAAwAABAAAAAAAAAAAAAAAAAA+jhQxbBpvfM5E+0i1sy6+f////8AAAABAAAAAAAAAAAAAAABAAAGUyI2ZVyrHhgz7SROdQgLC25GZdEozkRo87hKHF6em/2T/r3X6ZwnIIpFd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ellingpartnerapi-na.amazon.com\r\n’ +
‘X-Amz-Security-Token: IQoJb3JpZ2luX2VjEJ///////////wEaCXVzLWVhc3QtMiJIMEYCIQD+2NzmfanhQgarHT9YffLXvwZBugp01u/JubZiIuanqwIhAJoTaAGeFEMK+YRnotu+EVVOvYo1TKAihUcBzVE3BkVfKqUCCOj//////////wEQARoMMjYxMjA3MTc5MjQxIgx0v31BoZT+gFdNKUkq+QGZuTVK+jsbOH3u2lNU9FWClZFfM+GhcIQdmUS4G59vnw7uuh88T0va9U7GH4TY4tJUZcacLVWYPDVt6yEZaOPHM/1Rg/JbIazv6TPSdjkA7VXX2orLZAhUU48cpC1rRlgw7ULBpQaD785Jl9/o65jygXMTjLnZRCjpc+Id3ckXwDNgv9qOrIQCq50Y+VouM4xgc9lmchVg+2Gj6R+5CbbDOsdpNVweDvcn/HJoNw8ZRucdr4/k1JucZOS2UR5QcQ3Xa6uttsu7YQa3k1wyHRnecBsYro/PGCSYSOYmrFUJE5nS88jDA9zQ3PK8GEXGpXU3AEvo/V7J3mowmOWIlwY6nAFxOCXYV2RyT/Dbt6bLHxCiKoNRxLaGZArPoDFtTdekELVTVNr+P0KQhZFy4srnMRnAp2KePxB5JyfrrqpDPLvVHXiRSuvabM1ATGPejJvut7sD3VpI6a7+zCUwN9VRV1Eip9/P3IUmoG8Rd6WDiXLtq6H7R0pOUzbQz2BbWg2H2lWqfoSDI2RViKXkaJICozKdxTsgDiTjEYoweIs=\r\n’ +
‘X-Amz-Date: 20220728T065419Z\r\n’ +
‘Authorization: AWS4-HMAC-SHA256 Credential=ASIATZUJJH7UUGUPUI6E/20220728/us-east-1/execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-access-token;x-amz-date;x-amz-security-token, Signature=16130ef672a6949ae93976a28a427fa45f43d117260be65aba404640737bd677\r\n’ +
‘Connection: close\r\n’ +
‘\r\n’,

- Request Response:
code: ‘InvalidInput’,
details: ‘’,
requestId: ‘b47d6b09-5a9f-43cb-a498-15514fc297f8’,


#2

So Amazon states on their documentation that they accept ISO8601 formats however it doesn’t look like it accepts the format with time zone. In my testing I was able to get the following formats to work: (based on your date)

  • 2022-06-28T13:54:19Z
  • 2022-06-28T13:54:19
  • 2022-06-28