YooMoney response format
The response to a request contains an HTTP response (status) code, standard headers, and if neccessary a response body.
Response body in case of success
The main entity of the YooMoney API is an object. For example, to make a payment, you need a payment object, and to make a payout, you need a payout object. Each request to the YooMoney API is associated with performing a specific action with an object, for example, creating an object, obtaining information about it.
Upon successful processing of a request (HTTP 200), YooMoney returns the created, modified, or requested object or list of objects in the response body. The response body format is JSON. The response body parameters depend on the request.
Example of response body
JSON
{ "id": "23d93cac-000f-5000-8000-126628f15141", "status": "pending", "paid": false, "amount": { "value": "100.00", "currency": "RUB" }, "confirmation": { "type": "redirect", "confirmation_url": "https://yoomoney.ru/api-pages/v2/payment-confirm/epl?orderId=23d93cac-000f-5000-8000-126628f15141" }, "created_at": "2019-01-22T14:30:45.129Z", "description": "Order No. 1", "metadata": {}, "recipient": { "account_id": "100500", "gateway_id": "100700" }, "refundable": false, "test": false }
Response body in case of failure
If something is wrong with the request (HTTP response code other than 200), then HTTP response codes 400, 401, 403, 404, 429, and 500 will return a response body in JSON format with a description of the error.
Parameter | Type | Description |
---|---|---|
type | string | Object type. The fixed value is error .Required parameter |
id | string | Error ID. Use it if you need to contact technical support. Required parameter |
code | string | Error code. Possible values:
Required parameter |
description | string | Error description in English. Optional parameter |
parameter | string | Name of the header or response body parameter that caused the error. Optional parameter |
Example of response body in case of error
JSON
{ "type" : "error", "id" : "e65a8f85-f8b7-4f4f-9fd3-bfef99aacbbb", "code" : "invalid_request", "description" : "Idempotence key is too long. Send the value in accordance with the documentation", "parameter" : "Idempotence-Key" }
Responses with other HTTP codes (405, 415) do not have a body. For these responses, the reason for the error is specified in the headers (for example, in the
Reason-Phrase
header).For more information on error responses, see description of HTTP response codes.
See also