Responses๏
All endpoints return sp_api.base.ApiResponse with the following signature. payload contains Amazonโs response.
response = Orders().get_orders(CreatedAfter='TEST_CASE_200', MarketplaceIds=["ATVPDKIKX0DER"])
print(response.payload) # original response data
# Access one of `payload`s properties using `__getattr__`
print(response.Orders) # Array of orders
# Access one of `payload`s properties using `__call__`
print(response('Orders')) # Array of orders
# Shorthand for response.payload
print(response()) # original response data
- class sp_api.base.ApiResponse(payload=None, errors=None, pagination=None, headers=None, nextToken=None, **kwargs)๏
Api Response
Wrapper around all responses from the API.
Examples
literal blocks:
response = Orders().get_orders(CreatedAfter='TEST_CASE_200', MarketplaceIds=["ATVPDKIKX0DER"]) print(response.payload) # original response data # Access one of `payload`s properties using `__getattr__` print(response.Orders) # Array of orders # Access one of `payload`s properties using `__call__` print(response('Orders')) # Array of orders # Shorthand for response.payload print(response()) # original response data
- Parameters:
payload โ dict or list | original response from Amazon
errors โ any | contains possible error messages
pagination โ any | information about an endpoints pagination
headers โ any | headers returned by the API
rate_limit โ number | The x-amzn-RateLimit-Limit header, if available
next_token โ str | The next token used to retrieve the next page, if any
kwargs โ any