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: <API key>

Min length: 1

X-Client-ID*

Type: string

Client ID

Example: <Client ID>

Min length: 1

X-Idempotency-Token*

Type: string

Idempotent request token. Must contain only printable ASCII characters

Example: c56fa6537e5a4adbbce6ef3593210fb9

Min length: 16

Max length: 64

X-Park-ID*

Type: string

Partner ID

Example: ee6f33c4562b4e1f8646d157bd70b2c4

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: 1

name*

Type: string

Rent term name

Min length: 1

Max length: 500

rent_term_id*

Type: string

Rent term ID

schemas*

Type: RentSchemeDto[]

Rental schemes
Rental scheme

Min items: 1

deposit_amount_daily

Type: string

Deposit rate per day

Example: 50.1200

deposit_amount_total

Type: string

Full deposit amount for car rental

Example: 50.1200

RentSchemeDto

Rental scheme

Name

Description

daily_amount*

Type: string

Rental cost per day

Example: 50.1200

non_working_days*

Type: integer

Number of days in which the car is not rented

Min value: 0

working_days*

Type: integer

Number of days on which the car is rented

Min value: 1

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: 1

Max length: 500

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: Textual description of the error

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: Textual description of the error

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: Textual description of the error

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: Textual description of the error

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: Textual description of the error

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: Textual description of the error

code

Type: string

Machine-readable error code

No longer supported, please use an alternative and newer version.