Skip to content

Update multiple image availabilities at once #3

@initBasti

Description

@initBasti

The plentymarkets API only present the POST route /rest/items/{item_id}/images/{image_id}/availabilities to update a single image availability. Using this to update multiple image availabilities is highly inefficient, as the request limit is reached quickly + it's very slow.
I currently experiment with the PUT route /rest/items/{item_id}/images/{image_id}, which offers the possibility to update multiple availabilities at once, but it has a drawback, namely, it requires the user to provide all existing availabilities as well, because every option that is not mentioned is unset.
This means, that we would have to make a GET request for the item first and then use that data in concatenation with the new data as a request body for the PUT request.

The question is:
Should we check the length of the new data and then split internally between those 2 routes.

Or should we provide two public methods:
plenty_api_set_image_availability (for a single availibility)
plenty_api_set_multiple_image_availabilities (for multiple availabilities)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions