Skip to content

Product category BATCH update

Request

This endpoint allows you to update multiple categories at once. Batch update is processed asynchronously in same way as for example products snapshot, but it does not have resultUrl with categories to download in response. Instead, you can check attribute log which contains successfully updated categories and errors.

See how Asynchronous requests work on our developer's portal.

File with data for update must be in JSONL (jsonlines) format. Each line must contain one category in JSON format. Maximum size of file is 100MB.

Structure of JSON row is same as structure of JSON for single category update above. You can add one extra optional attribute "language" which defines language of updating category, so you are able to update multiple language attributes (i.e. "name", "description" etc.) of one category in one batch file.

If language is not defined, default language of shop is used. See Category batch update schema for more details.

Asynchronous job process jsonl file row by row and try to validate and save data. If there is any error, row is skipped and error is logged, but it does not stop processing of other rows.

In Log, every product is identified by its position in file (starting from 1).

Security
shoptetAccessToken or shoptetPrivateApiToken
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
batchFileUrlPathstringrequired

Url to the batch file with the data to be processed. File must be in JSONL format - one record per line.

Example:"https://cdn.myshoptet.com/batch-data.jsonl"
curl -i -X PATCH \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/categories/batch \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "batchFileUrlPath": "https://cdn.myshoptet.com/batch-data.jsonl"
  }'

Responses

Accepted

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "jobId": "ad24xod" }, "errors": [ { … } ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }