Additional information on availability
This article explains how to extend the onhand records in Norce Commerce to provide additional details about product availability in the shop. This could be special notes or where on a shelf the products are in a store.
1 - Add an info type field to onhand records
First you need to create an extra field for the On Hand record in the Admin tool.
- Go to Products - Settings - Info types - Product On Hand and click New .
- Add your new field and remember the code field you choose for later.
2 - Add the specific information from integration
When importing availability information you call ImportOnHands
, providing Norce Commerce with On Hand values and other information. Here you add the extra information as info fields, don't forget to add "Infos" (11) to the header object as well.
[
{
"IsActive": 1,
"LocationCode": "wl_sthlmstore",
"OnhandValue": 3,
"PartNo": "30364",
"WarehouseCode": "w_sthlmstore",
"Infos": [
{
"Code": "WH_ShelfNumber",
"Value": "no 12 (right at the end of the isle)"
}
]
}
]
Note
That you can also manage these extra fields directly in the Admin UI.
If there is any additional information available, you will see three horizontal lines next to the On Hand value. Clicking on it will show you the corresponding information. You can use the "Edit" function to change the values manually.
3 - Fetch info field from Norce Commerce
To fetch the additional information you added to the on-hand records in step 2, you need to use specific on-hand methods provided by Norce Commerce Services. Common methods like GetProduct
return aggregated availability results and do not include the info fields, even though they may be listed in the contract.
To fetch the info fields, you should use either GetProductOnHandByPartNo
or GetProductOnHandByProduct
methods and specify the warehouse and location for the product. Another option is to use ListProductOnHandByBasket
method, which retrieves the information for all products in the basket in one go.
Example for GetProductOnHandByPartNo
:
Request payload
[
{
"_StoreId": "Store id for Stockholm, doesn't need warehouse or location",
"StoreId": 938,
"WarehouseId": null,
"LocationId": null,
"OnHand": null
}
]
Result
{
"ProductId": 77414423,
"Warehouses": [
{
"StoreId": 938,
"WarehouseId": 5652,
"LocationId": 5669,
"OnHand": {
"Value": 3.000,
...
"Info": [
{
"Id": 17,
"Value": "no 12 (right at the end of the isle)",
"Code": "WH_ShelfNumber"
}
]
}
}
],
"Variants": null
}
Then, you can display the added information on the product page, checkout page, or order history page, depending on the use case. In this example, the shelf information might be best shown when the customer is interested in visiting the physical store to buy the product.