Advanced Inventory Admin REST Endpoints
To enable the Admin REST api endpoints first the admin has to be setup to accept REST calls without the normal Spring security and CSRF filters. To do so please reference the api setup for imports.
Secondly the endpoints are disabled by default and can be enabled using @EnableFrameworkRestControllers
in a servlet @Configuration
class. Note that this will enable all framework API endpoints in the application. Please see the Full Framework Controller Documentation for more information.
Integration Application
If you are writing a custom integration application and would like to include this endpoint, you must explicitly define it as a bean using JavaConfig or XML configuration as so:
JavaConfig
@Configuration
public class MyIntegrationConfiguration {
@Bean
public AdminAdvancedInventoryImportEndpoint adminAdvancedInventoryImportEndpoint() {
return new AdminAdvancedInventoryImportEndpoint();
}
}
XML
<beans>
<bean class="com.broadleafcommerce.inventory.advanced.admin.web.api.endpoint.AdminAdvancedInventoryImportEndpoint" />
</beans>
Fulfillment Location Imports
Note: URI's, with the default admin config, are prepended with admin
Single location
URI | Method | Description |
---|---|---|
/api/import/inventory/add/location | POST | Create a fulfillment location |
Payload : A LocationImportDTO
{
"name" : "Location A",
"addressId" : 1,
"fulfillmentType" : "PHYSICAL_SHIP",
"defaultLocation" : true
}
Response: None
Multiple locations
URI | Method | Description |
---|---|---|
/api/import/inventory/add/locations | POST | Create multiple fulfillment locations |
Payload : List of LocationImportDTOs
[
{
"name" : "Location A",
"addressId" : 1,
"fulfillmentType" : "PHYSICAL_SHIP",
"defaultLocation" : true
},
{
"name" : "Location B",
"addressId" : 2,
"fulfillmentType" : "PHYSICAL_SHIP",
"defaultLocation" : false
},
...
]
Response: None. This starts a background task to process the payload
Inventory Imports
Note: URI's, with the default admin config, are prepended with admin
Setting inventory for a specified location
URI | Method | Description |
---|---|---|
/api/import/inventory/set/{locationId} | POST | Set inventory for one or more skus for the specified fulfillment location |
- locationId is the id of the fulfillment location that these
Payload : List of InventoryImportDTOs
[
{
"skuId" : 1,
"onHandQuantity" : 5
"availableQuantity" : 5
},
{
"skuId" : 2,
"onHandQuantity" : 6
},
{
"skuId" : 3,
"availableQuantity" : 4
}
]
Response: None. This starts a background task to process the payload
Setting inventory for the default location
URI | Method | Description |
---|---|---|
/api/import/inventory/set | POST | Set inventory for one or more skus for the default fulfillment location |
Payload : List of InventoryImportDTOs
[
{
"skuId" : 1,
"onHandQuantity" : 5
"availableQuantity" : 5
},
{
"skuId" : 2,
"onHandQuantity" : 6
},
{
"skuId" : 3,
"availableQuantity" : 4
}
]
Response: None. This starts a background task to process the payload
Setting inventory for multiple locations
URI | Method | Description |
---|---|---|
/api/import/inventory/set/multiple | POST | Sets inventory for one or more skus for one or more fulfillment locations |
Field | Type | Description |
---|---|---|
locationId | Long | The fulfillment location id that the inventoryList of inventories should be set for |
inventoryList | List<InventoryImportDTO> | list of inventory records that should be set for fulfillment location with id locationId |
Payload Example:
[
{
"locationId" : 1,
"inventoryList" : [
{
"skuId" : 1,
"onHandQuantity" : 5,
"availableQuantity" : 5
},
{
"skuId" : 2,
"onHandQuantity" : 6
}
]
},
{
"locationId" : 2,
"inventoryList" : [
{
"skuId" : 2,
"onHandQuantity" ; 3,
"availableQuantity" : 4
}
]
}
]
Response: None. This starts a background task to process the payload