Skip to content

Handle API update actions limit per request #177

@butenkor

Description

@butenkor

Expected behavior

SDK would process update actions in batches if total amount of actions is bigger than 500

Actual behavior

It would POST all actions and run into API error (see below)

Steps to reproduce the behavior

Create more than 500 update actions and call:

client.products.byId("productID").update("payloadObjectWithAListOfUpdateActions")
{ [HttpError: Payload Too Large]
>    message: 'Payload Too Large',
>    body:
>     { statusCode: 413,
>       message: 'The update actions count of 997 exceeds the limit of 500.',
>       errors: [ [Object] ],
>       originalRequest:
>        { endpoint: '/products/88efbf61-c140-458b-97dd-069f763bb592',
>          payload: [Object],
>          options: [Object] } },
>    name: 'HttpError',
>    statusCode: 413,
>    code: 413 } 'Skipping product due to error message: Payload Too Large'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions