Stock Management
1 API call in this section.
APIs for managing and refreshing stock quantities for storefront catalog items.
Refresh Catalog Stock
Storefront & Commerce / Advanced Features / Stock Management
POST
/storefront/stock/refreshManually refresh stock quantities for all catalog items in the tenant's storefront. This updates the stock_quantity field for all catalog items based on current warehouse inventory levels.
Authentication Required
Tenant admin access
Features
Updates stock quantities from warehouse inventory
Processes all catalog items for the tenant
Returns summary of updated items
Maintains real-time stock accuracy
Use Cases
Manual stock synchronization
Troubleshooting stock discrepancies
Batch stock updates after inventory changes
Administrative stock management
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for tenant admin users Example: |
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/stock/refresh" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
200OK
Response body
json
1{2 "success": true,3 "data": {4 "message": "Stock quantities refreshed successfully",5 "updated_variants_count": 25,6 "total_products_affected": 15,7 "updated_at": "2023-12-01T18:30:00Z"8 }9}