request-external-payment method
Description
Creating a payment and checking its parameters.
Arguments for making a payment to a merchant
The parameters for making a payment to a merchant are defined by the counterparty when connecting to Yandex.Checkout. Additional information about payment parameters is provided in the payment solution protocol for merchants and integration scenarios.
Parameter | Type | Description |
---|---|---|
pattern_id | string | Payment Pattern ID. Corresponds to the merchant's scid (payment form number). |
instance_id | string | ID of the application instance. |
* | string | Payment Pattern parameters required by the merchant. |
Parameter | Type | Description |
---|---|---|
pattern_id | string | Payment Pattern ID. Corresponds to the merchant's scid (payment form number). |
instance_id | string | ID of the application instance. |
* | string | Payment Pattern parameters required by the merchant. |
Request parameters for making a deposit to a Yandex.Money user's Wallet:
Parameter | Type | Description |
---|---|---|
pattern_id | string | Constant value "p2p". |
instance_id | string | ID of the application instance. |
to | string | Account number to make the deposit to. |
amount | amount | Amount to deduct from the bank card (this amount minus the commission fee will be deposited to the account). |
amount_due | amount | Amount to deposit to your account (this amount plus the commission fee will be debited from the card). |
message | string | Comments on the deposit (displayed to the recipient). |
Parameter | Type | Description |
---|---|---|
pattern_id | string | Constant value "p2p". |
instance_id | string | ID of the application instance. |
to | string | Account number to make the deposit to. |
amount | amount | Amount to deduct from the bank card (this amount minus the commission fee will be deposited to the account). |
amount_due | amount | Amount to deposit to your account (this amount plus the commission fee will be debited from the card). |
message | string | Comments on the deposit (displayed to the recipient). |
After sending "request-payment", the user can be shown the commission for the payment. The response to the request will show the contract_amount. Use this formula to calculate the commission:
Commission = contract_amount - amount_due
The commission is rounded to the kopek (two decimal points). A commission that is less than one kopek is always rounded up to one kopek.
Returns
Response fields:
Parameter | Type | Description |
---|---|---|
status | string | Operation result code (see the table). |
error | string | Error code (explanation of the status field). Present only for errors (see the table). |
request_id | string | Payment context ID. Present only on success. |
contract_amount | amount | Amount to debit from the bank card, in rubles. Present only on success. |
title | string | Payment title. |
Parameter | Type | Description |
---|---|---|
status | string | Operation result code (see the table). |
error | string | Error code (explanation of the status field). Present only for errors (see the table). |
request_id | string | Payment context ID. Present only on success. |
contract_amount | amount | Amount to debit from the bank card, in rubles. Present only on success. |
title | string | Payment title. |
Operation processing result codes:
Code | Description |
---|---|
success | Success. |
refused | Payment processing was refused. The reason for refusal is returned in the error field. Final state. |
Code | Description |
---|---|
success | Success. |
refused | Payment processing was refused. The reason for refusal is returned in the error field. Final state. |
If an error occurs, its code is returned:
Code | Description |
---|---|
illegal_param_to | Invalid value for the to parameter. |
illegal_param_amount | Invalid value for the amount parameter. |
illegal_param_amount_due | Invalid value for the amount_due parameter. |
illegal_param_message | Invalid value for the message parameter. |
payee_not_found | Recipient not found; the specified account does not exist. |
payment_refused | The merchant refused to accept the payment (for example, the user tried to pay for an item that is not in stock). |
illegal_params or any other value | Required payment parameters are either missing, have invalid values, or logically contradict each other. |
Code | Description |
---|---|
illegal_param_to | Invalid value for the to parameter. |
illegal_param_amount | Invalid value for the amount parameter. |
illegal_param_amount_due | Invalid value for the amount_due parameter. |
illegal_param_message | Invalid value for the message parameter. |
payee_not_found | Recipient not found; the specified account does not exist. |
payment_refused | The merchant refused to accept the payment (for example, the user tried to pay for an item that is not in stock). |
illegal_params or any other value | Required payment parameters are either missing, have invalid values, or logically contradict each other. |
Examples
Example of a request to make a payment:
POST /api/request-external-payment HTTP/1.1
Host: money.yandex.ru
Content-Type: application/x-www-form-urlencoded
Content-Length: 130
pattern_id=99999&instance_id=1234567890ABCDEF1234567890ABCDEF1234
567890ABCDEF1234567890ABCDEF1&amount=100.00&merchantArticleId=123
Example of a request to make a deposit to an account:
POST /api/request-external-payment HTTP/1.1
Host: money.yandex.ru
Content-Type: application/x-www-form-urlencoded
Content-Length: 125
pattern_id=p2p&instance_id=1234567890ABCDEF1234567890ABCDEF123456
7890ABCDEF1234567890ABCDEF1&to=41001101140&amount_due=100.00
Example of a response document when successful:
{
"status": "success",
"request_id": "3931303833373438395f34343431646631386461623661
3236363063386361663834336137386537643935383639383062635f3330363
333323938",
"contract_amount": 100.00,
"title": "Оплата услуг NNNN"
}
Example of a response document for an error:
{"status": "refused", "error": "illegal_params"}