v

Quickstart

Get an API key and make your first read and write against the Wine2You API.

Quickstart

About ten minutes from zero to a published offer.

1. Get an API key

Keys are entity-scoped and minted through the partner portal (POST /api/keys). A new key's plaintext is shown once — store it in your secret manager immediately.

curl -X POST https://api.wine2you.shop/api/keys \
  -H "Authorization: Bearer $W2Y_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"ent_...","scopes":["read:offers","write:offers"],"name":"my-integration"}'

2. Make your first read

curl https://api.wine2you.shop/v1/wines?page_size=5 \
  -H "Authorization: Bearer $W2Y_KEY"

Responses are cursor-paginated: { "data": [...], "page_size": 5, "cursor": "...", "has_more": true }. There is no total-count field — see Errors & rate limits.

3. Create an offer (Originator)

curl -X POST https://api.wine2you.shop/v1/offers \
  -H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
  -d '{"wine_id":"win_...","stock":120,"seller_price":{"amount":18.50,"currency":"EUR"},
       "network_shareable":true,"permissions":{"allowed_countries":["DE","CH"],"named_sellers":[],"default":"none"}}'

4. Publish a listing (Seller)

A Seller layers a shelf price on an offer it is permitted to sell:

curl -X POST https://api.wine2you.shop/v1/listings \
  -H "Authorization: Bearer $W2Y_KEY" -H "Content-Type: application/json" \
  -d '{"offer_id":"off_...","shelf_price":{"amount":24.90,"currency":"CHF"},"channel_id":"ch_..."}'

Next steps

Edit this page on GitHub ↗