Operation-history method
This method allows viewing the full or partial history of operations in page mode. History records are displayed in reverse chronological order (from most recent to oldest).
Required permissions: operation-history.
Request
ParameterTypeDescription
type
string
List of operation types to display (see the table). Possible values:
  • deposition — deposits (income);
  • payment — payments (expenditure).
Types in the list are separated by a space. If omitted, all operations are displayed.
labelstringFiltering payments by the label value. Payments are selected that have the specified value for the label parameter in the request-payment call.
fromdatetimeOutput operations from a timestamp (operations that were equal to the from value or later than it). If omitted, all operations are displayed.
tilldatetimeOutput operations to a timestamp (operations that were earlier than the till value). If omitted, all operations are displayed.
start_recordstringIf this parameter is present, displays all operations starting from the number start_record. Operations are numbered starting from 0. Learn more about list pagination
recordsintPage size, number of history records in response. Accepted values: from 1 to 100; by default 30.
detailsbooleanShow operation details. By default, false. To display operation details, the operation-details permission is required.
Example of requesting the complete history
POST /api/operation-history HTTP/1.1
Host: yoomoney.ru
Authorization: Bearer 410012345678901.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123
Content-Type: application/x-www-form-urlencoded
Content-Length: 9

records=3
The logic used for filtering history records
History records are filtered by the conditions:
  • type of operation;
  • payment label;
  • time period.
All the conditions are additive, meaning each condition adds further restriction.
Rules for selecting data by time period:
  1. If both the from and till conditions are set, records are selected for the time period equal to from (or greater) and less than till.
  2. If only the from condition is set, records are selected that have a time later than or equal to from.
  3. If only the till condition is set, records are selected with a time less than till.
  4. If both the from and till conditions are omitted, records are selected without time restrictions.
If the operation history contains a large number of records, the list of operations is displayed in page mode. The first page of the history is displayed by default. If there are additional pages, the next_record parameter appears in the response (this parameter is omitted if there is only a single page). To display the next page of the history, repeat the request with the same parameters and add the start_record parameter, specifying the value from the next_record parameter of the previous response.
Example request for the next pages of the payment history
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
To get a larger selection of records in the time period, form a request with the from and till conditions, get the first page of the history, then form requests for the subsequent pages of the history with the same values for the from and till parameters, as well as the start_record parameter with the value that was obtained from the next_record parameter in the response for the previous page of the history.
Response
The method returns the following parameters:
ParameterTypeDescription
errorstringError code. Present if an error occurred when executing the request.
next_recordstringThe number of the first history record on the next page. Present if there is another page in the history operations. Learn more about list pagination
operations
array
List of operations.
Operation parameters
ParameterTypeDescription
operation_idstringOperation ID.
status
string
Status of the payment (transfer). Possible values:
  • success — payment completed successfully;
  • refused — payment was declined by the recipient or canceled by the sender;
  • in_progress — payment is not yet complete or the transfer has not been accepted by the recipient.
datetimedatetimeOperation timestamp (date and time).
titlestringBrief description of the operation (usually contains the merchant name or source of deposit).
pattern_idstringThe ID of the pattern used for making the payment. Present only for payments.
direction
string
Direction of financial transaction. Can take the values:
  • in (income);
  • out (expenditure).
amountamountOperation amount.
labelstringThe payment label. Exists for incoming and outgoing transfers made by other YooMoney users that had the label parameter set for the request-payment call.
type
string
The type of operation. Possible values:
  • payment-shop — outgoing payment to a merchant;
  • outgoing-transfer — any type of outgoing P2P transfer;
  • deposition — settlement;
  • incoming-transfer — incoming transfer.

If the value of the details input parameter is set to true, the response will also contain operation-details output parameters for operations.

Example response for the complete history
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": "Payment for ADSL access to company 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": "Deposit to mobile phone account YYY",
      "type": "payment-shop"
    },
    {
      "operation_id": "1234569",
      "status": "success",
      "direction": "in",
      "amount": 1000.00,
      "datetime": "2011-07-10T20:40:00.000+03:00",
      "title": "Bank ZZZ, deposit",
      "type": "deposit"
    }
  ]
}
Example response with details on operations when paying a merchant
JSON
{
  "next_record": "2",
  "operations": [
    {
      "operation_id": "1234567",
      "status": "success",
      "pattern_id": "2904",
      "direction": "out",
      "amount": 500.00,
      "datetime": "2011-07-11T20:43:00.000+04:00",
      "title": "Payment for ADSL access to company XXX",
      "details": "Prepayment for ADSL internet access to company XXX\nSubscriber account number: \n1234567/89\nCredited amount: 500.00\nTransaction number: 2000002967767",
      "type": "payment-shop"
    }
  ]
}
Example response with details of the operation for an outgoing transfer to another user
JSON
{
  "next_record": "2",
  "operations": [
    {
      "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 bagels",
      "comment": "Transfer to YooMoney user",
      "codepro": false,
      "details": "Recipient account:\n4100123456789\nAmount: 50.00 RUB",
      "type": "outgoing-transfer"
    }
  ]
}
Error codes
If an error occurs, its code is returned:
CodeDescription
illegal_param_typeInvalid value for the type parameter.
illegal_param_start_recordInvalid value for the start_record parameter.
illegal_param_recordsInvalid value for the records parameter.
illegal_param_labelInvalid value for the label parameter.
illegal_param_fromInvalid value for the from parameter.
illegal_param_tillInvalid value for the till parameter.
All other valuesTechnical error; repeat the operation again later.
Example response for invalid parameter
JSON
{
   "error": "illegal_param_type"
}