Create transaction on contractor account

Create transaction on contractor account

Request

POST

https://fleet-api.taxi.yandex.net/v3/parks/driver-profiles/transactions

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

Body

application/json
{
  "park_id": "example",
  "contractor_profile_id": "example",
  "amount": "1050.5000",
  "description": "example",
  "condition": {
    "balance_min": null
  },
  "version": 1,
  "data": {
    "kind": "other",
    "reason": "example"
  }
}

Name

Description

amount

Type: Amount

The amount of the transaction. If the sign is '-', the amount will be deducted from the balance, if '+' is added to the balance. Must be different from 0.

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

contractor_profile_id

Type: ContractorProfileId

Contractor identifier

Min length: 1

Max length: 100

Example: example

data

One of 11 types
  • Type: OtherData

    Data when there is no category for this transaction type

    Example
    {
      "kind": "other",
      "reason": "example"
    }
    
  • Type: RentData

    Transaction data related to rent

    Example
    {
      "kind": "rent",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "schedule": {
        "working_days": 0,
        "holidays": 0
      }
    }
    
  • Type: DepositData

    Transaction data related to funds deposit

    Example
    {
      "kind": "deposit",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "schedule": {
        "working_days": 0,
        "holidays": 0
      },
      "limits": {
        "limit": "1050.5000",
        "remains": null
      }
    }
    
  • Type: PayoutData

    Transaction data related to funds payout

    Example
    {
      "kind": "payout",
      "fee_amount": "1050.5000",
      "bank_fee": null,
      "rule": {
        "fee_percent": "1.5",
        "fee_min_amount": null
      },
      "masked_requisites": {
        "value": "example",
        "date": "example"
      }
    }
    
  • Type: InsuranceData

    Transaction data related to insurance payment

    Example
    {
      "kind": "insurance",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "schedule": {
        "working_days": 0,
        "holidays": 0
      },
      "limits": {
        "limit": "1050.5000",
        "remains": null
      }
    }
    
  • Type: FineData

    Transaction data related to fines payment

    Example
    {
      "kind": "fine",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "park_fee": "1050.5000",
      "integrator_fee": null,
      "uin": null
    }
    
  • Type: DamageData

    Transaction data related to vehicle damage expenses payment

    Example
    {
      "kind": "damage",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "schedule": {
        "working_days": 0,
        "holidays": 0
      },
      "limits": {
        "limit": "1050.5000",
        "remains": null
      }
    }
    
  • Type: FuelData

    Transaction data related to fuel payment

    Example
    {
      "kind": "fuel",
      "object": {
        "object_id": "example",
        "object_type": "vehicle",
        "object_name": "example"
      },
      "type": "example",
      "category": "example",
      "value": "example",
      "units": "liters"
    }
    
  • Type: ReferalData

    Transaction data related to referral program

    Example
    {
      "kind": "referal",
      "parent_driver_id": "example",
      "child_driver_id": null,
      "required_orders_count": 0
    }
    
  • Type: TopupData

    Transaction data related to contractor's account top-up

    Example
    {
      "kind": "topup",
      "fee_amount": "1050.5000",
      "bank_fee": null,
      "rule": {
        "fee_percent": "1.5",
        "fee_min_amount": null
      }
    }
    
  • Type: BonusData

    Transaction data related to contractor's bonus payment

    Example
    {
      "kind": "bonus",
      "orders_count": 0,
      "receipt_condition": "example"
    }
    
Example
{
  "kind": "other",
  "reason": "example"
}

park_id

Type: ParkId

Park ID

Min length: 1

Max length: 100

Example: example

condition

Type: Condition

Transaction execution conditions

Example
{
  "balance_min": "1050.5000"
}

description

Type: string

Min length: 1

Max length: 256

Example: example

version

Type: integer

The transaction version must be greater than the existing transaction version or 1 for the new one. Only the fields that affect the transaction amount: 'amount', 'fee_amount', 'park_fee' can be changed. The condition (the 'condition' field) is not applied when updating the transaction.

Min value: 1

ParkId

Park ID

Type: string

Min length: 1

Max length: 100

Example: example

ContractorProfileId

Contractor identifier

Type: string

Min length: 1

Max length: 100

Example: example

Amount

Type: string

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

Condition

Transaction execution conditions

Name

Description

balance_min

Type: Amount

Minimum balance before transaction execution

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

Example
{
  "balance_min": "1050.5000"
}

SafeString

Type: string

Min length: 1

Max length: 1000

Example: example

OtherData

Data when there is no category for this transaction type

Name

Description

kind

Type: string

Const: other

Example: example

reason

Type: SafeString

Short description of the reason for the debit/credit

Min length: 1

Max length: 1000

Example: example

Example
{
  "kind": "other",
  "reason": "example"
}

ExternalObjectId

Object identifier

Type: string

Min length: 1

Max length: 100

Example: example

ObjectType

Transaction object type

Type: string

Enum: vehicle, other

ObjectInfo

Transaction object

Name

Description

object_id

Type: ExternalObjectId

Object identifier

Min length: 1

Max length: 100

Example: example

object_type

Type: ObjectType

Transaction object type

Enum: vehicle, other

object_name

Type: SafeString

Object type if no suitable type exists

Min length: 1

Max length: 1000

Example: example

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

ScheduleType

Transaction schedule

Name

Description

holidays

Type: integer

Number of holidays

working_days

Type: integer

Number of working days

Example
{
  "working_days": 0,
  "holidays": 0
}

RentData

Transaction data related to rent

Name

Description

kind

Type: string

Const: rent

Example: example

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

schedule

Type: ScheduleType

Transaction schedule

Example
{
  "working_days": 0,
  "holidays": 0
}
Example
{
  "kind": "rent",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "schedule": {
    "working_days": 0,
    "holidays": 0
  }
}

Limits

Transaction limits

Name

Description

limit

Type: Amount

Deposit accumulation limit

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

remains

Type: Amount

Remaining deposit amount to be paid

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

Example
{
  "limit": "1050.5000",
  "remains": null
}

DepositData

Transaction data related to funds deposit

Name

Description

kind

Type: string

Const: deposit

Example: example

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

limits

Type: Limits

Transaction limits

Example
{
  "limit": "1050.5000",
  "remains": null
}

schedule

Type: ScheduleType

Transaction schedule

Example
{
  "working_days": 0,
  "holidays": 0
}
Example
{
  "kind": "deposit",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "schedule": {
    "working_days": 0,
    "holidays": 0
  },
  "limits": {
    "limit": "1050.5000",
    "remains": null
  }
}

FeePercent

Type: string

Pattern: ^[0-9]+(\.[0-9]{1,4})?$

Example: 1.5

TransactionRule

Commission calculation rules for transaction

Name

Description

fee_min_amount

Type: Amount

Minimum commission value

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

fee_percent

Type: FeePercent

Pattern: ^[0-9]+(\.[0-9]{1,4})?$

Example: 1.5

Example
{
  "fee_percent": "1.5",
  "fee_min_amount": "1050.5000"
}

PayoutMaskedRequisites

Masked requisites used for the transaction

Name

Description

date

Type: SafeString

Card binding date (if card transfer)

Min length: 1

Max length: 1000

Example: example

value

Type: string

Masked requisite value (card number, phone number...)

Pattern: ^\*{1,30}.{1,4}$

Example: example

Example
{
  "value": "example",
  "date": "example"
}

PayoutData

Transaction data related to funds payout

Name

Description

fee_amount

Type: Amount

Commission value withheld from the contractor. Affects the balance of the contractor. If the sign is '-', the amount will be deducted from the balance, if '+' is added to the balance.

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

kind

Type: string

Const: payout

Example: example

bank_fee

Type: Amount

Commission value withheld by the bank

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

masked_requisites

Type: PayoutMaskedRequisites

Masked requisites used for the transaction

Example
{
  "value": "example",
  "date": "example"
}

rule

Type: TransactionRule

Commission calculation rules for transaction

Example
{
  "fee_percent": "1.5",
  "fee_min_amount": "1050.5000"
}
Example
{
  "kind": "payout",
  "fee_amount": "1050.5000",
  "bank_fee": null,
  "rule": {
    "fee_percent": "1.5",
    "fee_min_amount": null
  },
  "masked_requisites": {
    "value": "example",
    "date": "example"
  }
}

InsuranceData

Transaction data related to insurance payment

Name

Description

kind

Type: string

Const: insurance

Example: example

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

limits

Type: Limits

Transaction limits

Example
{
  "limit": "1050.5000",
  "remains": null
}

schedule

Type: ScheduleType

Transaction schedule

Example
{
  "working_days": 0,
  "holidays": 0
}
Example
{
  "kind": "insurance",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "schedule": {
    "working_days": 0,
    "holidays": 0
  },
  "limits": {
    "limit": "1050.5000",
    "remains": null
  }
}

FineData

Transaction data related to fines payment

Name

Description

kind

Type: string

Const: fine

Example: example

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

park_fee

Type: Amount

Commission value withheld from the contractor. Affects the balance of the contractor. If the sign is '-', the amount will be deducted from the balance, if '+' is added to the balance.

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

integrator_fee

Type: Amount

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

uin

Type: SafeString

Unique accrual identifier

Min length: 1

Max length: 1000

Example: example

Example
{
  "kind": "fine",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "park_fee": "1050.5000",
  "integrator_fee": null,
  "uin": null
}

DamageData

Transaction data related to vehicle damage expenses payment

Name

Description

kind

Type: string

Const: damage

Example: example

limits

Type: Limits

Transaction limits

Example
{
  "limit": "1050.5000",
  "remains": null
}

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

schedule

Type: ScheduleType

Transaction schedule

Example
{
  "working_days": 0,
  "holidays": 0
}
Example
{
  "kind": "damage",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "schedule": {
    "working_days": 0,
    "holidays": 0
  },
  "limits": {
    "limit": "1050.5000",
    "remains": null
  }
}

FuelType

Fuel type

Type: string

Min length: 1

Max length: 100

Example: example

FuelCategory

Fuel category: 92/98/propane/butane

Type: string

Min length: 1

Max length: 100

Example: example

Value

Volume value

Type: string

Min length: 1

Max length: 10

Example: example

Units

Volume measurement unit

Type: string

Enum: liters, cubic_meters

FuelData

Transaction data related to fuel payment

Name

Description

kind

Type: string

Const: fuel

Example: example

object

Type: ObjectInfo

Transaction object

Example
{
  "object_id": "example",
  "object_type": "vehicle",
  "object_name": "example"
}

category

Type: FuelCategory

Fuel category: 92/98/propane/butane

Min length: 1

Max length: 100

Example: example

type

Type: FuelType

Fuel type

Min length: 1

Max length: 100

Example: example

units

Type: Units

Volume measurement unit

Enum: liters, cubic_meters

value

Type: Value

Volume value

Min length: 1

Max length: 10

Example: example

Example
{
  "kind": "fuel",
  "object": {
    "object_id": "example",
    "object_type": "vehicle",
    "object_name": "example"
  },
  "type": "example",
  "category": "example",
  "value": "example",
  "units": "liters"
}

ReferalData

Transaction data related to referral program

Name

Description

kind

Type: string

Const: referal

Example: example

child_driver_id

Type: ExternalObjectId

Object identifier

Min length: 1

Max length: 100

Example: example

parent_driver_id

Type: ExternalObjectId

Object identifier

Min length: 1

Max length: 100

Example: example

required_orders_count

Type: integer

Number of orders the contractor must complete to receive the bonus

Min value: 0

Example
{
  "kind": "referal",
  "parent_driver_id": "example",
  "child_driver_id": null,
  "required_orders_count": 0
}

TopupData

Transaction data related to contractor's account top-up

Name

Description

fee_amount

Type: Amount

Commission value withheld from the contractor. Affects the balance of the contractor. If the sign is '-', the amount will be deducted from the balance, if '+' is added to the balance.

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

kind

Type: string

Const: topup

Example: example

bank_fee

Type: Amount

Pattern: ^-?[0-9]+(\.[0-9]{1,4})?$

Example: 1050.5000

rule

Type: TransactionRule

Commission calculation rules for transaction

Example
{
  "fee_percent": "1.5",
  "fee_min_amount": "1050.5000"
}
Example
{
  "kind": "topup",
  "fee_amount": "1050.5000",
  "bank_fee": null,
  "rule": {
    "fee_percent": "1.5",
    "fee_min_amount": null
  }
}

BonusData

Transaction data related to contractor's bonus payment

Name

Description

kind

Type: string

Const: bonus

Example: example

orders_count

Type: integer

Number of orders required to receive the bonus. 0 if hiring bonus.

Min value: 0

receipt_condition

Type: SafeString

Short description of the reason for receiving the bonus

Min length: 1

Max length: 1000

Example: example

Example
{
  "kind": "bonus",
  "orders_count": 0,
  "receipt_condition": "example"
}

Responses

200 OK

Transaction information

Body

application/json
{
  "id": "example",
  "created_at": "2019-08-08T11:58:01+00:00",
  "status": "in_progress",
  "version": 0,
  "status_description": "example",
  "event_id": "example"
}

Name

Description

created_at

Type: DateTime

Date and time in ISO 8601 format with timezone

Example: 2019-08-08T11:58:01+00:00

event_id

Type: string

ID of the event that initiates the creation of transactions via the api

Example: example

id

Type: string

Example: example

status

Type: EventStatus

Event processing status

Enum: in_progress, success, fail

version

Type: integer

status_description

Type: SafeString

Min length: 1

Max length: 1000

Example: example

DateTime

Date and time in ISO 8601 format with timezone

Type: string<date-time>

Example: 2019-08-08T11:58:01+00:00

EventStatus

Event processing status

Type: string

Enum: in_progress, success, fail

400 Bad Request

Invalid request parameters

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

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