# Add a promotion

`POST /lodging/promotions` · Rivier · bookings

Add a promotion. The best one that applies is taken off the nights; promotions do not stack.

- Scope: bookings:admin
- Mcp: rivier_lodging_promotion_create
- Sdk: bookings.promotion.create
- Cli: bookings promotion create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "propertyId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{2,24}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "percent",
        "amount"
      ]
    },
    "value": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1000000000
    },
    "bookFrom": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "bookTo": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "stayFrom": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "stayTo": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "minNights": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
        },
        {
          "type": "null"
        }
      ]
    },
    "roomTypeIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 100,
      "default": []
    },
    "ratePlanIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 100,
      "default": []
    },
    "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": {}
    }
  },
  "required": [
    "propertyId",
    "name",
    "kind",
    "value"
  ],
  "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/promotions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "propertyId": "string",
  "name": "string",
  "kind": "percent",
  "value": 0
}'
```
