# Add a rate plan, optionally derived from another

`POST /lodging/rate-plans` · Rivier · bookings

Add a rate plan, optionally derived from another.

- Scope: bookings:admin
- Mcp: rivier_lodging_rate_plan_create
- Sdk: bookings.ratePlan.create
- Cli: bookings rate plan create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "propertyId": {
      "type": "string",
      "format": "uuid"
    },
    "code": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,24}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "parentId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "adjustment": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "amount",
                "percent"
              ]
            },
            "value": {
              "type": "number",
              "minimum": -1000000000,
              "maximum": 1000000000
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "mealPlan": {
      "type": "string",
      "enum": [
        "room_only",
        "breakfast",
        "half_board",
        "full_board",
        "all_inclusive"
      ],
      "default": "room_only"
    },
    "cancellationPolicyId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "deposit": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "none"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "percent"
            },
            "value": {
              "type": "number",
              "minimum": 1,
              "maximum": 100
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "fixed"
            },
            "amountMinor": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "kind",
            "amountMinor"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "full"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ],
      "default": {
        "kind": "none"
      }
    },
    "guarantee": {
      "type": "string",
      "enum": [
        "none",
        "deposit",
        "card",
        "prepaid"
      ],
      "default": "none"
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 30
      },
      "minItems": 1,
      "maxItems": 10,
      "default": [
        "direct"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "standard",
        "non_refundable",
        "package",
        "long_stay"
      ],
      "default": "standard"
    },
    "content": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": "string",
          "maxLength": 8000
        },
        "propertyNames": {
          "pattern": "^[A-Za-z]{1,32}$"
        }
      },
      "propertyNames": {
        "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
      },
      "default": {}
    },
    "includedExtras": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 20,
      "default": []
    },
    "paymentSchedule": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "when": {
            "type": "string",
            "enum": [
              "booking",
              "days_before_arrival",
              "arrival"
            ]
          },
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "percent": {
            "type": "number",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "when",
          "percent"
        ],
        "additionalProperties": false
      },
      "maxItems": 6,
      "default": []
    },
    "minNights": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
        },
        {
          "type": "null"
        }
      ]
    },
    "maxNights": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "propertyId",
    "code",
    "name"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/lodging/rate-plans' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "propertyId": "string",
  "code": "string",
  "name": "string"
}'
```
