Items
Item use cases
Below you will find some common use cases for Items. Before you get started please make sure to read up on the minimum requirements for an Item here and that you have a valid token for your service as described here
Add Item
Add Mandatory Item
A mandatory Item is an Item that should be in assortment for all relevant Business Units.
This is the default behavior in Hii Retail. When adding an Item to a Business Unit we explicitly expect the Item to be in assortment. When adding an Item to a Business Unit Group we explicitly set the Item to IN_ASSORTMENT
for ALL underlying Business Units.
There is one exception to this and that is when there is a specific Assortment Policy or Item assignment on a Business Unit Group below.
How to
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To add data you need the
Create
access verb on the role your service is using.
- To add data you need the
- Create the JSON payload as described in the minimum requirements here
- The Item must have
type
set toSTOCK
- Be sure to set the
assortmentType
toIN-ASSORTMENT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - You may also need to add additional information depending on the type of Item and what you want the Item to contain.
- For a complete payload, check out the API examples here
- The Item must have
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
POST
endpoint for sending your data. - You will receive a
202 - Accepted
response if the message was successful. - Please follow the guideline here to create an Additional Item Id (EAN barcode) for this Item
- Please follow the guideline here to create Price Specifications for the Item
Add Non-Mandatory Item
A non-mandatory Item is an Item that should not be in your active assortment, but be available to include if needed.
A non-mandatory Item can be deemed mandatory in other parts of the organization.
How to
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To add data you need the
Create
access verb on the role your service is using.
- To add data you need the
- Create the JSON payload as described in the minimum requirements here
- The Item must have
itemType
set toSTOCK
- Be sure to set the
assortmentType
toAVAILABLE_ASSORTMENT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - You may also need to add additional information depending on the type of Item and what you want the Item to contain.
- For a complete payload, check out the API examples here
- The Item must have
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
POST
endpoint for sending your data. - You will receive a
202 - Accepted
response if the message was successful. - Please follow the guideline here to create an Additional Item Id (EAN barcode) for this Item
- Please follow the guideline here to create Price Specifications for the Item
Replace Item
Updating an existing Item can be done in two ways. Either as a replacement or as an update. A replacement will replace the previous version of the Item with whatever you send to the PUT
API endpoint.
This is important since nothing of the previous version of the Item will be preserved.
How to
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To add data you need the
Replace
access verb on the role your service is using.
- To add data you need the
- Create the complete JSON payload as described in the minimum requirements here
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - You may also need to add additional information depending on the type of Item and what you want the Item to contain.
- For a complete payload, check out the API examples here
- Make sure to set the correct
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
PUT
endpoint for sending your data. - You will receive a
202 - Accepted
response if the message was successful.
Update Item
An update differs from replace since it uses JSON Patch input to modify specific properties on the Item.
This means that the existing Item will remain as it is, except for the provided patches that will be applied to the Item.
How to
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To add data you need the
Update
access verb on the role your service is using.
- To add data you need the
- Create the JSON Patch payload for the properties you want to modify. JSON Patch format is described here
- JSON Patch supports the following operations:
Add
,Remove
,Replace
,Move
,Copy
,Test
. - Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - For a complete payload, check out the API examples here
- JSON Patch supports the following operations:
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
PATCH
endpoint for sending your data. - You will receive a
202 - Accepted
response if the message was successful.
The JSON Patch payload
A JSON Patch payload allows you to do multiple operations on many properties at once, while keeping the existing content on the Item. You can add and remove properties at the same time as you update others.
Details
[
{ "op": "replace", "path": "/name", "value": "New Name" },
{ "op": "add", "path": "/additionalProperties/-", "value": {"Code": "G-22", "DataType": "STRING", "Name": "New Additional Property", "UniqueId": "Acme.CustomProperty10", "Value": "G-22" } },
{ "op": "replace", "path": "/additionalProperties/4", "value": {"DataType": "INT", "Name": "Existing Additional Property", "UniqueId": "Acme.CustomProperty4", "Value": "246" } },
{ "op": "remove", "path": "/description" }
]
Create Deposit Item
A Deposit Item is an Item used to add a reverse vending deposit amount to your sales receipt. Normally you only need one such Item.
How to
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To add data you need the
Create
access verb on the role your service is using.
- To add data you need the
- Create the JSON payload as described in the minimum requirements here
- Make sure the
type
is set toDEPOSIT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - Provide an Item Identifier according to the reverse vending machine specifications in the
identifiers
property - You may also need to add additional information depending on what you want the Item to contain.
- For a complete payload, check out the API examples here
- Make sure the
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
POST
endpoint for sending your data. - You will receive a
202 - Accepted
response if the message was successful. - Please follow the guideline here to create an Additional Item Id (EAN barcode) for reverse vending machines
Move Item into assortment
If an Item is not in assortment for a Business Unit there are a couple of ways to move it into assortment. Below we will cover the most relevant uses cases:
Updating assortment for an individual Item
- The Item must exist prior to this update
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To update data you need the
Update
or theReplace
access verb on the role your service is using.
- To update data you need the
- If you choose to replace the existing Item, make sure to create the complete payload for the Item as you want it represented in your Business Unit. If you update, follow the description here
- Make sure to set the
assortmentType
toIN-ASSORTMENT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - For a complete payload, check out the API examples here (PUT) and here (PATCH)
- Make sure to set the
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Use the
PUT
endpoint for replacing your data. Use thePATCH
endpoint for individual property updates. - You will receive a
202 - Accepted
response if the message was successful.
Updating assortment for several Items at once
To update several Items and moving them into assortment you should use the Assortment Profile input API. This will change the assortment for multiple Items at once.
- The Items must exist prior to this update
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To assign Assortment Policies you need the
Create
,Update
or theReplace
access verb on the role your service is using.
- To assign Assortment Policies you need the
- Create the payload for Assortment Policy. It is important that you include the Items that you want updated to the same assortment in one payload.
- Make sure to set the
assortmentType
toIN-ASSORTMENT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - For a complete payload, check out the API examples here
- Make sure to set the
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- API description can be found here
- OpenAPI specification can be found here
- You will receive a
202 - Accepted
response if the message was successful.
Set age restriction
How to
- Decide if you want to update the Item by replacing the existing content or updating one individual property and follow the provided description accordingly.
- In addition you need to make sure to provide the following details:
- The Additional Property called
Pos.SalesRestrictionCode
must have the code for the age restriction you intend to apply to the Item.
- The Additional Property called
Define replacement Item
A replacement Item is an Item that is intended to take over for an existing Item. This means that if an Item is going out of assortment or is no longer in production, but there is another Item that will take over its place, you would like to automatically find this new Item if a customer asks for it. Likewise you want to find this new item if a customer returns an outdated Item.
Details
- Make sure the old Item is updated to its correct
Status
according to your needs. - Create the new Item according to the procedure found here.
- Create an Item Link between the two items:
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- To create Item Links you need the
Create
access verb on the role your service is using.
- To create Item Links you need the
- Create the payload for Item Link
- Make sure to set the
linkType
toREPLACEMENT
- Make sure to set the correct
businessUnitGroupId
orbusinessUnitId
for the business unit(s) you want this change to a apply to. - For a complete payload, check out the API examples here
- Make sure to set the
- Construct the needed headers for your integration
- Make sure to provide the correct content type for your payload. It must be
application/json
- Make sure your service has the needed access rights to the API endpoints. This is defined by roles in the IAM management.
- Use the
CREATE
endpoint for Item Links. - You will receive a
202 - Accepted
response if the message was successful.