Create a variant

POST
/accommodations/{product_id}/variants

Creates a variant under an existing accommodation. A variant is the bookable unit within an accommodation (e.g. a room type).

Any API key (app-installation-scoped or dashboard-user-scoped) can create variants under any accommodation in the company.

The image_url field is queued for asynchronous download and re-hosting by Easol. The variant is created immediately. Missing images can be uploaded via the Easol dashboard afterwards.

Path Parameters

product_id*string

Product ID for the accommodation type (e.g. acc_9fKbV3aQx7).

Header Parameters

Idempotency-Key?string

Client-generated key for idempotent writes; the server deduplicates retries within a 24-hour window.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string

Customer-facing variant name (e.g. "Deluxe Double Room").

tagline?string | null

Short marketing line shown alongside the variant name (≤ 140 chars).

Lengthlength <= 140
min_occupancy*integer

Minimum number of guests this variant can host.

Range1 <= value
max_occupancy?integer | null

Maximum number of guests this variant can host. Must be ≥ min_occupancy.

Range1 <= value
hidden?boolean

When true, the variant is excluded from the public storefront and from search/availability results, but remains bookable through the API. Defaults to false.

position?integer | null

Display order within the parent accommodation (lower values shown first). Defaults to the next available position.

Range0 <= value
checkout_limit?integer | null

Maximum quantity of this variant allowed in a single booking. Null (default) means no per-variant cap; remaining stock still applies.

Range1 <= value
stock_strategy?string | null

How sellability and stock are accounted for. inventory decrements a fixed per-variant pool; inventory_per_night decrements a per-night pool; resources ties sellability to physical resources (e.g. seats); external defers to the installed app that owns the variant — Easol holds no local stock and asks the app live. Accepted on create: inventory_per_night and external. All other values return 422. If omitted: external when the parent accommodation was created via an app installation; otherwise inventory_per_night.

Value in"inventory" | "inventory_per_night" | "resources" | "external"
image_url?string | null

Publicly fetchable URL of the variant's image. Easol queues the asset for asynchronous download and re-hosting. The variant is created immediately and ingestion status is returned in response metadata. Recommended: PNG, JPEG, WebP, or GIF; ≤ 15 MB.

Formaturi
price_cents?integer | null

Variant price in the smallest unit of the company's home currency (e.g. pence for GBP, cents for USD/EUR). Null when no price has been set.

Range0 <= value

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/accommodations/string/variants" \  -H "Easol-API-Version: 2026-11-01" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "min_occupancy": 1  }'
{
  "object": "accommodation_variant",
  "id": "string",
  "name": "string",
  "tagline": "string",
  "min_occupancy": 1,
  "max_occupancy": 1,
  "hidden": true,
  "position": 0,
  "checkout_limit": 1,
  "stock_strategy": "inventory",
  "image_url": "http://example.com",
  "price": {
    "amount": 0,
    "currency": "string"
  },
  "accommodation": "string"
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}