logo
Here we can create products groups and add products to product group. In addition, we can set the default VAT value for all products as well as a value other than the default value for a given product.

Table of contents

Glossary

Name
Explanation
name
name of product group

POST - create new product group. Id will be generated

In order to create new product group use POST /api/v1/pricing/integrations/auth-required/product-group. The sequence diagram below shows the process:
Image without caption
Example request:
json
curl -X POST "https://api-preprod.one.unity.pl/api/v1/pricing/integrations/auth-required/product-group" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d "{ "name": "VIP group" }
In response you will receive productGroupId which should be saved.
Example response:
json
{ "productGroupId": "6bade70a-e943-46ce-8625-ba8a00356859", "name": "VIP group" }

PUT - add products to product group

In order to add products to product group use PUT /api/v1/pricing/integrations/auth-required/product-group/{id}/products. The diagram below shows the dependence of communicating with the API:
Image without caption
Use the parameter in query below to add selected products to product group:
  • id
Example request:
json
curl -X PUT "https://api-preprod.one.unity.pl/api/v1/pricing/integrations/auth-required/product-group/6bade70a-e943-46ce-8625-ba8a00356859/products" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d "[ "SKU1", "SKU2", "SKU3", "SKU4" ]

PUT - assign products tax value

By default, 23% VAT is set for all products. It is possible assign a different percentage to a selected product. Use for this purpose PUT /api/v1/pricing/integrations/auth-required/products/tax. The diagram below shows the dependence of communicating with the API:
Image without caption
Example request:
json
curl -X GET "https://api-preprod.one.unity.pl/api/v1/pricing/integrations/auth-required/products/tax" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d "{ "taxes": [ { "productId": "SKU1", "tax": 8 }, { "productId": "SKU2", "tax": 5 } ] }