# Create new Rates `POST https://api.leapa.co/v2/rates` Create a new Rates Send your API key as a bearer token in the `Authorization` header. ## Request body Required. `application/json`. - `name` · _string_ · **required** — Rate Name - `code` · _string_ · **required** — Code of the Rate. Constraints: Not null, Size(min=3, max=20) Must be: 3 to 20 characters - `type` · _string_ · **required** — Rates Type Allowed values: `time`, `amountLimit` - `days` · _array of string_ · **required** — Week Days - `amount` · _number_ · **required** — Rate amount - `description` · _string_ — Descrition of the Rates - `from_date` · _string_ — From date for time based rates, format(YYYY-MM-DD) - `to_date` · _string_ — To date for time based rates, format(YYYY-MM-DD) - `time_limit` · _string_ · **required** — Time Limit Type Allowed values: `sameDay`, `sameWeek`, `sameMonth` - `amount_limit` · _integer_ — Amount limit used for the Amount based Rate. ```json { "name": "Jeanne Ndayishimiye", "code": "string", "type": "time", "days": [ "monday" ], "amount": 45000, "description": "Room 204, two nights", "from_date": "2026-01-31", "to_date": "2026-01-31", "time_limit": "sameDay", "amount_limit": 45000 } ``` ## Response 201 - `id` · _string_ — Rate ID - `name` · _string_ — Rate Name - `code` · _string_ — Rate Code - `type` · _string_ — Rates Type Allowed values: `time`, `amountLimit` - `days` · _array of string_ — Week Days - `amount` · _number_ · **required** — It is a percentage amount ? - `description` · _string_ — Descrition of the Rates - `from_date` · _integer_ — From date for time based rates - `to_date` · _integer_ — To date for time based rates - `amount_limit` · _integer_ · **required** — Amount limit used for the Amount based Rate, - `created_date` · _integer_ — Rates creation time ```json { "id": "obj_5f21c8a40b", "name": "Jeanne Ndayishimiye", "code": "string", "type": "time", "days": [ "monday" ], "amount": 45000, "description": "Room 204, two nights", "from_date": 0, "to_date": 0, "amount_limit": 45000, "created_date": 0 } ``` ## Status codes - `201` Created - `400` Bad request - `401` Unauthorized - `402` Payment required - `403` Forbidden - `404` Not found - `428` Precondition required - `500` Server error ## Example ```bash curl -X POST "https://api.leapa.co/v2/rates" \ -H "Authorization: Bearer $LEAPA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Jeanne Ndayishimiye", "code": "string", "type": "time", "days": [ "monday" ], "amount": 45000, "description": "Room 204, two nights", "from_date": "2026-01-31", "to_date": "2026-01-31", "time_limit": "sameDay", "amount_limit": 45000 }' ``` --- _Generated from the Leapa documentation at leapa.co/docs._