Update products

Products can be updated from the user interface, as well as programmatically from the Product Library API, as described in the following.

Note: A product contains maximum 99 variants.

Prerequisites

  • Authorisation setup with the correct scope, and a valid authorisation token. See Product library concept.
  • Required access right: READ:PRODUCT, WRITE:PRODUCT.
  • The UUID for the product(s) to update. See Fetch products.

Update a single product

This request updates a single product in the product library for a specific merchant's organisation. The organisation UUID is provided through the access token in the request header.

1
PUT /organizations/self/products/v2/{productUuid}

This request updates a product entity using the JSON merge patch (https://tools.ietf.org/html/rfc7386). This means that only included fields will be changed. Null values removes the field on the target entity. Values other than null updates the field. Uses the same format as POST /organizations/self/products.

The method supports conditional requests through the If-None-Match HTTP request header. This means the server will update the product only if it doesn't have an ETag matching the one provided. If the precondition is fullfilled, the product is updated. Otherwise a 412 (precondition failed) response with an empty body is returned.

Example: This request updates the name and description for a "scarf" product with the UUID ea0996a9-2c0b-1aa5-8a00-3831795b0ddb. The response returns a 200 OK message, with updated fields.

Request

1
PUT /organizations/self/products/v2/ea0996a9-2c0b-1aa5-8a00-3831795b0ddb

Request body

1
{
2
"uuid": "ea0996a9-2c0b-1aa5-8a00-3831795b0ddb",
3
"name": "Scarf knitted",
4
"description": "Knitted soft scarf",
5
"variants": [
6
{
7
"uuid": "f27719a8-fca2-1f1d-b183-41a8ce556a12",
8
"name": "Knitted super soft scarf",
9
"description": "Grey knitted scarf, one size"
10
}
11
]
12
}

Response

1
{
2
{
3
"uuid": "ea0996a9-2c0b-1aa5-8a00-3831795b0ddb",
4
"categories": [],
5
"name": "Scarf knitted",
6
"description": "Knitted soft scarf",
7
"imageLookupKeys": [],
8
"variants": [
9
{
10
"uuid": "f27719a8-fca2-1f1d-b183-41a8ce556a12",
11
"name": "Knitted super soft scarf",
12
"description": "Grey knitted scarf, one size",
13
"sku": null,
14
"barcode": null,
15
"price": null,
16
"costPrice": null,
17
"vatPercentage": "20",
18
"options": null,
19
"presentation": null
20
}
21
],
22
...
23
}
24
}

Bulk update of products

Updating a large amount of product information can be done from the Zettle user interface using an Excel or CSV file. With some limitations, the import endpoint can also be used for bulk actions such as creating or updating products.

1
POST /organizations/self/import/v2

You can add up to 2,000 products per request. The endpoint should only be used for smaller libraries, with less than 10,000 daily changes.

Note: Every product and product variant must have a unique UUID. Make sure that the product library to which you will import doesn't include product and variants with the same UUIDs as the product and variant that is to be imported.