We can create customer groups and assign individual customers to them.
Table of contents
Table of contentsGlossaryPOST - create new client group. Id will be generatedPUT - attach Client to group
Glossary
Name | Explanation |
clientsInGroup | identifier of clients in group |
name | name of group |
clientGroupId , groupId | identifier of clients group |
clientId | identifier of client |
POST - create new client group. Id will be generated
In order to create new client group use POST
/api/v1/pricing/integrations/auth-required/client-group
. The sequence diagram below shows the process:
Example request:
jsoncurl -X POST "https://api-preprod.one.unity.pl/api/v1/pricing/integrations/auth-required/client-group" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d "{ "name": "VIP group" }
In response you will receive
clientGroupId
which should be saved.Example response:
json{ "name": "VIP client" }
PUT - attach Client to group
In order to add Client to group use PUT
/api/v1/pricing/integrations/auth-required/client-to-groups
. The diagram below shows the dependence of communicating with the API:Example request:
jsoncurl -X PUT "https://api-preprod.one.unity.pl/api/v1/pricing/integrations/auth-required/client-to-groups" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d "[ { "clientId": "org:630e7d91-601c-42d7-83bb-2ed0b47daeb7", "clientGroupId": "bb80c22f-45c7-42ff-b54f-042305da3bca" } ]