Build your own custom StockLevelProvider
- 23 Feb 2024
- 1 Minute to read
- Print
- DarkLight
Build your own custom StockLevelProvider
- Updated on 23 Feb 2024
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Create an apex class that implements the welisacommerce.IStockLevelProvider interface. To configure the new apex class:
- Go to Salesforce setup -> Custom Metadata Types -> Plugin Registrations -> 'Manage Records'.
- Click 'New' and enter the name of the custom implementation.
- Save.
Field label | Type | Description |
---|---|---|
Label | Text | The user friendly name of the registration |
Plugin Registration Name | Text | The technical name of the registration |
Class Name | Text | The class name of the custom implementation class |
Plugin | Reference | The specific plugin which the custom class implements |
IStockLevel Method signature
GetStockLevelResponse getStockLevels(GetStockLevelRequest request);
GetStockLevelRequest properties
Property name | Type | Description |
---|---|---|
productIds | Set(Id) | Product2 ids for which the stock level should be retrieved |
GetStockLevelResponse properties
Property name | Type | Description |
---|---|---|
stockLevelItems | List(StockLevelItem) | Stock levels related to the specified product ids in the GetStockLevelRequest |
StockLevelItem properties
Property name | Type | Description |
---|---|---|
productId | Id | The Product2 id to which the stock level is associated |
remainingQuantity | Decimal | The remaining stock level amount |