Skip to content

Pagination in inventory report #113

Answered by yberezkin
ej-codex asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @ej-codex - not sure you looking exactly for that - but this is my own usage of that endpoint with pagination. If you have any questions - don't hesitate to ask.

    fba_inventory = []
    count = 1
    print('get_inventory_summary_marketplace: ', count)
    response = Inventories(credentials=credentials).get_inventory_summary_marketplace(details=True)
    fba_inventory.extend(each for each in response.payload.get('inventorySummaries', []))
    next_token = response.pagination.get('nextToken', None)
    while next_token:
        count += 1
        print('get_inventory_summary_marketplace: ', count)
        response = Inventories(credentials=credentials).get_inventory_summary_marketplace

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ej-codex
Comment options

@yberezkin
Comment options

Answer selected by saleweaver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants