---
title: "Create a rate plan"
method: POST
path: "/rateplan/v0-nsfw/rate-plans"
tags: ["RatePlan"]
---

# Create a rate plan

`POST /rateplan/v0-nsfw/rate-plans`

## Request

- Base URL: `https://api.apaleo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.apaleo.com/rateplan/v0-nsfw/rate-plans`
- Auth: OAuth 2
  - Implicit: `https://identity.apaleo.com/connect/authorize`
  - Scopes: `rateplans.create`, `setup.manage`, `admin`

Use this call to create a new rate plan. The rate plan will already contain empty rates, fill them later using PUT rates.<br>You must have at least one of these scopes: 'rateplans.create, setup.manage'.<br>For fine-grained clients, you must have this permission: 'core.rate_plans.create'.

## Headers

- `Idempotency-Key` string

## Request body

- CreateRatePlanModel
  - `code` string, required: The code for the rate plan that can be shown in reports and table views
  - `propertyId` string, required: The id of the property for which the rate plan will be created
  - `unitGroupId` string, required: The id of the unit group offered with this rate plan
  - `cancellationPolicyId` string, required: The id of the cancellation policy valid for this rate plan
  - `noShowPolicyId` string, nullable: The id of the no-show policy valid for this rate plan
  - `channelCodes` string[], required: The channel codes the rate plan is sold through
  - `promoCodes` string[], nullable: The rate codes for promotional and hidden rates. If at least one code is set the rate will be not publicly visible anymore and only be offered when one of the promo codes is given in the offer request. For backward compatibility it is still not possible to set multiple promo codes.
  - `isSubjectToCityTax` boolean, nullable: Whether the rate plan is subject to city tax or not. Default value is `true`
  - `isYieldable` boolean, nullable: Whether the rate plan is subject to evaluation against hurdle rates when deciding on rate availability. Default value is `false`
  - `timeSliceDefinitionId` string, required: Defines the time periods for which the unit group related to this rate plan is rented out
  - `name` object, required: The name for the rate plan
  - `description` object, required: The description for the rate plan
  - `minGuaranteeType` 'PM6Hold' | 'CreditCard' | 'Prepayment' | 'Company', required: The minimum guarantee to be provided when this rate plan is booked so the reservation will be guaranteed to the guest
  - `priceCalculationMode` 'Truncate' | 'Round', nullable: The calculation mode is used when calculating the adults' surcharges and derived rates. Defaults to Truncate. Example: for a rate of 125.99 and a surcharge of +10%, when Truncate is selected, the result would be 125.99 + 12 = 137.99 When Round is selected, the result would be 125.99 + 12.60 = 138.59
  - `bookingPeriods` BookingPeriodModel[], nullable: Time periods when the rate plan is bookable
    - `from` string, date-time, required: Start of booking period<br />A date and time (without fractional second part) in UTC or with UTC offset as defined in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a>
    - `to` string, date-time, required: End of booking period<br />A date and time (without fractional second part) in UTC or with UTC offset as defined in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a>
  - `restrictions` BookingRestrictionsModel
    - `minAdvance` PeriodModel
      - `hours` integer, nullable: The number of hours within the period
      - `days` integer, nullable: The number of days within the period
      - `months` integer, nullable: The number of months within the period
    - `maxAdvance` PeriodModel
      - `hours` integer, nullable: The number of hours within the period
      - `days` integer, nullable: The number of days within the period
      - `months` integer, nullable: The number of months within the period
    - `lateBookingUntil` string, nullable: Time of day until the late booking can be made for this rate plan Restrictions: - the time has to be between the check-in (excl.) and check-out time (excl.) - can only be set, if MinAdvance is not set<br />A time (without fractional second part) as defined in the <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a>
  - `pricingRule` CreatePricingRuleModel
    - `baseRatePlanId` string, required: The id of the rate plan that will be used as base when calculating the rates. The derivation level of the rate plan used as base rate plan cannot be greater than 2
    - `type` 'Absolute' | 'Percent', required: The type used to control the calculation of the difference to the rates of the defined base rate plan
    - `value` number, double, required: The value used to control the calculation of the difference to the rates of the defined base rate plan. It can be a positive and a negative value. The system will prevent you to define a value that would lead to negative rates
  - `surcharges` SurchargeModel[], nullable: Additional charges for more than single occupancy. The percent or absolute value will be added to the manually defined or calculated derived rates. The values for 'adults' must be unique within the list and starting from occupancy of 2 adults. Values higher than the maximum unit group occupancy will be silently ignored. The surcharges are required for all possible occupancies defined by the 'MaxPersons' of the unit group.
    - `adults` integer, required: The total numbers of adults
    - `type` 'Absolute' | 'Percent', required: Specifies how to interpret 'Value'
    - `value` number, double, required: The percent or absolute value (in the rate plan's currency) of the surcharge
  - `ageCategories` RatePlanAgeCategoryModel[], nullable: Additional charges per age category.
    - `id` string, required: The id of the age category
    - `surcharges` AgeCategorySurchargeModel[], required: Additional charges for the current age category. The absolute value will be added to the manually defined or calculated derived rates. The values for 'adults' must be unique within the list, and starting from 1. Values equal or higher than the maximum unit group occupancy will be silently ignored.
      - `adults` integer, required: The number of adults
      - `value` number, double, required: The absolute value in the currency of the rate plan as surcharge for each child accompanied by the given number of 'adults'. The minimum value is 0.
  - `includedServices` RatePlanServiceModel[], nullable: Services that are included in the rate plan
    - `serviceId` string, required: Service id to be included in the rate plan
    - `grossPrice` MonetaryValueModel, required
      - `amount` number, double, required
      - `currency` string, required
    - `pricingMode` 'Included' | 'Additional', nullable: Whether the service price is included in or added to the base rate. The property defaults to `Included`.
  - `companies` CreateCompanyRatePlanModel[], nullable: Companies that can use this rate plan
    - `id` string, required: Company ID that can use this rate plan
    - `corporateCode` string, nullable: Optional rate plan code that is used by the company. Default is companyCode-ratePlanCode. Same code can be specified for several rate plans in one company. No two companies can have a rate plan with the same code.
  - `accountingConfigs` AccountingConfigModel[], nullable: The collection of accounting configs with validity periods. This is a temporary field, avoid using it.
    - `vatType` 'Null' | 'VeryReduced' | 'Reduced' | 'Normal' | 'Without' | 'Special' | 'Special1' | 'Special2' | 'ReducedCovid19' | 'NormalCovid19' | 'Mixed', required: The VAT type
    - `serviceType` 'Other' | 'Accommodation' | 'FoodAndBeverages', required: The service type
    - `subAccountId` string, nullable: The sub-accounts id
    - `validFrom` string, date, required: Which date this configuration is valid from
  - `marketSegmentId` string, nullable: The id of the market segment for this rate plan

## Response `201`

Creation of the new rate plan was successful.

- RatePlanCreatedModel
  - `id` string, required: The rate plan id

## Other responses

- `400`: Bad request.
- `401`: You are unauthorized.
- `403`: Forbidden.
- `404`: The Request-URI could not be found.
- `415`: Unsupported media type.
- `422`: Validation errors in the request body or query params.
- `499`: Client closed request.
- `500`: An unexpected error occurred.
- `503`: The server is currently unavailable. Please try later.

---

[API](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work.md) - [All operations](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work/llms.txt) - [OpenAPI document](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work/revisions/97dec9512a17?raw)
