📊CSV Import Templates
Inventory Update
Bulk inventory stock level updates for warehouses and retailers.
Explanation
Update stock quantities across multiple products and locations.
Examples
Stock Update CSV
Output
sku,location,quantity,action,reason PROD-001,Warehouse A,50,add,"Received shipment" PROD-002,Store 1,5,remove,"Customer purchase" PROD-003,Warehouse B,100,set,"Inventory count correction"
Code Examples
JavaScript
// Process inventory updates
async function updateInventory(csvData) {
const updates = parseCSV(csvData);
for (const update of updates) {
const currentStock = await getStock(update.sku, update.location);
let newQuantity;
switch (update.action) {
case 'add':
newQuantity = currentStock + parseInt(update.quantity);
break;
case 'remove':
newQuantity = currentStock - parseInt(update.quantity);
break;
case 'set':
newQuantity = parseInt(update.quantity);
break;
}
await setStock(update.sku, update.location, newQuantity, update.reason);
}
}Try it Now
💡 Tips
- Use actions: add, remove, set for flexibility
- Include reason for audit trail
- Validate SKUs exist before updating
- Check for negative inventory after updates
- Consider timestamp field for tracking
⚠️ Common Pitfalls
- Concurrent updates can cause race conditions
- Negative stock should trigger alerts
- Wrong location codes fail silently
- Missing SKUs should be flagged