Skip to content

Discount coupons template products update

Request

Replaces the list of specific products assigned to the discount coupon template as per entered guid, and switches its productSelectionMode to specificProducts. An empty productGuids array clears the list, so the coupon matches no products. Does not affect the template's title, customer group, categories, brands or product flags. If successful, returns the code 200 with the updated product list and the template's productSelectionMode.

If the discount coupon template does not exist within the e-shop, a 404 code is returned.

If the discount coupon template is a system type template, a 409 code is returned.

Security
shoptetAccessToken or shoptetPrivateApiToken
Path
guidstringrequired

discount coupon template guid

Example:b6e09a7a-6cb5-11eb-89aa-08002746ad91
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataobjectrequired
curl -i -X PUT \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/discount-coupons/templates/b6e09a7a-6cb5-11eb-89aa-08002746ad91/products \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "data": {
      "productGuids": [
        "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed"
      ]
    }
  }'

Responses

OK

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