Response format
How SP-API returns response headers and messages.
In response to an HTTP request, the Selling Partner API returns response headers and a JSON response message.
Response headers
Name | Description |
---|---|
Content-Length | Standard HTTP response header. |
Content-Type | Standard HTTP response header. |
Date | Standard HTTP response header. |
x-amzn-RequestId | Request identifier. Include this if you contact us for support. |
Success Response
If your request is successful, the Selling Partner API returns the data requested. Here is an example of a successful response:
HTTP/1.1 200 OK
Content-Length: 368
Content-Type: application/json
Date: Thu, 01 Jun 2020 22:23:31 GMT
x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample
{
"payload": {
"ConfirmedNeedByDate": "2020-04-23",
"ConfirmedFulfillableDate": "2020-04-23"
}
}
Error response
If your request is unsuccessful, the Selling Partner API returns an error response. Here are the elements of the response message in an error response:
Response message
Element | Description | Required |
---|---|---|
code | HTTP status code. | Yes |
message | Explanation of the error condition. | Yes |
details | Link to additional information. | No |
Here is an example of an error response:
HTTP/1.1 400 Bad Request
Content-Length: 117
Content-Type: application/json
Date: Fri, 01 Jun 2020 21:48:02 GMT
x-amzn-ErrorType: ValidationException
x-amzn-RequestId: a8c8d99a-6ab5-11e8-b0f8-19363980175b
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "Access token is missing in the request header."
}
]
}
Updated 12 months ago