Skip to content

Customer BATCH creation

Request

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

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

File with data for insert must be in JSONL (jsonlines) format. Each line must contain one customer in JSON format. Maximum size of file is 100MB. The base structure of a JSON row contains 2 main parameters settings and data.

The settings parameter:

Both fields are optional and apply to this row only - they have the same names as the query parameters on the Creation of customer endpoint:

  • sendRegistrationEmail - optional, default false. Set to true to send the registration e-mail for this row.
  • suppressMandatoryFieldsCheck - optional, default false. Set to true to skip mandatory fields checking for this row.

The data parameter:

Structure of the data parameter is the same as the structure of JSON for single Creation of customer endpoint, plus one batch-only addition: data.account.language - optional, preferred customer language. Affects, among other things, the language of the registration e-mail. Falls back to the shop's default language if not set. The row fails with an error if set to an invalid language.

See Customer batch create schema for more details.

The asynchronous job processes the JSONL file row by row and tries to validate and save the data. If there is any error, the row is skipped and the error is logged, but it does not stop the processing of other rows. In the log, every customer is identified by its position in the file (starting from 1).

Security
shoptetAccessToken or shoptetPrivateApiToken
Bodyapplication/json
batchFileUrlPathstringrequired

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

curl -i -X POST \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/customers/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" } }