Create new Rates
Create a new Rates
This endpoint needs your API key
Send it as a bearer token in the Authorization header. A request without one is answered with 401. See Authentication for where to find your key and how to keep it secret.
Request
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
}'Response
Created
{
"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
}Request body
Required. Send it as JSON.
namestringrequiredRate Name
codestringrequiredCode of the Rate. Constraints: Not null, Size(min=3, max=20)
Must be:3 to 20 characterstypestringrequiredRates Type
Allowed values:timeamountLimitdaysarray of stringrequiredWeek Days
amountnumber<double>requiredRate amount
descriptionstringDescrition of the Rates
from_datestring<date>From date for time based rates, format(YYYY-MM-DD)
to_datestring<date>To date for time based rates, format(YYYY-MM-DD)
time_limitstringrequiredTime Limit Type
Allowed values:sameDaysameWeeksameMonthamount_limitinteger<int64>Amount limit used for the Amount based Rate.
Response
idstringRate ID
namestringRate Name
codestringRate Code
typestringRates Type
Allowed values:timeamountLimitdaysarray of stringWeek Days
amountnumber<double>requiredIt is a percentage amount ?
descriptionstringDescrition of the Rates
from_dateinteger<int64>From date for time based rates
to_dateinteger<int64>To date for time based rates
amount_limitinteger<int64>requiredAmount limit used for the Amount based Rate,
created_dateinteger<int64>Rates creation time
Status codes
201Created400Bad request401Unauthorized402Payment required403Forbidden404Not found428Precondition required500Server error