Платежи
Создание платежа
Чтобы принять оплату, необходимо создать объект платежа: https://yookassa.ru/developers/api#payment_object — Payment. Он содержит всю необходимую информацию для проведения оплаты (сумму, валюту и статус). У платежа линейный жизненный цикл, он последовательно переходит из статуса в статус.
post/payments
Headers
Idempotence-Keystring required
Request body
Example request
{
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"description": "Оплата заказа № 72",
"receipt": {
"customer": {
"full_name": "Иванов Иван Иванович",
"inn": "6321341814",
"email": "user@yoomoney.ru",
"phone": "79000000000"
},
"items": [
{
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"quantity": 1,
"measure": "piece",
"mark_quantity": {
"numerator": 1,
"denominator": 100
},
"country_of_origin_code": "RU",
"customs_declaration_number": "10714040/140917/0090376",
"excise": "20.00",
"product_code": "00 00 00 01 00 21 FA 41 00 23 05 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 AB 00",
"mark_mode": "0",
"payment_subject_industry_details": [
{
"federal_id": "001",
"document_date": "2020-11-18",
"value": "123/43"
}
]
}
],
"receipt_industry_details": [
{
"federal_id": "001",
"document_date": "2020-11-18",
"value": "123/43"
}
],
"receipt_operational_details": {
"created_at": "2020-07-03T11:52:31.827Z"
}
},
"recipient": {
"gateway_id": "456"
},
"payment_token": "+u7PDjMTkf08NtD66P6+eYWa2yjU3gsSIhOOO+OWsOg=",
"payment_method_id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
"payment_method_data": {
"card": {
"number": "5105105105105100",
"expiry_year": "2017",
"expiry_month": "07",
"cardholder": "John Smith"
}
},
"confirmation": {
"locale": "ru_RU",
"enforce": true
},
"save_payment_method": true,
"capture": true,
"airline": {
"ticket_number": "5554916004417",
"booking_reference": "IIIKRV",
"passengers": [
{
"first_name": "SERGEI",
"last_name": "IVANOV"
}
],
"legs": [
{
"departure_airport": "LED",
"destination_airport": "AMS",
"departure_date": "2018-06-20",
"carrier_code": "SU"
}
]
},
"transfers": [
{
"account_id": "123",
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"platform_fee_amount": {
"value": "1000.00",
"currency": "RUB"
},
"description": "Заказ маркетплейса №72"
}
],
"deal": {
"id": "dl-d68d2fe4-2abb-47e5-8112-32e28f87fb52",
"settlements": [
{
"type": "payout",
"amount": {
"value": "1000.00",
"currency": "RUB"
}
}
]
},
"merchant_customer_id": "user@test.merchant",
"payment_order": {
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"payment_purpose": "Оплата по договору №2143",
"kbk": "70311105013130000120",
"oktmo": "98627153",
"payment_document_id": "34СТ185329-01-2352",
"unified_account_number": "60АА000593",
"service_id": "34СТ185329-01"
},
"receiver": {
"type": "mobile_balance",
"phone": "79000000000"
},
"statements": [
{
"delivery_method": {
"type": "email",
"email": "user@yoomoney.ru"
}
}
]
}Response
Запрос успешно обработан
Example response
{
"id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
"status": "succeeded",
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"income_amount": {
"value": "1000.00",
"currency": "RUB"
},
"description": "Оплата заказа № 72",
"recipient": {
"account_id": "123",
"gateway_id": "456"
},
"payment_method": {
"type": "bank_card",
"id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
"saved": true,
"status": "active",
"title": "Основная карта",
"card": {
"first6": "427918",
"last4": "7918",
"expiry_year": "2017",
"expiry_month": "07",
"card_product": {
"code": "MCP",
"name": "MIR Privilege"
},
"issuer_country": "RU",
"issuer_name": "Sberbank"
}
},
"captured_at": "2017-11-03T11:52:31.827Z",
"created_at": "2017-11-03T11:52:31.827Z",
"expires_at": "2017-11-03T11:52:31.827Z",
"confirmation": {
"type": "redirect",
"enforce": true
},
"refunded_amount": {
"value": "1000.00",
"currency": "RUB"
},
"paid": true,
"refundable": true,
"receipt_registration": "succeeded",
"cancellation_details": {
"reason": "insufficient_funds"
},
"authorization_details": {
"rrn": "603668680243",
"auth_code": "062467",
"three_d_secure": {
"applied": true
}
},
"transfers": [
{
"account_id": "123",
"amount": {
"value": "1000.00",
"currency": "RUB"
},
"status": "succeeded",
"platform_fee_amount": {
"value": "1000.00",
"currency": "RUB"
},
"description": "Заказ маркетплейса №72"
}
],
"deal": {
"id": "dl-d68d2fe4-2abb-47e5-8112-32e28f87fb52",
"settlements": [
{
"type": "payout",
"amount": {
"value": "1000.00",
"currency": "RUB"
}
}
]
},
"merchant_customer_id": "user@test.merchant",
"invoice_details": {
"id": "in-e44e8088-bd73-43b1-959a-954f3a7d0c54"
}
}