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

Example: <API key>

X-Client-ID

Type: string

Client ID

Min length: 1

Example: <Client ID>

X-Idempotency-Token

Type: string

Idempotent request token. Must contain only printable ASCII characters

Min length: 16

Max length: 64

Example: c56fa6537e5a4adbbce6ef3593210fb9

X-Park-ID

Type: string

Partner ID

Example: ee6f33c4562b4e1f8646d157bd70b2c4

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

minimum_period_days

Type: MinimumPeriodDays

Minimum rental period

Min value: 1

Example: 1

name

Type: RentTermName

Rent term name

Min length: 1

Max length: 500

Example: example

rent_term_id

Type: RentTermId

Rent term ID

Example: example

schemas

Type: RentSchemeDto[]

Rental schemes

Min items: 1

Example
[
  {
    "working_days": 1,
    "non_working_days": 0,
    "daily_amount": "50.1200"
  }
]

deposit_amount_daily

Type: DepositAmountDaily

Deposit rate per day

Number with 4 decimal places

Example: 50.1200

deposit_amount_total

Type: DepositAmountTotal

Full deposit amount for car rental

Number with 4 decimal places

Example: 50.1200

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

DailyAmount

Rental cost per day

Number with 4 decimal places

Type: Decimal

Example: 50.1200

RentSchemeDto

Rental scheme

Name

Description

daily_amount

Type: DailyAmount

Rental cost per day

Number with 4 decimal places

Example: 50.1200

non_working_days

Type: NonWorkingDays

Number of days in which the car is not rented

Min value: 0

Example: 0

working_days

Type: WorkingDays

Number of days on which the car is rented

Min value: 1

Example: 1

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

DepositAmountDaily

Deposit rate per day

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

Max length: 500

Example: example

rent_term_id

Type: RentTermId

Rent term ID

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

code

Type: string

Machine-readable error code

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

code

Type: string

Machine-readable error code

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

code

Type: string

Machine-readable error code

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

code

Type: string

Machine-readable error code

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

code

Type: string

Machine-readable error code

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

code

Type: string

Machine-readable error code

Example: example