> For the complete documentation index, see [llms.txt](https://docs.channex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.channex.io/api-v.1-documentation/rate-plans-collection/create-rate-plan-api.md).

# Create Rate Plan API

## Create a rate plan

> Create a rate plan for a room type. The created rate plan is returned with \`201 Created\`.

````json
{"openapi":"3.1.0","info":{"title":"Channex.io — Public API","version":"0.0.0"},"tags":[{"name":"Rate Plans","description":"Manage Rate Plans — pricing plans of how to sell Room Types: prices per occupancy, rate derivation rules, and per-weekday restriction defaults."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"RatePlans.RatePlanResource":{"type":"object","required":["type","id","attributes","relationships"],"properties":{"type":{"type":"string","enum":["rate_plan"]},"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"attributes":{"$ref":"#/components/schemas/RatePlans.RatePlan"},"relationships":{"$ref":"#/components/schemas/RatePlans.RatePlanRelationships"}},"description":"A rate plan as returned in responses."},"Common.Scalars.id":{"type":"string","format":"uuid"},"RatePlans.RatePlan":{"type":"object","required":["id","title","sell_mode","rate_mode","currency","meal_type","tax_set_id","cancellation_policy_id","ui_read_only","meta","inherit_rate","inherit_closed_to_arrival","inherit_closed_to_departure","inherit_stop_sell","inherit_min_stay_arrival","inherit_min_stay_through","inherit_max_stay","inherit_max_availability","inherit_availability_offset","options","auto_rate_settings","children_fee","infant_fee","max_stay","min_stay_arrival","min_stay_through","closed_to_arrival","closed_to_departure","stop_sell"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"Unique rate plan identifier."},"title":{"type":"string","minLength":1,"maxLength":255,"description":"Rate plan title, unique within a Room Type (case-sensitive). A title that is blank after trimming whitespace (for example `\"   \"`) is refused with `422` (`details.title: [\"can't be blank\"]`)."},"sell_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.SellMode"}],"description":"How the rate plan is sold. Defaults to `per_room`. Cannot be changed after creation: on update a value other than the stored one is refused with `422` (`details.sell_mode: [\"can't be changed\"]`); the stored value is accepted."},"rate_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.RateMode"}],"description":"How the rate is calculated. Defaults to `manual`."},"currency":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.currency"}],"description":"Rate plan currency, an ISO 4217 code. Defaults to the currency of the associated Property; a Property can have rate plans in different currencies. On create, an unsupported code is refused with `422` (`details.currency: [\"is invalid\"]`). Cannot be changed after creation: a value sent on update is ignored."},"meal_type":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.MealType"},{"type":"null"}],"description":"Meal plan included in the rate plan. `none` by default; null once cleared."},"tax_set_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the Tax Set applied to the rate plan, or null. Defaults to the Property's default Tax Set. The tax set also appears under relationships."},"cancellation_policy_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the Cancellation Policy applied to the rate plan, or null."},"ui_read_only":{"type":"boolean","description":"Whether the rate plan is shown as read-only in the Channex interface."},"meta":{"anyOf":[{"type":"object","unevaluatedProperties":{}},{"type":"null"}],"description":"Free-form object stored for the client's own use, or null. The platform neither reads nor writes it: an object sent here comes back unchanged."},"inherit_rate":{"type":"boolean","description":"Whether `rate` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_closed_to_arrival":{"type":"boolean","description":"Whether `closed_to_arrival` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_closed_to_departure":{"type":"boolean","description":"Whether `closed_to_departure` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_stop_sell":{"type":"boolean","description":"Whether `stop_sell` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_min_stay_arrival":{"type":"boolean","description":"Whether `min_stay_arrival` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_min_stay_through":{"type":"boolean","description":"Whether `min_stay_through` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_max_stay":{"type":"boolean","description":"Whether `max_stay` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_max_availability":{"type":"boolean","description":"Whether `max_availability` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_availability_offset":{"type":"boolean","description":"Whether `availability_offset` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"options":{"type":"array","items":{"$ref":"#/components/schemas/RatePlans.OccupancyOption"},"description":"Occupancy options — prices for different counts of guests."},"auto_rate_settings":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateSettings"},{"type":"null"}],"description":"How rate options are derived from the primary occupancy option. Filled with zero-valued amount settings when `rate_mode` is `auto` and nothing is sent; null otherwise."},"children_fee":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"}],"description":"Additional fee added to the normal price for a Children guest (per Hotel Age Policy)."},"infant_fee":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"}],"description":"Additional fee added to the normal price for an Infant guest (per Hotel Age Policy)."},"max_stay":{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"},"minItems":7,"maxItems":7,"description":"Default Max Stay restriction per weekday (7 values, Monday first). `0` means no limit."},"min_stay_arrival":{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.positiveInt"},"minItems":7,"maxItems":7,"description":"Default Min Stay Arrival restriction per weekday (7 values, Monday first)."},"min_stay_through":{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.positiveInt"},"minItems":7,"maxItems":7,"description":"Default Min Stay Through restriction per weekday (7 values, Monday first)."},"closed_to_arrival":{"type":"array","items":{"type":"boolean"},"minItems":7,"maxItems":7,"description":"Default Closed To Arrival restriction per weekday (7 values, Monday first)."},"closed_to_departure":{"type":"array","items":{"type":"boolean"},"minItems":7,"maxItems":7,"description":"Default Closed To Departure restriction per weekday (7 values, Monday first)."},"stop_sell":{"type":"array","items":{"type":"boolean"},"minItems":7,"maxItems":7,"description":"Default Stop Sell restriction per weekday (7 values, Monday first)."}},"description":"A rate plan — a pricing plan of how to sell a Room Type, with prices and restriction defaults — as returned in responses: every attribute is present."},"RatePlans.SellMode":{"type":"string","enum":["per_room","per_person"],"description":"How the rate plan is sold. `per_room` — one price regardless of guest count; `per_person` — price depends on guest count."},"RatePlans.RateMode":{"type":"string","enum":["manual","derived","cascade","auto"],"description":"How the rate of the rate plan is calculated.\n`manual` — the price is the one set in `options[].rate`.\n`derived` — the price of the primary occupancy option is derived from the Parent Rate Plan.\n`cascade` — the price of every occupancy option is derived from the Parent Rate Plan; on create, an option is added for each occupancy from 1 to the Room Type's `occ_adults` that the request does not name, each derived from the parent's option of the same occupancy.\n`auto` — the price is calculated from the primary occupancy option's price and `auto_rate_settings`."},"Common.Scalars.currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 alphabetic currency code. See the `/currencies` endpoint for supported values."},"RatePlans.MealType":{"type":"string","enum":["none","all_inclusive","breakfast","lunch","dinner","american","bed_and_breakfast","buffet_breakfast","carribean_breakfast","continental_breakfast","english_breakfast","european_plan","family_plan","full_board","full_breakfast","half_board","room_only","self_catering","bermuda","dinner_bed_and_breakfast_plan","family_american","breakfast_and_lunch","lunch_and_dinner"],"description":"Meal plan included in the rate plan."},"RatePlans.OccupancyOption":{"type":"object","required":["id","occupancy","is_primary","inherit_rate","inherit_closed_to_arrival","inherit_closed_to_departure","inherit_stop_sell","inherit_min_stay_arrival","inherit_min_stay_through","inherit_max_stay","inherit_max_availability","inherit_availability_offset","derived_option","rate_category_id","rate"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"Unique occupancy option identifier."},"occupancy":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Count of guests allowed for this occupancy option. At most the Room Type's `occ_adults`; each occupancy appears once, and `2` and `\"2\"` count as the same occupancy."},"is_primary":{"type":"boolean","description":"Marks the main occupancy option — the base point for derived calculations. Exactly one option of a rate plan is primary."},"inherit_rate":{"type":"boolean","description":"Whether the option's `rate` is derived from the Parent Rate Plan."},"inherit_closed_to_arrival":{"type":"boolean","description":"Whether the option's `closed_to_arrival` is derived from the Parent Rate Plan."},"inherit_closed_to_departure":{"type":"boolean","description":"Whether the option's `closed_to_departure` is derived from the Parent Rate Plan."},"inherit_stop_sell":{"type":"boolean","description":"Whether the option's `stop_sell` is derived from the Parent Rate Plan."},"inherit_min_stay_arrival":{"type":"boolean","description":"Whether the option's `min_stay_arrival` is derived from the Parent Rate Plan."},"inherit_min_stay_through":{"type":"boolean","description":"Whether the option's `min_stay_through` is derived from the Parent Rate Plan."},"inherit_max_stay":{"type":"boolean","description":"Whether the option's `max_stay` is derived from the Parent Rate Plan."},"inherit_max_availability":{"type":"boolean","description":"Whether the option's `max_availability` is derived from the Parent Rate Plan."},"inherit_availability_offset":{"type":"boolean","description":"Whether the option's `availability_offset` is derived from the Parent Rate Plan."},"derived_option":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.DerivedOption"},{"type":"null"}],"description":"Rules deriving this option's values from the Parent Rate Plan or the primary occupancy option, keyed by the restriction they modify. `null` when the option is not derived; `{\"rate\": []}`, the default once a parent is set, derives the rate unchanged. Rate values are returned as decimal strings in the currency of the rate plan, for example `\"10.00\"`.\n\nThe object is keyed by the restriction a rule list modifies — `rate`, `min_stay_arrival`, `min_stay_through` or `stop_sell` — and each key holds a list of `[operation, value]` rules. `null` or `[]` in place of the object means no derived option. A key outside these four is refused unless its value is empty.\n\n`rate` takes any number of rules, applied to the original value in order, from left to right:\n\n- `increase_by_amount` — add the amount\n- `increase_by_percent` — increase by the percent\n- `decrease_by_amount` — subtract the amount\n- `decrease_by_percent` — decrease by the percent\n\nThe value is the amount or the percent as a string, for example `\"10\"` or `\"5.00\"`; a decimal comma is accepted. It must not be negative. `decrease_by_percent` must stay below 100 once rounded to two decimals — `\"99.99\"` is accepted, `\"99.995\"` is not; `increase_by_percent` has no upper limit. For an original rate of 100.00:\n\n```json\n{\"rate\": [[\"increase_by_percent\", \"5.00\"], [\"increase_by_amount\", \"12.00\"]]}\n```\n\n100.00 + 5% = 105.00, then 105.00 + 12.00 = 117.00. An empty list, `{\"rate\": []}`, derives the rate unchanged.\n\n`min_stay_arrival` and `min_stay_through` take one rule at most, `[\"set\", <positive integer>]`, and `stop_sell` one rule at most, `[\"set\", <boolean>]`: the restriction takes the given value instead of the original one."},"rate_category_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the associated rate category, or null."},"rate":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"}],"description":"Default rate applied to each date of a new rate plan and to each future date newly opened in state."}},"description":"An occupancy option — the price for a specific count of guests — as returned in responses."},"Common.Scalars.positiveInt":{"type":"integer","format":"int32","minimum":1},"RatePlans.DerivedOption":{"type":"object","properties":{"rate":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["increase_by_amount","increase_by_percent","decrease_by_amount","decrease_by_percent"],"description":"A value-modification rule, applied to the original value with the step's argument.\n`increase_by_amount` — add the amount.\n`increase_by_percent` — increase by the percent.\n`decrease_by_amount` — subtract the amount.\n`decrease_by_percent` — decrease by the percent."},{"type":"string"}]},"description":"Modification rules for the rate, applied to the original value in order; empty to derive the rate unchanged. Each rule is `[operation, value]` with the value as a decimal string; the operations are `increase_by_amount`, `increase_by_percent`, `decrease_by_amount` and `decrease_by_percent`."},"min_stay_arrival":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["set"],"description":"The rule of `min_stay_arrival`, `min_stay_through` and `stop_sell`: `set` — the restriction takes the rule's value."},{"type":"integer","format":"int32","minimum":1}]},"maxItems":1,"description":"Rule for the minimum stay counted on arrival: at most one, `[\"set\", <positive integer>]`."},"min_stay_through":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["set"],"description":"The rule of `min_stay_arrival`, `min_stay_through` and `stop_sell`: `set` — the restriction takes the rule's value."},{"type":"integer","format":"int32","minimum":1}]},"maxItems":1,"description":"Rule for the minimum stay counted through the stay: at most one, `[\"set\", <positive integer>]`."},"stop_sell":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["set"],"description":"The rule of `min_stay_arrival`, `min_stay_through` and `stop_sell`: `set` — the restriction takes the rule's value."},{"type":"boolean"}]},"maxItems":1,"description":"Rule for the stop sell flag: at most one, `[\"set\", <boolean>]`."}},"description":"Rules deriving values from the Parent Rate Plan or from the primary occupancy option, keyed by the restriction they modify.\n\nThe object is keyed by the restriction a rule list modifies — `rate`, `min_stay_arrival`, `min_stay_through` or `stop_sell` — and each key holds a list of `[operation, value]` rules. `null` or `[]` in place of the object means no derived option. A key outside these four is refused unless its value is empty.\n\n`rate` takes any number of rules, applied to the original value in order, from left to right:\n\n- `increase_by_amount` — add the amount\n- `increase_by_percent` — increase by the percent\n- `decrease_by_amount` — subtract the amount\n- `decrease_by_percent` — decrease by the percent\n\nThe value is the amount or the percent as a string, for example `\"10\"` or `\"5.00\"`; a decimal comma is accepted. It must not be negative. `decrease_by_percent` must stay below 100 once rounded to two decimals — `\"99.99\"` is accepted, `\"99.995\"` is not; `increase_by_percent` has no upper limit. For an original rate of 100.00:\n\n```json\n{\"rate\": [[\"increase_by_percent\", \"5.00\"], [\"increase_by_amount\", \"12.00\"]]}\n```\n\n100.00 + 5% = 105.00, then 105.00 + 12.00 = 117.00. An empty list, `{\"rate\": []}`, derives the rate unchanged.\n\n`min_stay_arrival` and `min_stay_through` take one rule at most, `[\"set\", <positive integer>]`, and `stop_sell` one rule at most, `[\"set\", <boolean>]`: the restriction takes the given value instead of the original one."},"Common.Scalars.decimalString":{"type":"string","description":"A decimal number as a string, e.g. `100.00`. Every monetary amount the API returns takes this form."},"RatePlans.AutoRateSettings":{"type":"object","required":["increase_mode","decrease_mode","increase_value","decrease_value"],"properties":{"increase_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateMode"}],"description":"How an increase is expressed."},"decrease_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateMode"}],"description":"How a decrease is expressed."},"increase_value":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"}],"description":"Amount or percent to increase by, as a decimal string."},"decrease_value":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"}],"description":"Amount or percent to decrease by, as a decimal string."}},"description":"How rate options are derived from the primary occupancy option when `rate_mode` is `auto`, as returned in responses."},"RatePlans.AutoRateMode":{"type":"string","enum":["$","%"],"description":"How an automatic rate adjustment is expressed: `$` for an amount, `%` for a percent."},"Common.Scalars.nonNegativeInt":{"type":"integer","format":"int32","minimum":0},"RatePlans.RatePlanRelationships":{"type":"object","required":["room_type","property"],"properties":{"room_type":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"type":{"type":"string","enum":["room_type"]}},"required":["id","type"]}},"required":["data"],"description":"Room type the rate plan sells."},"property":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"type":{"type":"string","enum":["property"]}},"required":["id","type"]}},"required":["data"],"description":"Property the rate plan belongs to."},"tax_set":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"type":{"type":"string","enum":["tax_set"]},"attributes":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"title":{"type":"string"}},"required":["id","title"],"description":"Identifier and title of the tax set."}},"required":["id","type","attributes"]}},"required":["data"],"description":"Tax set applied to the rate plan. Present in the single-record response when the rate plan has a tax set; absent from list, create and update responses."},"parent_rate_plan":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"type":{"type":"string","enum":["rate_plan"]}},"required":["id","type"]}},"required":["data"],"description":"Parent Rate Plan the rate plan derives from. Present only when `parent_rate_plan_id` is set."},"channel":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"type":{"type":"string","enum":["channel"]}},"required":["id","type"]}},"required":["data"],"description":"Channel that created the rate plan for its own mapping. Present only on such rate plans; they are listed by `GET /rate_plans` and skipped by `/options`."}},"description":"Relationships of a rate plan resource."},"Common.Errors.UnparsableRequest":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.UnparsableRequestObject"}},"description":"The request body could not be parsed as JSON."},"Common.Errors.UnparsableRequestObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"string"},"description":"Maps the part of the request that could not be parsed to the reason."}},"description":"Error object for an unparsable request body, naming the malformed part."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.InvalidArguments":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.InvalidArgumentsObject"}},"description":"The request has missing or invalid arguments; `details` lists the messages per argument."},"Common.Errors.InvalidArgumentsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid argument to the list of validation messages for that argument."}},"description":"Error object for invalid request arguments, adding per-argument messages."},"Common.Errors.ValidationError":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.ValidationErrorObject"}},"description":"The request body failed validation."},"Common.Errors.ValidationErrorObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["validation_error"]},"title":{"type":"string","enum":["Validation Error"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid field to the list of validation messages for that field."}},"description":"Error object for a failed validation, adding per-field messages."},"RatePlans.RatePlanCreateRequest":{"type":"object","required":["rate_plan"],"properties":{"rate_plan":{"$ref":"#/components/schemas/RatePlans.RatePlanCreate"}},"description":"Request body accepted when creating a rate plan."},"RatePlans.RatePlanCreate":{"type":"object","required":["title","property_id","room_type_id","options"],"properties":{"title":{"type":"string","minLength":1,"maxLength":255,"description":"Rate plan title, unique within a Room Type (case-sensitive). A title that is blank after trimming whitespace (for example `\"   \"`) is refused with `422` (`details.title: [\"can't be blank\"]`)."},"sell_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.SellMode"}],"description":"How the rate plan is sold. Defaults to `per_room`. Cannot be changed after creation: on update a value other than the stored one is refused with `422` (`details.sell_mode: [\"can't be changed\"]`); the stored value is accepted."},"rate_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.RateMode"}],"description":"How the rate is calculated. Defaults to `manual`."},"currency":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.currency"}],"description":"Rate plan currency, an ISO 4217 code. Defaults to the currency of the associated Property; a Property can have rate plans in different currencies. On create, an unsupported code is refused with `422` (`details.currency: [\"is invalid\"]`). Cannot be changed after creation: a value sent on update is ignored."},"meal_type":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.MealType"},{"type":"null"}],"description":"Meal plan included in the rate plan. `none` by default; null once cleared."},"tax_set_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the Tax Set applied to the rate plan, or null. Defaults to the Property's default Tax Set. The tax set also appears under relationships."},"cancellation_policy_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the Cancellation Policy applied to the rate plan, or null."},"ui_read_only":{"type":"boolean","description":"Whether the rate plan is shown as read-only in the Channex interface."},"meta":{"anyOf":[{"type":"object","unevaluatedProperties":{}},{"type":"null"}],"description":"Free-form object stored for the client's own use, or null. The platform neither reads nor writes it: an object sent here comes back unchanged."},"inherit_rate":{"type":"boolean","description":"Whether `rate` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_closed_to_arrival":{"type":"boolean","description":"Whether `closed_to_arrival` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_closed_to_departure":{"type":"boolean","description":"Whether `closed_to_departure` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_stop_sell":{"type":"boolean","description":"Whether `stop_sell` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_min_stay_arrival":{"type":"boolean","description":"Whether `min_stay_arrival` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_min_stay_through":{"type":"boolean","description":"Whether `min_stay_through` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_max_stay":{"type":"boolean","description":"Whether `max_stay` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_max_availability":{"type":"boolean","description":"Whether `max_availability` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"inherit_availability_offset":{"type":"boolean","description":"Whether `availability_offset` follows the Parent Rate Plan: when `true`, the value is derived from the parent on every change and cannot be set on this rate plan directly. Defaults to `false`; `true` requires `parent_rate_plan_id`."},"property_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the Property to associate with the rate plan. Cannot be changed after creation."},"room_type_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the Room Type the rate plan sells. Must belong to the Property. Cannot be changed after creation."},"parent_rate_plan_id":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.id"},{"type":"null"}],"description":"UUID of the Rate Plan to derive this rate plan from. Must be a rate plan of the same Property; it may sell another Room Type. When set on create without `rate_mode`, the rate plan is created with `rate_mode: derived`. `null` detaches the parent."},"options":{"type":"array","items":{"$ref":"#/components/schemas/RatePlans.OccupancyOptionWrite"},"description":"Occupancy options. A `per_room` rate plan takes one option for the maximum occupancy; a `per_person` rate plan takes an option per possible count of adult guests. The set of options is fixed at creation: an update can change them but not add or remove one.\n\nExactly one option has `is_primary: true`, whatever the `rate_mode` (`cascade` included); no primary option, or more than one, is refused with `422` (`details.options: [\"should have exactly one primary option\"]`). Each occupancy appears once — `2` and `\"2\"` count as the same value; a repeated occupancy is refused with `422` (`details.options: [\"occupancy 2 is duplicated\"]`, several values sorted and joined: `\"occupancy 1, 2 is duplicated\"`). An `occupancy` that is neither an integer nor a string that parses as one (for example `\"five\"`) is refused with `422` (`details.options: [\"occupancy is invalid\"]`).\n\nThe options are validated as a whole: an invalid option, primary or not, fails the request and nothing is created. The response carries every option created."},"auto_rate_settings":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateSettingsWrite"},{"type":"null"}],"description":"How rate options are derived from the primary occupancy option. Applied only when `rate_mode` is `auto`; when `rate_mode` is `auto` and nothing is sent, zero-valued amount settings are stored."},"children_fee":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Additional fee added to the normal price for a Children guest (per Hotel Age Policy): a decimal string, or an integer in the currency's minor units."},"infant_fee":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Additional fee added to the normal price for an Infant guest (per Hotel Age Policy): a decimal string, or an integer in the currency's minor units."},"max_stay":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"},{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}}],"description":"Default Max Stay restriction: a single value for every weekday, or 7 per-weekday values, Monday first. `0` means no limit."},"min_stay_arrival":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"},{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}}],"description":"Default Min Stay Arrival restriction: a single value for every weekday, or 7 per-weekday values, Monday first."},"min_stay_through":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"},{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}}],"description":"Default Min Stay Through restriction: a single value for every weekday, or 7 per-weekday values, Monday first."},"closed_to_arrival":{"anyOf":[{"type":"boolean"},{"type":"array","items":{"type":"boolean"}}],"description":"Default Closed To Arrival restriction: a single value for every weekday, or 7 per-weekday values, Monday first."},"closed_to_departure":{"anyOf":[{"type":"boolean"},{"type":"array","items":{"type":"boolean"}}],"description":"Default Closed To Departure restriction: a single value for every weekday, or 7 per-weekday values, Monday first."},"stop_sell":{"anyOf":[{"type":"boolean"},{"type":"array","items":{"type":"boolean"}}],"description":"Default Stop Sell restriction: a single value for every weekday, or 7 per-weekday values, Monday first."}},"description":"Rate plan attributes accepted when creating a rate plan. A new rate plan gets default per-day values (rate 0, stop sell off, min stay 1) — use the ARI endpoints to send values per day."},"RatePlans.OccupancyOptionWrite":{"type":"object","required":["occupancy","is_primary"],"properties":{"occupancy":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Count of guests allowed for this occupancy option. At most the Room Type's `occ_adults`; each occupancy appears once, and `2` and `\"2\"` count as the same occupancy."},"is_primary":{"type":"boolean","description":"Marks the main occupancy option — the base point for derived calculations. Exactly one option of a rate plan is primary."},"derived_option":{"anyOf":[{"$ref":"#/components/schemas/RatePlans.DerivedOption"},{"type":"null"}],"description":"Rules deriving this option's values from the Parent Rate Plan or the primary occupancy option, keyed by the restriction they modify. Defaults to `{\"rate\": []}`, derive the rate unchanged, when the rate plan has a parent.\n\nThe object is keyed by the restriction a rule list modifies — `rate`, `min_stay_arrival`, `min_stay_through` or `stop_sell` — and each key holds a list of `[operation, value]` rules. `null` or `[]` in place of the object means no derived option. A key outside these four is refused unless its value is empty.\n\n`rate` takes any number of rules, applied to the original value in order, from left to right:\n\n- `increase_by_amount` — add the amount\n- `increase_by_percent` — increase by the percent\n- `decrease_by_amount` — subtract the amount\n- `decrease_by_percent` — decrease by the percent\n\nThe value is the amount or the percent as a string, for example `\"10\"` or `\"5.00\"`; a decimal comma is accepted. It must not be negative. `decrease_by_percent` must stay below 100 once rounded to two decimals — `\"99.99\"` is accepted, `\"99.995\"` is not; `increase_by_percent` has no upper limit. For an original rate of 100.00:\n\n```json\n{\"rate\": [[\"increase_by_percent\", \"5.00\"], [\"increase_by_amount\", \"12.00\"]]}\n```\n\n100.00 + 5% = 105.00, then 105.00 + 12.00 = 117.00. An empty list, `{\"rate\": []}`, derives the rate unchanged.\n\n`min_stay_arrival` and `min_stay_through` take one rule at most, `[\"set\", <positive integer>]`, and `stop_sell` one rule at most, `[\"set\", <boolean>]`: the restriction takes the given value instead of the original one.\n\nAn invalid derived option is refused with `422` `validation_error`. Each problem is reported under its own key in `details`, and one request can return several keys:\n\n```\n<prefix>.<restriction>[.<rule index>[.<element index>]]\n```\n\n`<restriction>` is the key as sent, for example `rate`. `<rule index>` is the 0-based position of the rule in the list as sent; `null` and `[]` entries are skipped but keep their position. `<element index>` is `0` for the operation and `1` for the value. When the operation is wrong, the value of that rule is not checked.\n\n| Condition | Key | Message |\n| --- | --- | --- |\n| A key outside the four restrictions, with a non-empty value | `<prefix>.ratee` | `unknown restriction` |\n| The value of a key is not a list | `<prefix>.rate` | `must be a list` |\n| An entry of the list is not a list | `<prefix>.rate` | `must be a list of [operation, value] rules` |\n| More than one rule for `min_stay_arrival`, `min_stay_through` or `stop_sell` | `<prefix>.min_stay_through` | `must hold at most one rule` |\n| A rule is not a two-item list | `<prefix>.rate.0` | `must be an [operation, value] pair` |\n| An unknown operation, or one the restriction does not take | `<prefix>.rate.0.0` | `incorrect derived_option rule` |\n| A `rate` value that is not a number | `<prefix>.rate.0.1` | `amount must be a number` |\n| A negative `rate` value | `<prefix>.rate.0.1` | `amount must not be negative` |\n| A `decrease_by_percent` value of 100 or more | `<prefix>.rate.0.1` | `percent must be less than 100` |\n| A `min_stay_arrival` or `min_stay_through` value that is not a positive integer | `<prefix>.min_stay_arrival.0.1` | `must be a positive integer` |\n| A `stop_sell` value that is not a boolean | `<prefix>.stop_sell.0.1` | `must be a boolean` |\n\nFor the options of a rate plan, `<prefix>` is `options.derived_option`, without the position of the option: `options.derived_option.rate.0.1`."},"rate":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Default rate applied to each date of a new rate plan and to each future date newly opened in state: a decimal string like `\"100.00\"`, or an integer in the currency's minor units. Defaults to `\"0.00\"`. A string that is not a number (for example `\"abc\"`) is refused with `422` (`details.rate: [\"is invalid\"]`); a negative value with `422` (`details.rate: [\"must be greater than or equal to 0\"]`)."}},"description":"An occupancy option accepted on create and update. A `per_room` rate plan takes one option for the maximum occupancy; a `per_person` rate plan takes an option per possible count of adult guests."},"RatePlans.AutoRateSettingsWrite":{"type":"object","required":["increase_mode","decrease_mode","increase_value","decrease_value"],"properties":{"increase_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateMode"}],"description":"How an increase is expressed."},"decrease_mode":{"allOf":[{"$ref":"#/components/schemas/RatePlans.AutoRateMode"}],"description":"How a decrease is expressed."},"increase_value":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Amount or percent to increase by: a decimal string like `\"10.00\"`, or an integer in hundredths (`1000` → `\"10.00\"`)."},"decrease_value":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Amount or percent to decrease by: a decimal string like `\"5.00\"`, or an integer in hundredths (`500` → `\"5.00\"`)."}},"description":"How rate options are derived from the primary occupancy option when `rate_mode` is `auto`, as accepted in requests."}}},"paths":{"/rate_plans":{"post":{"operationId":"RatePlans_create","summary":"Create a rate plan","description":"Create a rate plan for a room type. The created rate plan is returned with `201 Created`.","parameters":[],"responses":{"201":{"description":"201 Created response wrapping a resource body.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/RatePlans.RatePlanResource"}},"description":"JSON:API document wrapping a single resource."}}}},"400":{"description":"The request body could not be parsed as JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.UnparsableRequest"}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"422":{"description":"The request has missing or invalid arguments; `details` lists the messages per argument.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Common.Errors.InvalidArguments"},{"$ref":"#/components/schemas/Common.Errors.ValidationError"}]}}}}},"tags":["Rate Plans"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatePlans.RatePlanCreateRequest"}}}}}}}}
````
