Skip to main content

Stock Management

1 API call in this section.

Refresh Catalog Stock

Storefront & Commerce / Advanced Features / Stock Management
POST/storefront/stock/refresh

Manually 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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/storefront/stock/refresh" \2  --header "Authorization: Bearer {{access_token}}"

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

JWT token for tenant admin users

Responses

Success - Stock Refreshed200OK
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}
Error - No Market Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Market not found for tenant"4}