Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

ENDPOINTS
GET    /odis/v1/sizes
GET    /odis/v1/sizes/:id
POST   /odis/v1/sizes
PATCH  /odis/v1/sizes/:id
DELETE /odis/v1/sizes/:id

GET    /odis/v1/producers
GET    /odis/v1/producers/:id
POST   /odis/v1/producers
PATCH  /odis/v1/producers/:id
DELETE /odis/v1/producers/:id

GET    /odis/v1/producers/:producer_id/brands
GET    /odis/v1/producers/:producer_id/brands/:id
POST   /odis/v1/producers/:producer_id/brands
PATCH  /odis/v1/producers/:producer_id/brands/:id
DELETE /odis/v1/producers/:producer_id/brands/:id

GET    /odis/v1/producers/:producer_id/brands/:brand_id/product_lines
GET    /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:id
POST   /odis/v1/producers/:producer_id/brands/:brand_id/product_lines
PATCH  /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:id
DELETE /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:id
GET    /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:id/form
PATCH  /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:id/aggregate

GET    /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:product_line_id/variants
GET    /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:product_line_id/variants/:id
POST   /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:product_line_id/variants
PATCH  /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:product_line_id/variants/:id
DELETE /odis/v1/producers/:producer_id/brands/:brand_id/product_lines/:product_line_id/variants/:id

Overview

This section documents ODIS-only JSON endpoints for the spirits catalog data model: global bottle sizes, producers and logos, brand membership, product lines (with nested variants and per-size fields), and aggregate updates for ODIS UIs. Public read APIs under GET /api/v1/catalog/... are not covered here; they will be documented separately.

Base URL and versioning

All paths are rooted at:
https://api.onlydrams.app/odis/v1
(Use your environment host for staging or local development.)

Authentication and issuer

Every request must send:
Authorization: Bearer <access_token>
Content-Type: application/json
The JWT used for ODIS must include iss: "odis" in its payload. Tokens issued for the mobile app or other issuers are rejected by Odis::V1::BaseController with 403 and message “Not an ODIS user” unless the issuer matches. Obtain a suitable token the way your ODIS client does (for example, mint in Rails with Jwt::Issuer.call(user, "odis") for a known user). See the general Authentication overview for Bearer usage.

Authorization

  • Read-only catalog actions (for example GET on sizes, producers, brands, product lines, variants, and GET .../form) require a valid ODIS token; they do not require admin or editor unless a specific action notes it.
  • Create, update, and destroy on sizes, producers, brands, product lines, variants, and PATCH .../aggregate require admin or editor. Others receive 403 with “Insufficient privileges”.

Errors

Error bodies generally use a single string field (see Errors):
{ "message": "…" }
Validation failures on nested records may surface as a single human-readable message (for example multiple errors joined with commas, or a variant validation summary).

Pagination

GET list endpoints that return many rows use the same envelope as other ODIS list APIs:
{
  "total": 42,
  "has_more": true,
  "data": [ /* serialized rows */ ]
}
Optional query parameters (where supported) follow the app defaults: page, per.

Resource hierarchy

Conceptually:
  • Size — global list of fill volumes (ml + display), referenced by variant size rows.
  • Producer — company that produces spirit; can have a logo (Active Storage; see Producers).
  • Brand — brand name; HABTM with producers, scoped under a producer in these routes for ODIS.
  • Product line — brand-scoped “line” with metadata, category, subcategories, and images; has many variants.
  • Variant — batch/SKU/vintage side of a line, tied to a producer, with one row per size (variant size) for UPC, pricing, rarity, and optional platform fields.
  • AggregatePATCH .../product_lines/:id/aggregate updates a line, subcategories, and nested variant / size rows in one request (see Product lines).
Other ODIS areas (communities, tiers, bottles moderation, etc.) live under the same ODIS API group in the sidebar. This Spirits catalog group is only the catalog model above.

Pages in this group

  • Sizes — list and manage global Size records.
  • Producers — CRUD and logo upload.
  • Brands — brands under a producer.
  • Product lines — CRUD, form, and aggregate.
  • Variants — CRUD and size assignment payloads.