Operation import_batch_advanced

The operation of uploading a batch payment into the system.

Query parameters

Parameter Value
operation import_batch_advanced
login <User name>
token <TOKEN>. Obtained after invoking get_token.
encrypted_password Encrypted password. It is obtained after user password RSA encryption with the use of a public exponent and the modulus obtained in invoking the get_token operation.
account_RUR The account used for writing off in the corresponding currency in a batch payment. You can not pass the account. It will be selected automatically.
account_USD The account used for writing off in the corresponding currency in a batch payment. You can not pass the account. It will be selected automatically.
account_EUR The account used for writing off in the corresponding currency in a batch payment. You can not pass the account. It will be selected automatically.
account_<crypto accounts> You do not need to pass the crypto accounts. It will be selected automatically.
batch Batch data. Detailed description of the format can be found in the page with batch payments or in the corresponding page in the documentation.
verification_type

Confirmation method. May take values:

  • SIGNATURE — if the signature uses a private key (Certificate in the security settings should be activated)
  • MOBILE — in case of signature via SMS (SMS confirmation in security settings should be activated).
    In this case, a code will be sent to the phone number provided in activating the "SMS confirmation" (see process_batch).
verification_data

Confirmation data. Depends on the method of confirmation

  • If the confirmation method = SIGNATURE, the base64 encoded Signature should sent.
    The batch data is signed by an RSA algorithm (PKCS1) using the private key obtained in "Certificate activation".
  • If the confirmation method = MOBILE, nothing is transmitted (see process_batch).

See also

Response in the CSV format

Format

Line No. Data format
10;<payment ID>;<sum_RUR>;<sum_USD>;<sum_EUR>;<sum_BTC>
2errors;<payment ID>;<errors count>
3, ..., nerrorAtLine;<error line number>;<error comment>

Values

Value Description
<payment ID>Mass payment identifier
<sum_RUR>The amount of the documents accepted for processing from an account in Rubles
<sum_USD>The amount of the documents accepted for processing from an account in US Dollars
<sum_EUR>The amount of the documents accepted for processing from an account in Euros
<sum_BTC>The amount of the documents accepted for processing from an account in Bitcoins
<error line number>Mass payment's error line number. First line associated with number 1
<error comment>Error details
<errors count>Errors count

Response examples

JSON (without mass payment errors)

{
    "code": 0,
    "message": "",
    "data": {
        "id": "3e6131a6-f55e-4a54-92a8-198e114dc92a",
        "summary": {
            "RUR": "0.00",
            "USD": "0.00",
            "EUR": "7.29",
            "BTC": "0.00"
        },
        "fee": {
            "RUR": "0.00",
            "USD": "0.00",
            "EUR": "0.15",
            "BTC": "0.00"
        },
        "nettoSummary": {
            "RUR": "0.00",
            "USD": "0.00",
            "EUR": "7.14",
            "BTC": "0.00"
        },
        "errors": []
    }
}

JSON (with payment errors)

{
    "code": 185,
    "message": "Ошибка импорта массового платежа. Сумма платежа равна нулю. Подробности в деталях платежа (см. также get_batch_info).",
    "data": {
        "id": "1318ee26-cc74-4dd5-a875-6c69957261e0",
        "errors": [
            {
                "line": 1,
                "comment": "Неверно задано значение поля Card number"
            }
        ]
    }
}

CSV (without mass payment errors)

0;938059f7-3680-4836-8c5c-53d5912556b9;1.20;0.00;0.00;0.00
errors;938059f7-3680-4836-8c5c-53d5912556b9;0
Обратите внимание, что возможен случай частично успешного импорта. Тогда код ошибки будет равен 0, но при этом количество ошибочных записей не равно 0.
Если были отклонены все записи, то код ошибки будет 185.
Если была только одна запись и в результате получена одна ошибка, то код ошибки будет 188, а текст ошибки будет содержать причину отклонения записи.

CSV (with payment errors)

185;"Ошибка импорта массового платежа. Сумма платежа равна нулю. Подробности в деталях платежа (см. также get_batch_info)."
errors;0839e09e-4651-4ccd-a222-e1975a93a33c;1
errorAtLine;1;"Неверно задано значение поля Card number"
API Capitalist