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

Nested: producersbrandsproduct_lines.
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
ActionMethodWho
Index / show / formGETAny ODIS user (where not restricted)
Create / update / aggregate / deletePOST, PATCH, DELETEAdmin or editor
GET .../form returns a nested payload (line + variants + size assignments) suited to ODIS forms.
PATCH .../aggregate applies a partial product-line and nested variant update in one transaction.

Create (POST)

Body uses product_line with optional initial_variant for the first variant and sizes. Required for create: an initial_variant hash with either size_ids (array) or size_assignments (array of per-size rows). If initial_variant is missing or not a object, the API returns 422 with a clear message.
{
  "product_line": {
    "name": "Eagle Line",
    "description": "Optional",
    "category_id": "uuid-optional",
    "metadata": { "mashbill": { "corn": 70 } },
    "subcategory_ids": ["uuid"],
    "bottle_image": "data:image/png;base64,...",
    "label_image": "data:image/png;base64,...",
    "initial_variant": {
      "producer_id": "uuid-optional",
      "display_name": "optional",
      "batch_name": "optional",
      "vintage_year": "optional",
      "released_at": "optional",
      "sku": "optional",
      "proof": "optional",
      "metadata": {},
      "size_ids": ["size-uuid-1", "size-uuid-2"]
    }
  }
}
Alternatively use size_assignments under initial_variant instead of size_ids (see Variants for the row shape). Images on the line use attach_image (multipart or data URI) like elsewhere in ODIS. Response: 201 with the product line detail (not the full form shape).

Update (PATCH — simple fields)

{
  "product_line": {
    "name": "New name",
    "description": "…",
    "category_id": "uuid",
    "subcategory_ids": ["uuid"],
    "metadata": { }
  }
}
Does not replace the full aggregate / variant story; use aggregate for nested variant and size data.

Delete (DELETE)

Removes the product line. Variants and dependent rows follow model dependent rules.

Form (GET .../form)

Returns the FormSerializer shape, including at least:
  • id, name, description, metadata, brand_id, category_id, subcategory_ids
  • bottle_image_url, label_image_url
  • brand (compact), producer (contextual to producer_id in the path when present)
  • variants: array of variant rows, each with effective_name, effective_metadata, size_assignments, and optional image URLs (variant overrides line images when set)
size_assignments rows include the parent size (size_id, milliliters, display) plus per-row fields: upc, pricing, rarity, optionals, sb_attributes, etc.

Aggregate (PATCH .../aggregate)

Admin or editor. Sends a product_line object that may include:
  • Line fields: name, description, category_id, metadata, subcategory_ids
  • Optional bottle_image / label_image (data URI or upload, same as other ODIS attach flows)
  • variants: array of entries to create/update/destroy (see below)
Response: 200 with the same shape as GET .../form (reloads associations).

Variant entries in variants

For each object you may set:
  • id — existing variant to update, or omit to create
  • _destroy: true — with id, deletes that variant
  • producer_id, display_name, batch_name, vintage_year, released_at, sku, proof, metadata
  • size_assignments — replaces all variant sizes for that variant when the key is present (empty array removes all)
  • bottle_image / label_image — optional variant-level images
size_assignments array items match the Variants page (at minimum size_id, optional upc and other pricing fields). If the server rejects nested validation, the response is 422 and message may describe variant or size errors (often a joined string or summary).

Errors

  • 403 if not admin/editor on mutating actions.
  • 404 for unknown producer, brand, or product line.
  • 422 for validation, missing initial_variant on create, or failed aggregate persistence.

Example (aggregate)

curl -sS -X PATCH \
  "https://api.onlydrams.app/odis/v1/producers/P/brands/B/product_lines/PL/aggregate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_line": {
      "name": "Renamed",
      "variants": [
        {
          "id": "VARIANT_UUID",
          "size_assignments": [
            {
              "size_id": "SIZE_UUID",
              "upc": "123456789012",
              "msrp": 99.0
            }
          ]
        }
      ]
    }
  }'
See Spirits catalog overview for global auth and Variants for size_assignments and UPC rules.