Skip to content

Upload store images

Endpoint: https://api.youcan.shop/store-images/upload

Method: POST

Uploads images to the store image library.

Required Scopes

  • upload-media

Parameters

Send the request as multipart/form-data.

Param NameParam TypeDescriptionRequired
imagesarray of filesImages to upload, up to 20 MB each. Supported types: jpeg, png, gif, webp, avif, heic, heif, svg, ico, bmp, tiffyes

Response

[201] Created

json
[
    {
        "id": "hero-FDuX1LREaDDD96UcPeGhL6ndVBd.jpg",
        "key": "hero-FDuX1LREaDDD96UcPeGhL6ndVBd.jpg",
        "alt": null,
        "src": "https://assets.youcan.shop/stores/5134310c6ac80c36d49d53b1dcb88b443d496d8c/hero-FDuX1LREaDDD96UcPeGhL6ndVBd.jpg",
        "width": 1200,
        "height": 800,
        "mime_type": "image/jpeg",
        "aspect_ratio": 1.5,
        "bytes": 35688
    }
]

A file with an unsupported type is left out of the response. The other files still upload.

[422] Unprocessable Entity

Each store has a 1 GB library. When an upload goes past it, the request stops and returns the images uploaded before that point:

json
{
    "error": "the store image library has reached its size limit",
    "uploaded": []
}