v

Publish a wine

Match against the canonical register, then create a wine when there is no match.

Publish a wine

Wine2You keeps one canonical record per wine. Before you create one, always match — creating a duplicate fragments the register and every downstream offer.

1. Match first

curl -X POST https://api.wine2you.shop/v1/wines/match \
  -H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
  -d '{"producer":"Domaine X","name":"Côtes du Rhône","vintage":2019,"appellation":"Côtes du Rhône AOC"}'

The response returns the closest existing wines with a confidence score. If a match is confident, use its wine_id and skip to Create an offer.

2. Create the wine (no confident match)

curl -X POST https://api.wine2you.shop/v1/wines \
  -H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
  -d '{"producer":"Domaine X","name":"Côtes du Rhône","vintage":2019,
       "appellation":"Côtes du Rhône AOC","country":"FR","region":"Rhône",
       "grapes":["Grenache","Syrah"],"abv":14.0,"volume_ml":750}'

3. Attach media and compliance facts

Media and compliance fields (labels, allergen text, analysis) are part of the wine record; enrichment from external databases may fill gaps later. You only need to supply what you know.

Field notes

Field Notes
vintage integer year; use null for NV wines
appellation free text; the canonical register normalises where possible
grapes array of grape names
abv percent, one decimal
volume_ml bottle volume in millilitres

Next steps

Edit this page on GitHub ↗