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: 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: |
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: Example: |
|
contractor_profile_id |
Type: ContractorProfileId Contractor identifier Min length: Max length: Example: |
|
data |
One of 11 types
Example
|
|
park_id |
Type: ParkId Park ID Min length: Max length: Example: |
|
condition |
Type: Condition Transaction execution conditions Example
|
|
description |
Type: string Min length: Max length: 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: |
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: Example: |
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: Example: |
|
reason |
Type: SafeString Short description of the reason for the debit/credit Min length: Max length: 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: Max length: Example: |
|
object_type |
Type: ObjectType Transaction object type Enum: |
|
object_name |
Type: SafeString Object type if no suitable type exists Min length: Max length: 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: Example: |
|
object |
Type: ObjectInfo Transaction object Example
|
|
schedule |
Type: ScheduleType Transaction schedule Example
|
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: Example: |
|
remains |
Type: Amount Remaining deposit amount to be paid Pattern: Example: |
Example
{
"limit": "1050.5000",
"remains": null
}
DepositData
Transaction data related to funds deposit
|
Name |
Description |
|
kind |
Type: string Const: Example: |
|
object |
Type: ObjectInfo Transaction object Example
|
|
limits |
Type: Limits Transaction limits Example
|
|
schedule |
Type: ScheduleType Transaction schedule Example
|
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: Example: |
|
fee_percent |
Type: FeePercent Pattern: Example: |
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: Max length: Example: |
|
value |
Type: string Masked requisite value (card number, phone number...) Pattern: 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: Example: |
|
kind |
Type: string Const: Example: |
|
bank_fee |
Type: Amount Commission value withheld by the bank Pattern: Example: |
|
masked_requisites |
Type: PayoutMaskedRequisites Masked requisites used for the transaction Example
|
|
rule |
Type: TransactionRule Commission calculation rules for transaction Example
|
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: Example: |
|
object |
Type: ObjectInfo Transaction object Example
|
|
limits |
Type: Limits Transaction limits Example
|
|
schedule |
Type: ScheduleType Transaction schedule Example
|
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: Example: |
|
object |
Type: ObjectInfo Transaction object 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: Example: |
|
integrator_fee |
Type: Amount Pattern: Example: |
|
uin |
Type: SafeString Unique accrual identifier Min length: Max length: 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: Example: |
|
limits |
Type: Limits Transaction limits Example
|
|
object |
Type: ObjectInfo Transaction object Example
|
|
schedule |
Type: ScheduleType Transaction schedule Example
|
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: Example: |
|
object |
Type: ObjectInfo Transaction object Example
|
|
category |
Type: FuelCategory Fuel category: 92/98/propane/butane Min length: Max length: Example: |
|
type |
Type: FuelType Fuel type Min length: Max length: Example: |
|
units |
Type: Units Volume measurement unit Enum: |
|
value |
Type: Value Volume value Min length: Max length: 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: Example: |
|
child_driver_id |
Type: ExternalObjectId Object identifier Min length: Max length: Example: |
|
parent_driver_id |
Type: ExternalObjectId Object identifier Min length: Max length: Example: |
|
required_orders_count |
Type: integer Number of orders the contractor must complete to receive the bonus Min value: |
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: Example: |
|
kind |
Type: string Const: Example: |
|
bank_fee |
Type: Amount Pattern: Example: |
|
rule |
Type: TransactionRule Commission calculation rules for transaction Example
|
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: Example: |
|
orders_count |
Type: integer Number of orders required to receive the bonus. 0 if hiring bonus. Min value: |
|
receipt_condition |
Type: SafeString Short description of the reason for receiving the bonus Min length: Max length: 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: |
|
event_id |
Type: string ID of the event that initiates the creation of transactions via the api Example: |
|
id |
Type: string Example: |
|
status |
Type: EventStatus Event processing status Enum: |
|
version |
Type: integer |
|
status_description |
Type: SafeString Min length: Max length: 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: |
|
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: |
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: |