Skip to content

Calculate a Amount upon applying a rate

PUT https://api.leapa.co/v2/rates/{rate_id}/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 PUT "https://api.leapa.co/v2/rates/rat_20b6df3c9e/rates" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 45000
  }'

Response

OK

{
  "amount": 45000,
  "rate": {
    "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
  },
  "rate_amount": 45000
}

Path parameters

Values that go into the URL itself.

  • rate_idstringrequired
    Example:rat_20b6df3c9e

Request body

application/json

Required. Send it as JSON.

  • amountinteger<int64>required

    Amount on which the rate would be applied to

Response

application/json
  • amountnumber<double>required

    Amount on which the rate would be applied to

  • rateRateResponserequired
  • rate_amountinteger<int64>required

    Amount after applying rate,

Status codes

  • 200OK
  • 400Bad request
  • 401Unauthorized
  • 402Payment required
  • 403Forbidden
  • 404Not found
  • 428Precondition required
  • 500Server error

Request

curl -X PUT "https://api.leapa.co/v2/rates/rat_20b6df3c9e/rates" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 45000
  }'

Response

OK

{
  "amount": 45000,
  "rate": {
    "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
  },
  "rate_amount": 45000
}