### Scope Parameter Examples (Yoomoney) Source: https://yoomoney.ru/docs/wallet/wallet/using-api/authorization/protocol-rights_lang=ru Examples demonstrating the use of 'scope' parameters to define access rights and transaction limitations. These include viewing history, making payments to specific accounts or patterns with defined limits. ```plaintext account-info operation-history operation-details ``` ```plaintext account-info payment.to-pattern("123").limit(7,1000) ``` ```plaintext payment.to-account("XXXX").limit(14,500) ``` ```plaintext payment.to-account("ZZZ","phone").limit(,500) ``` ```plaintext payment.to-pattern("123").limit(7,1000) money-source("wallet","card") ``` -------------------------------- ### Example JSON Response with Payment Parameters Source: https://yoomoney.ru/docs/wallet/wallet/showcase/submit_lang=ru An example of a successful HTTP 200 OK response from the YooMoney API. It includes the 'params' object containing details like 'pattern_id', 'ContractTemplateID', and 'netSum', which are essential for initiating a payment. ```json HTTP/1.1 200 OK Content-Type: application/json Content-Length: 197 Cache-Control: no-cache {"params":{"pattern_id":"5506","ContractTemplateID":"525923","sc_param_scid":"5506","netSum":"2","ShopArticleID":"71747","sc_param_step":"","ShopID":"14061","ShowCaseID":"6101","skypename":"test"}} ``` -------------------------------- ### Yoomoney Text Input with Pattern and Keyboard Suggest Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of a 'text' type UI control for numeric input (e.g., KБК) in a Yoomoney payment form. It includes a 'pattern' for validation and 'keyboard_suggest' to display a numeric keyboard on mobile devices. ```json { "type": "text", "name": "kbk", "label": "КБК", "pattern": "[0-9]{20}", "required": true, "readonly": false, "keyboard_suggest": "number" } ``` -------------------------------- ### Request Subsequent Pages of Payment History (HTTP) Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-history_lang=ru This example shows how to request subsequent pages of payment history from the YooMoney API. It utilizes parameters like 'type' for filtering, 'records' for the number of entries, and 'start_record' to specify the starting point for the next page of results, essential for pagination. ```http POST /api/operation-history HTTP/1.1 Host: yoomoney.ru Authorization: Bearer 410012345678901.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123 Content-Type: application/x-www-form-urlencoded Content-Length: 40 type=payment&records=20&start_record=120 ``` -------------------------------- ### Example: Form Not Found (HTTP 404) Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description-request_lang=ru This example demonstrates the response when a requested payment form does not exist or is not accessible. The API returns an HTTP 404 Not Found status code with an empty response body. ```HTTP HTTP/1.1 404 Not Found Content-Length: 0 ``` -------------------------------- ### Yoomoney Form Money Source Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of the 'money_source' block in a Yoomoney payment form description. This array lists the available payment methods, such as wallet, cards, payment-card, and cash. ```json { "money_source": [ "wallet", "cards", "payment-card", "cash" ] } ``` -------------------------------- ### Example POST Request for Form Submission Source: https://yoomoney.ru/docs/wallet/wallet/showcase/submit_lang=ru This example demonstrates a typical HTTP POST request to submit form data to the YooMoney API. It includes essential headers like Host, Content-Type, Content-Length, Accept-Language, and Accept-Encoding, along with the form data payload. ```http POST /api/showcase/validate/5551/step_INN_3038 HTTP/1.1 Host: yoomoney.ru Content-Type: application/x-www-form-urlencoded Content-Length: 115 Accept-Language: ru Accept-Encoding: gzip supplierInn=4704020508&ShopID=13423&ShopArticleID=35241&ShowCaseID=3005&ContractTemplateID=524867&budgetDocNumber=0 ``` -------------------------------- ### YooMoney Authorization Request Parameters Example (URL Encoded) Source: https://yoomoney.ru/docs/wallet/wallet/using-api/authorization/request-access-token_lang=ru Provides an example of the URL-encoded parameters for the authorization request. This format is used in the body of the POST request to YooMoney. ```urlencoded client_id=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01&response_type=code&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb&scope=account%2Dinfo%20operation%2Dhistory ``` -------------------------------- ### Yoomoney Form Structure Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example illustrating the 'form' block in a Yoomoney payment form description. This element is the root container for the form, holding a list of UI controls and containers to be rendered vertically. ```json { "form": [ ... UI-контролы и контейнеры ... ] } ``` -------------------------------- ### Account Info API Response Example Source: https://yoomoney.ru/docs/wallet/wallet/user-account/account-info Provides an example of a successful JSON response from the /api/account-info endpoint. The response includes the user's account number, balance, currency, account status, account type, and optionally detailed balance information and linked card details. ```json { "account": "4100123456789", "balance": 1000.00, "currency": "643", "account_status": "anonymous", "account_type": "personal", "cards_linked": [ { "pan_fragment": "510000******9999", "type": "MasterCard" } ] } ``` -------------------------------- ### YooMoney P2P Transfer by Phone Number Request Example Source: https://yoomoney.ru/docs/wallet/wallet/process-payments/request-payment_lang=ru This example shows how to initiate a P2P transfer using a recipient's phone number. It includes the `identifier_type` parameter set to 'phone' along with other standard P2P transfer details. The `to` field should contain the phone number. ```http POST /api/request-payment HTTP/1.1 Host: yoomoney.ru Authorization: Bearer 410012345678901.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123 Content-Type: application/x-www-form-urlencoded Content-Length: 256 pattern_id=p2p&to=79219990099&identifier_type=phone&amount=1000.00&message=%d0%97%d0%b0+%d0%b2%d0%ba%d1%83%d1%81%d0%bd%d1%8b%d0%b9+%d0%b1%d1%83%d0%b1%d0%bb%d0%b8%d0%ba&comment=%d0%ba%d1%83%d0%bf%d0%b8%d1%82%d0%b5+%d0%b1%d1%83%d0%b1%d0%bb%d0%b8%d0%ba%d0%b8! ``` -------------------------------- ### Autofill Macro Example in JSON Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Demonstrates how to use the 'value_autofill' property in a JSON form configuration to pre-fill a field with a specific value, such as the user's account key. This macro is processed client-side. ```json { "type": "text", "name": "Ewallet", "label": "Номер счета", "hint": "На этот счет будут зачисляться деньги", "value_autofill": "currentuser_accountkey", "pattern": "[0-9]{11,33}" } ``` -------------------------------- ### Searching for Business Details Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-details This example demonstrates how to search for business details using the YooMoney API. It requires an access token and typically involves providing search parameters. ```javascript async function searchBusinessDetails(accessToken, query) { const response = await fetch(`https://yoomoney.ru/api/search-business-details?query=${encodeURIComponent(query)}`, { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}` } }); const data = await response.json(); return data; } ``` -------------------------------- ### Yoomoney Number Input Control Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of a 'number' type UI control in a Yoomoney payment form. This field is for numerical input and includes attributes like step for defining the number's gradation. ```json { "type": "number", "name": "qty", "label": "Количество, шт.", "step": 1, "required": true } ``` -------------------------------- ### Example: Successful Form Description Retrieval (JSON) Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description-request_lang=ru This example shows a successful response (HTTP 300 Multiple Choices) from the YooMoney API when requesting a payment form description. The response includes the form details in JSON format and specifies the location for submitting the form data. ```HTTP HTTP/1.1 300 Multiple Choices Location: https://yoomoney.ru/api/showcase/5551 Content-Type: application/json Content-Length: 539 Cache-Control: private Last-Modified: Thu, 17 Jul 2014 09:00:25 GMT { "money_source": [ "wallet", "cards", "payment-card", "cash" ], "title":"Квитанции", "hidden_fields":{ "ShopID":"13423", "ShopArticleID":"35241", "ShowCaseID":"3005", "ContractTemplateID":"524867", "budgetDocNumber":"0", "has_external_status":"", "is_withdrawal":"" }, "form": [ { "type":"text", "name":"supplierInn", "hint":"10 цифр (для ИП - 12 цифр)", "label":"ИНН получателя:", "alert":"Пожалуйста, укажите ИНН получателя", "required":true, "readonly":false, "minlength":10, "maxlength":12, "pattern":"^\\d{10}$|^\\d{12}$" }, { "type":"submit", "label":"Продолжить" } ] } ``` -------------------------------- ### Yoomoney Text Input Control Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of a 'text' type UI control in a Yoomoney payment form. This represents a single-line text input field with common attributes like type, name, label, required, and readonly. ```json { "type": "text", "name": "surname", "label": "Фамилия", "required": true, "readonly": false } ``` -------------------------------- ### Example HTTP Incoming Transfer Notification Source: https://yoomoney.ru/docs/wallet/wallet/using-api/notification-p2p-incoming_lang=ru This example shows the format of an incoming transfer notification when using the HTTP protocol. Notably, sender-specific details like name, address, phone, and email are omitted for privacy when not using HTTPS. ```text operation_id = 904035776918098009 notification_type = p2p-incoming datetime = 2014-04-28T16:31:28Z sha1_hash = 8693ddf402fe5dcc4c4744d466cabada2628148c sender = 41003188981230 codepro = false currency = 643 amount = 0.99 withdraw_amount = 1.00 label = YM.label.12345 ``` -------------------------------- ### Setting Daily Payment Limit Source: https://yoomoney.ru/docs/wallet/wallet/using-api/authorization/protocol-rights_lang=ru Example of setting a daily limit for payments. This allows a maximum sum of 100.50 per day, and the user can modify the payment amount. ```text .limit(1,100.50) ``` -------------------------------- ### Operation-Details Method API Request Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-details This example shows how to retrieve detailed information about a specific operation using its unique identifier. It requires an access token and the operation's ID. ```javascript async function getOperationDetails(accessToken, operationId) { const response = await fetch(`https://yoomoney.ru/api/operation-details?operation_id=${operationId}`, { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}` } }); const data = await response.json(); return data; } ``` -------------------------------- ### Form Description with Pre-filled Fields Source: https://yoomoney.ru/docs/wallet/wallet/using-api/authorization/protocol-rights_lang=en Explains how to request a form description where certain fields are pre-filled with values. This is useful for guiding users through multi-step payment processes. ```http POST https://yoomoney.ru/api/payment-forms/form-description-with-values # Form description request with pre-filled field values ``` -------------------------------- ### Operation Details Response (Payment to Shop) Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-details_lang=ru Example JSON response from the YooMoney API for the operation-details method when the transaction was a payment to a shop. It includes operation ID, status, amount, direction, datetime, title, and details. ```json { "operation_id": "1234567", "status": "success", "pattern_id": "2904", "amount": 500.00, "direction": "out", "datetime": "2011-07-11T20:43:00.000+04:00", "title": "Оплата ADSL-доступа компании Мой-Провайдер", "details": "Предоплата услуг ADSL-доступа в интернет компании ООО \"XXX\"\nНомер лицевого счета абонента: \n1234567/89\nЗачисленная сумма: 500.00\nНомер транзакции: 2000002967767", "type": "payment-shop" } ``` -------------------------------- ### Example Search Organization Details API Request Source: https://yoomoney.ru/docs/wallet/wallet/showcase/search_lang=ru An example of an HTTP GET request to the YooMoney API for searching organization payment forms. This specific example searches for 'Петроэлектросбыт' and requests a maximum of 3 records. ```http GET /api/showcase-search?query=Петроэлектросбыт&records=3 HTTP/1.1 Host: yoomoney.ru Accept: */* ``` -------------------------------- ### Yoomoney Form Title Field Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of the 'title' field in a Yoomoney payment form description. This field represents the name of the item being paid for and is of type string. ```json { "title": "Ростелеком Северо-Запад" } ``` -------------------------------- ### YooMoney Payment Methods Example (JSON) Source: https://yoomoney.ru/docs/wallet/wallet/process-payments/request-payment_lang=ru This JSON snippet illustrates the structure of available payment methods for a YooMoney transaction. It shows whether wallet and card payments are allowed, and for cards, if CSC is required and details of linked cards. ```json { "wallet": { "allowed": true }, "cards": { "allowed": true, "csc_required": true, "items": [ { "id": "card-385244400", "pan_fragment": "5280****7918", "type": "MasterCard" }, { "id": "card-385244401", "pan_fragment": "4008****7919", "type": "Visa" } ] } } ``` -------------------------------- ### ViewState Logic Example (Conceptual) Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Illustrates the conceptual logic for ViewState, which manages form element visibility based on selected values. It mimics a switch-case structure to control which UI elements are displayed in different form states. ```pseudocode select { option X => elements visible in state X option Y => elements visible in state Y option Z => .... } ``` -------------------------------- ### Yoomoney Form Hidden Fields Example Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Example of the 'hidden_fields' block in a Yoomoney payment form description. This object contains service fields that must be transparently passed by the client when submitting form data. ```json { "hidden_fields": { "targetcurrency": "643", "ShopArticleID": "35241" } } ``` -------------------------------- ### Initiating a Payment (Request-payment Method) Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description-request Illustrates the initial step in processing a payment using the 'request-payment' method. This method prepares the payment and returns details needed for confirmation. ```http POST https://yoomoney.ru/api/request-payment Authorization: Bearer YOUR_ACCESS_TOKEN Content-Type: application/x-www-form-urlencoded pattern_id=12345&sum=100.00&comment=Payment for order #123 ``` -------------------------------- ### Payments from YooMoney Wallet - Request Payment Source: https://yoomoney.ru/docs/wallet/wallet/process-payments/basics_lang=ru This section details the process of initiating a payment from a user's YooMoney wallet. It outlines the scenario where an application requests a payment, including the steps for sending payment parameters and receiving an identifier from the YooMoney server. ```APIDOC ## POST /request-payment ### Description Initiates a payment from a user's YooMoney wallet by sending payment parameters and receiving a payment identifier. ### Method POST ### Endpoint /request-payment ### Parameters #### Query Parameters - **amount** (number) - Required - The amount to be paid. - **currency** (string) - Required - The currency of the payment (e.g., "RUB"). - **pattern_id** (string) - Required - The identifier of the payment template. - **user_parameters** (object) - Optional - Custom parameters required by the store. ### Request Example ```json { "amount": 100.00, "currency": "RUB", "pattern_id": "your_pattern_id", "user_parameters": { "phone_number": "+79000000000", "contract_number": "12345" } } ``` ### Response #### Success Response (200) - **payment_id** (string) - A unique identifier for the payment request. - **status** (string) - The status of the payment request (e.g., "success", "awaiting_confirmation"). - **offers** (array) - Available payment offers or options. #### Response Example ```json { "payment_id": "pay_abc123xyz", "status": "awaiting_confirmation", "offers": [ { "payment_method": "bank_card", "details": "..." } ] } ``` ``` -------------------------------- ### Sending a Form or Step of a Form to the Server Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-details This example shows how to send form data or a specific step of a form to the server for processing. It requires an access token and the relevant form data. ```javascript async function sendFormStep(accessToken, formData) { const response = await fetch('https://yoomoney.ru/api/send-form-step', { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' }, body: JSON.stringify(formData) }); const data = await response.json(); return data; } ``` -------------------------------- ### Example HTTPS Incoming Transfer Notification Source: https://yoomoney.ru/docs/wallet/wallet/using-api/notification-p2p-incoming_lang=ru This example demonstrates the format of an incoming transfer notification received via HTTPS. It includes sender details and other transaction parameters. This format is used when requesting sender's personal information. ```text operation_id = 904035776918098009 notification_type = p2p-incoming datetime = 2014-04-28T16:31:28Z sha1_hash = 8693ddf402fe5dcc4c4744d466cabada2628148c sender = 41003188981230 codepro = false currency = 643 amount = 0.99 withdraw_amount = 1.00 label = YM.label.12345 lastname = Иванов firstname = Иван fathersname = Иванович zip = 125075 city = Москва street = Тверская building = 12 suite = 10 flat = 10 phone = +79253332211 email = address@example.ru ``` -------------------------------- ### YooMoney P2P Transfer Request Example Source: https://yoomoney.ru/docs/wallet/wallet/process-payments/request-payment_lang=ru This code snippet demonstrates how to make a P2P transfer request to another YooMoney user. It includes parameters such as pattern_id, to, amount, message, and comment. The `pattern_id` should be set to 'p2p' for P2P transfers. ```http POST /api/request-payment HTTP/1.1 Host: yoomoney.ru Authorization: Bearer 410012345678901.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123 Content-Type: application/x-www-form-urlencoded Content-Length: 234 pattern_id=p2p&to=41001101140&amount=1000.00&message=%D0%9D%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BF%D0%BB%D0%B0%D1%82%D0%B5%D0%B6%D0%B0&comment=%D0%A1%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B0%D1%82%D0%B5%D0%BB%D1%8E ``` -------------------------------- ### Requesting Payment Form Description (GET) Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description-request_lang=ru This snippet demonstrates how to make a GET request to the YooMoney API to retrieve a payment form description. It specifies the endpoint and common HTTP headers that can be used to control the response, such as language and caching. ```HTTP GET /api/showcase/ HTTP/1.1 Host: yoomoney.ru Accept-Language: Accept-Encoding: If-Modified-Since: ``` -------------------------------- ### Date and Time Value Definitions in JSON Source: https://yoomoney.ru/docs/wallet/wallet/showcase/form-description_lang=ru Illustrates how to define date and month input fields using JSON, supporting absolute values, current date ('now'), and calculated values based on ISO 8601 time intervals. These examples show setting minimum and maximum allowed dates or months. ```json { "type": "month", "name": "period", "label": "Период оплаты", "required": true, "readonly": false, "min": "P3Y/now" } ``` ```json { "type": "month", "name": "period", "label": "Период оплаты", "required": true, "readonly": false, "max": "now/P1M" } ``` ```json { "type": "date", "name": "document_date", "label": "Дата постановления", "required": true, "readonly": false, "min":"2005-01-01", "max": "2009-01-02/P3Y6M" } ``` -------------------------------- ### POST /api/operation-details Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-details_lang=ru Get detailed information about a specific operation from your transaction history. Requires 'operation-details' token scope. ```APIDOC ## POST /api/operation-details ### Description Retrieves detailed information about a specific operation from the transaction history. ### Method POST ### Endpoint /api/operation-details ### Parameters #### Query Parameters - **operation_id** (string) - Required - The unique identifier of the operation. This should be obtained from the `operation_id` of the `operation-history` method response or the `payment_id` from the `process-payment` method response if querying a payer's account history. ### Request Example ```json { "operation_id": "1234567" } ``` ### Response #### Success Response (200) - **operation_id** (string) - The identifier of the operation. - **status** (string) - The payment (or transfer) status. - **pattern_id** (string) - The identifier of the payment template used for the transaction. Present only for payments. - **direction** (string) - The direction of funds. Possible values: `in` (income), `out` (expense). - **amount** (amount) - The amount of the operation (debit amount from the account). - **amount_due** (amount) - The amount to be received. Present for outgoing transfers to other users. - **fee** (amount) - The commission amount. Present for outgoing transfers to other users. - **datetime** (datetime) - The date and time the operation was performed. - **title** (string) - A brief description of the operation (merchant name or top-up source). - **sender** (string) - The account number of the transfer sender. Present for incoming transfers from other users. - **recipient** (string) - The identifier of the transfer recipient. Present for outgoing transfers to other users. - **recipient_type** (string) - The type of the recipient identifier. Possible values: `account`, `phone`, `email`. Present for outgoing transfers to other users. - **message** (string) - The message to the transfer recipient. Present for transfers to other users. - **comment** (string) - A comment for the transfer or top-up. Present in the history of the transfer sender or top-up recipient. - **label** (string) - The payment label. Present for incoming and outgoing transfers to other YooMoney users if the `label` parameter was specified in the `request-payment` call. - **details** (string) - Detailed payment description. An arbitrary string that can contain any characters and line breaks. Optional. - **type** (string) - The type of operation. - **digital_goods** (object) - Data about a digital good. Present for successful payments to digital goods stores. #### Error Response (400) - **error** (string) - An error code if the request failed. Possible values: `illegal_param_operation_id` (Invalid `operation_id` parameter value), or any other value indicating a technical error. ### Response Example (Payment to a store) ```json { "operation_id": "1234567", "status": "success", "pattern_id": "2904", "amount": 500.00, "direction": "out", "datetime": "2011-07-11T20:43:00.000+04:00", "title": "Payment for ADSL access from My-Provider company", "details": "Prepayment for ADSL internet access from XXX LLC\nSubscriber account number: \n1234567/89\nCredited amount: 500.00\nTransaction number: 2000002967767", "type": "payment-shop" } ``` ### Response Example (Outgoing transfer to another user) ```json { "operation_id": "1234567", "status": "success", "pattern_id": "p2p", "direction": "out", "amount": 50.25, "datetime": "2011-07-11T20:43:00.000+04:00", "title": "Transfer to account 4100123456789", "recipient": "4100123456789", "recipient_type": "account", "message": "Buy some bagels", "comment": "Transfer from a YooMoney user", "codepro": false, "details": "Recipient account:\n4100123456789\nAmount to receive: 50.00 RUB.", "type": "payment-shop" } ``` ### Response Example (Non-existent operation) ```json { "error": "illegal_param_operation_id" } ``` ``` -------------------------------- ### YooMoney Process Payment Request (HTTP POST) Source: https://yoomoney.ru/docs/wallet/wallet/process-payments/process-payment_lang=ru This is an example HTTP POST request to the YooMoney API's process-payment endpoint. It's used for initiating a payment, particularly with a linked bank card ('money-source=card'), and includes parameters like request_id, csc, and redirection URIs for authentication. ```http POST /api/process-payment HTTP/1.1 Host: yoomoney.ru Authorization: Bearer 410012345678901.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123 Content-Type: application/x-www-form-urlencoded Content-Length: 164 request_id=1234567&money-source=card&csc=123&ext_auth_success_uri=http%3A%2F%2Fclient.example.com%2Fsuccess&ext_auth_fail_uri=http%3A%2F%2Fclient.example.com%2Ffail ``` -------------------------------- ### Get Transaction History Source: https://yoomoney.ru/docs/wallet/wallet/user-account/operation-history_lang=ru Retrieves a list of past transactions, with options to filter and paginate. The response can include detailed operation information if requested. ```APIDOC ## GET /api/account-info/operation-history ### Description Retrieves a list of past transactions associated with the user's account. This endpoint supports filtering by date range, pagination, and can optionally include detailed information for each operation. ### Method GET ### Endpoint /api/account-info/operation-history ### Parameters #### Query Parameters - **details** (boolean) - Optional - If set to `true`, the response will include detailed parameters for each operation. - **from** (string) - Optional - The start of the period for which the history is requested, in the format `YYYY-MM-DD`. - **till** (string) - Optional - The end of the period for which the history is requested, in the format `YYYY-MM-DD`. - **limit** (integer) - Optional - The maximum number of records to return. Default is 20. - **offset** (integer) - Optional - The number of records to skip. Used for pagination. ### Response #### Success Response (200) - **next_record** (string) - Identifier for the next record, used for pagination. - **operations** (array) - An array of operation objects. - **operation_id** (string) - Unique identifier for the operation. - **status** (string) - The status of the operation (e.g., `success`, `error`). - **pattern_id** (string) - Identifier for the template used for the payment (present for payments). - **direction** (string) - The direction of the funds flow (`in` for incoming, `out` for outgoing). - **amount** (number) - The amount of the transaction. - **datetime** (string) - The date and time of the operation in ISO 8601 format. - **title** (string) - A brief description of the operation (e.g., shop name, top-up source). - **label** (string) - Payment label (present for incoming and outgoing transfers to other YooMoney users). - **type** (string) - The type of operation (e.g., `payment-shop`, `outgoing-transfer`, `deposition`, `incoming-transfer`). - **recipient** (string) - The recipient's account number (for outgoing transfers). - **recipient_type** (string) - The type of recipient account (e.g., `account`). - **message** (string) - Message associated with the transfer. - **comment** (string) - Comment for the transfer. - **codepro** (boolean) - Indicates if the operation was a CodePro transaction. - **details** (string) - Detailed information about the operation (if `details` parameter was true). #### Response Example ```json { "next_record": "4", "operations": [ { "operation_id": "1234567", "status": "success", "pattern_id": "2904", "direction": "out", "amount": 500.00, "datetime": "2011-07-11T20:43:00.000+03:00", "title": "Оплата ADSL-доступа компании XXX", "type": "payment-shop" }, { "operation_id": "1234568", "status": "success", "pattern_id": "2901", "direction": "out", "amount": 300.00, "datetime": "2011-07-10T20:43:00.000+03:00", "title": "Прямое пополнение счета телефона YYY", "type": "payment-shop" }, { "operation_id": "1234569", "status": "success", "direction": "in", "amount": 1000.00, "datetime": "2011-07-10T20:40:00.000+03:00", "title": "Банк ZZZ, пополнение", "type": "deposit" } ] } ``` #### Error Response (400) - **error** (string) - Error code (e.g., `illegal_param_type`, `illegal_param_start_record`). #### Error Response Example ```json { "error": "illegal_param_type" } ``` ```