Creating or updating rent terms
Creates a new rent term if there is no rent term with the passed rent_term_id, otherwise updates the existing one
Request
PUT
https://fleet-api.taxi.yandex.net/v1/parks/vehicles/rent-terms
Headers
|
Name |
Description |
|
X-API-Key |
Type: string API-key Min length: Example: |
|
X-Client-ID |
Type: string Client ID Min length: Example: |
|
X-Idempotency-Token |
Type: string Idempotent request token. Must contain only printable ASCII characters Min length: Max length: Example: |
|
X-Park-ID |
Type: string Partner ID Example: |
Body
application/json
{
"rent_term_id": "example",
"name": "example",
"schemas": [
{
"working_days": 1,
"non_working_days": 0,
"daily_amount": "50.1200"
}
],
"minimum_period_days": 1,
"deposit_amount_total": null,
"deposit_amount_daily": null,
"is_buyout_possible": true
}
|
Name |
Description |
|
is_buyout_possible |
Type: IsBuyoutPossible Possibility of buying out a car Example: |
|
minimum_period_days |
Type: MinimumPeriodDays Minimum rental period Min value: Example: |
|
name |
Type: RentTermName Rent term name Min length: Max length: Example: |
|
rent_term_id |
Type: RentTermId Rent term ID Example: |
|
schemas |
Type: RentSchemeDto[] Rental schemes Min items: Example
|
|
deposit_amount_daily |
Type: DepositAmountDaily Deposit rate per day Number with 4 decimal places Example: |
|
deposit_amount_total |
Type: DepositAmountTotal Full deposit amount for car rental Number with 4 decimal places Example: |
RentTermId
Rent term ID
Type: string
Example: example
RentTermName
Rent term name
Type: string
Min length: 1
Max length: 500
Example: example
WorkingDays
Number of days on which the car is rented
Type: integer
Min value: 1
NonWorkingDays
Number of days in which the car is not rented
Type: integer
Min value: 0
Decimal
Number with 4 decimal places
Type: string
Example: 50.1200
RentSchemeDto
Rental scheme
|
Name |
Description |
|
daily_amount |
Type: DailyAmount Rental cost per day Number with 4 decimal places Example: |
|
non_working_days |
Type: NonWorkingDays Number of days in which the car is not rented Min value: Example: |
|
working_days |
Type: WorkingDays Number of days on which the car is rented Min value: Example: |
Example
{
"working_days": 1,
"non_working_days": 0,
"daily_amount": "50.1200"
}
MinimumPeriodDays
Minimum rental period
Type: integer
Min value: 1
DepositAmountTotal
Full deposit amount for car rental
Number with 4 decimal places
Type: Decimal
Example: 50.1200
IsBuyoutPossible
Possibility of buying out a car
Type: boolean
Responses
200 OK
Rent term creation
Body
application/json
{
"rent_term_id": "example",
"name": "example"
}
|
Name |
Description |
|
name |
Type: RentTermName Rent term name Min length: Max length: Example: |
|
rent_term_id |
Type: RentTermId Rent term ID Example: |
400 Bad Request
Invalid request parameters Possible error codes:
- name_already_exists - A term with the same name already exists
- deposit_amount_total_less_than_deposit_amount_daily - The deposit rate must be less than the deposit amount
- deposit_amount_total_not_specified - The deposit amount is not specified at the specified deposit rate
- duplicated_schemas - The pair (working_days,non_working_days) are duplicated in the rental scheme
- scheme_daily_amount_less_or_equal_zero - Rental cost is less than or equal to zero
- number_of_schemas_with_zero_non_working_days_exceeded - The number of schemes with zero non-working days is more than one
- number_of_schemas_exceeded - The number of schemes is greater than 10
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |
401 Unauthorized
Request authorization parameters are missing
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |
403 Forbidden
Insufficient rights to execute the request
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |
404 Not Found
Requested resource was not found
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |
429 Too Many Requests
Limit of requests was exceeded
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |
500 Internal Server Error
Internal server error
Body
application/json
{
"code": "example",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code Example: |