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 Example: Min length: |
|
X-Client-ID* |
Type: string Client ID Example: Min length: |
|
X-Idempotency-Token* |
Type: string Idempotent request token.
Must contain only printable ASCII characters Example: Min length: Max length: |
|
X-Park-ID* |
Type: string Partner ID Example: |
Body
application/json
{
"rent_term_id": "string",
"name": "string",
"schemas": [
{
"working_days": 0,
"non_working_days": 0,
"daily_amount": "50.1200"
}
],
"minimum_period_days": 0,
"deposit_amount_total": "50.1200",
"deposit_amount_daily": "50.1200",
"is_buyout_possible": false
}
|
Name |
Description |
|
is_buyout_possible* |
Type: boolean Possibility of buying out a car |
|
minimum_period_days* |
Type: integer Minimum rental period Min value: |
|
name* |
Type: string Rent term name Min length: Max length: |
|
rent_term_id* |
Type: string Rent term ID |
|
schemas* |
Type: RentSchemeDto[] Rental schemes Min items: |
|
deposit_amount_daily |
Type: string Deposit rate per day Example: |
|
deposit_amount_total |
Type: string Full deposit amount for car rental Example: |
RentSchemeDto
Rental scheme
|
Name |
Description |
|
daily_amount* |
Type: string Rental cost per day Example: |
|
non_working_days* |
Type: integer Number of days in which the car is not rented Min value: |
|
working_days* |
Type: integer Number of days on which the car is rented Min value: |
Responses
200 OK
Rent term creation
Body
application/json
{
"rent_term_id": "string",
"name": "string"
}
|
Name |
Description |
|
name* |
Type: string Rent term name Min length: Max length: |
|
rent_term_id* |
Type: string Rent term ID |
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": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
401 Unauthorized
Request authorization parameters are missing
Body
application/json
{
"code": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
403 Forbidden
Insufficient rights to execute the request
Body
application/json
{
"code": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
404 Not Found
Requested resource was not found
Body
application/json
{
"code": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
429 Too Many Requests
Limit of requests was exceeded
Body
application/json
{
"code": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
500 Internal Server Error
Internal server error
Body
application/json
{
"code": "string",
"message": "Textual description of the error"
}
|
Name |
Description |
|
message* |
Type: string Human-readable error message Example: |
|
code |
Type: string Machine-readable error code |
No longer supported, please use an alternative and newer version.