python-amazon-sp-api icon indicating copy to clipboard operation
python-amazon-sp-api copied to clipboard

next_token for VendorOrders

Open AndreiFAD opened this issue 3 years ago • 0 comments

I couldn't make a test with live api for Sellers side, I tested only with VENDOR Api-s!

for VendorOrders: finally I only changed the ApiResponse, because the next_token_param everybody can change when load the @load_all_pages() function

@throttle_retry()
@load_all_pages(next_token_param='nextToken')
def get_purchase_orders(**kwargs):
    return VendorOrders(credentials=get_amz_credentials(profile_name),
                        marketplace=Marketplaces.XX).get_purchase_orders(**kwargs)

'payload' -> 'pagination' -> 'nextToken'

{'errors': None,
 'headers': {'Date': 'Sat, 13 Aug 2022 21:10:41 GMT', 'Content-Type': 'application/json', 'Content-Length': '54545', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'b906353536a653235535f6c5a583', 'x-amzn-RateLimit-Limit': '10.0', 'x-amz-apigw-id': '235wrty23545235=', 'X-Amzn-Trace-Id': 'Root=1-62f81351-4ac4235233483857837h6e34'},
 'kwargs': {},
 'next_token': None,
 'pagination': None,
 'payload': {'ordersStatus': [],
             'pagination': {'nextToken': 'WzE2NTU2wNzsffk4NDkwMDAsIjM0TzNMTjRYIl0'}},
 'rate_limit': '10.0'}

AndreiFAD avatar Aug 14 '22 17:08 AndreiFAD