Stock & locations
Declare stock-holding locations and their inventory.
Stock & locations
A location is a stock-holding point. It carries coordinates, capability flags and the duty context used when fulfilling from it.
1. Create a location
curl -X POST https://api.wine2you.shop/v1/locations \
-H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Zug warehouse",
"country": "CH",
"coordinates": { "lat": 47.166, "lng": 8.515 },
"capabilities": ["pickup", "ship"],
"duty_context": { "excise_scheme": "ch_alc", "vat_rate": 8.1 }
}'
| Field | Notes |
|---|---|
coordinates |
required for pickup routing and duty estimation |
capabilities |
which fulfilment modes this location supports |
duty_context |
excise scheme + VAT rate applied to shipments from here |
2. Declare inventory
curl -X POST https://api.wine2you.shop/v1/inventory \
-H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
-d '{"variant_id":"var_...","location_id":"loc_...","quantity":240}'
Inventory is decoupled from wine and offer โ it is a quantity of a variant at a location. The same variant can sit at many locations.
3. Update stock
curl -X PATCH https://api.wine2you.shop/v1/inventory/inv_... \
-H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
-d '{"quantity": 216}'