NAV
  • General
  • Methods of checking payment status
  • Refunds
  • DMS payments (Dual Message System)
  • Directory
  • General

    Requests authentication

    Endpoint base address https://paymaster.ru

    All requests should be performed by the users with the login method "Automatic access". Users should have a role of Operationist (receiving payment status and payments list) or Financial staff (Operationist + refund + refunds list). Each request must contain the following fields: login, nonce и hash. These fields are used for authentication in the following way:

    In case the hash is generated incorrectly you receive the error code -7 (see. Error codes).

    Please note that in case of GET requests each parameter must be url-escaped! (especiaaly hash)

    Response format

    Responce:

    {
      "ErrorCode": 0,
      "Payment": {
        "PaymentID": 1,
        "SiteInvoiceID": "12345",
        "SiteID": 1,
        "CurrencyCode": "RUB",
        "Amount": 100,
        "PaymentCurrencyCode": "RUB",
        "PaymentAmount": 100,
        "State": "COMPLETE",
        "IsTestPayment": false,
        "LastUpdateTime": "2019-05-12T18:08:52"
      }
    }
    

    Processing interfaces always respond with HTTP status 200. If another HTTP status occurs then there was an error parsing the request. Processing interfaces send response in JSON format.

    Each response contains the numeric field ErrorCode (see. Error codes). If there was no error (ErrorCode=0), then the next field is the response body.

    Response parameters lists can be extended (but not removed) following the changes to this document. The response handling should be implemented considering the possibility of introducing the new fields.

    Methods of checking payment status

    Checking payment status by Payment ID

    Request:

    GET /api/v1/getpayment?login=TestLogin&nonce=74DF1SM&hash=***&paymentid=1 HTTP/1.1
    Host: paymaster.ru
    

    Response:

    {
      "ErrorCode": 0,
      "Payment": {
        "PaymentID": 1,
        "SiteInvoiceID": "12345",
        "SiteID": 1,
        "CurrencyCode": "RUB",
        "Amount": 100,
        "PaymentMethod": "BankCard",
        "PaymentCurrencyCode": "RUB",
        "PaymentAmount": 100,
        "State": "COMPLETE",
        "Purpose": "Payment for order №12345",
        "IsTestPayment": false,
        "LastUpdateTime": "2018-012-22T18:08:52",
        "ErrorCode": 0
      }
    }
    

    GET /api/v1/getPayment

    The following REST interface used for checking payment status by Payment ID.

    Request parameters

    Parameter Description
    paymentID Processing payment ID (LMI_SYS_PAYMENT_ID)

    Parameters used for hashing: login;password;nonce;paymentID

    Response parameters

    Parameter Description
    State Payment state see. Payment state values
    ErrorCode Error code. Error codes
    Amount Payment amount
    CurrencyCode 3-letter ISO currency code
    IsTestPayment A sign of test payment (payment is made in test or production mode).
    LastUpdate (LastUpdateTime для JSON) The last status update time. For completed payments - the completion time
    PaymentAmount Paid amount
    PaymentCurrencyCode Payment currency code
    PaymentID Processing payment ID
    PaymentMethod Payment method
    Purpose Payment description
    SiteID Merchant site ID
    SiteInvoiceID Invoice ID (LMI_PAYMENT_NO)
    UserIdentifier User ID in payment system
    UserPhoneNumber Payer phone number

    Checking payment status by invoice ID

    Request:

    GET /api/v1/getpaymentbyinvoiceid?login=TestLogin&nonce=74DF1SM&hash=***&invoiceid=1&siteAlias=yyy HTTP/1.1
    Host: paymaster.ru
    

    Response:

    {
      "ErrorCode": 0,
      "Payment": {
        "PaymentID": 1,
        "SiteInvoiceID": "12345",
        "SiteID": 1,
        "CurrencyCode": "RUB",
        "Amount": 100,
        "PaymentMethod": "BankCard",
        "PaymentCurrencyCode": "RUB",
        "PaymentAmount": 100,
        "State": "COMPLETE",
        "Purpose": "Payment for order №12345",
        "IsTestPayment": false,
        "LastUpdateTime": "2019-04-22T08:09:52"
      }
    }
    

    GET /api/v1/getPaymentByInvoiceID

    This REST interface used for checking payment status by Company internal invoice ID.

    Request parameters

    Parameter Description
    invoiceID invoice number (LMI_PAYMENT_NO)
    siteAlias Merchant ID (LMI_MERCHANT_ID)

    Parameters used for hashing: login;password;nonce;invoiceID;siteAlias

    Responce parameters

    See Payment details

    Receiving payments list (transaction file)

    Request:

    GET /api/v1/listpaymentsfilter?login=TestLogin&nonce=74DF1SM&hash=***&periodFrom=2018-12-01 HTTP/1.1
    Host: paymaster.ru
    

    Response:

    {
      "ErrorCode": 0,
      "Response": {
        "Overflow": false,
        "Payments": [{
            "PaymentID": 1,
            "SiteInvoiceID": "12345",
            "SiteID": 1,
            "CurrencyCode": "RUB",
            "Amount": 100,
            "PaymentMethod": "BankCard",
            "PaymentCurrencyCode": "RUB",
            "PaymentAmount": 100,
            "State": "COMPLETE",
            "Purpose": "Payment for order №12345",
            "IsTestPayment": false,
            "LastUpdateTime": "2019-05-03T18:44:52"
          }, {
            "PaymentID": 2,
            "SiteInvoiceID": "12346",
            "SiteID": 1,
            "CurrencyCode": "RUB",
            "Amount": 100,
            "PaymentMethod": "BankCard",
            "PaymentCurrencyCode": "RUB",
            "PaymentAmount": 100,
            "State": "COMPLETE",
            "Purpose": "Payment for order №12346",
            "IsTestPayment": false,
            "LastUpdateTime": "2019-07-22T11:28:32"
          }
        ]
      }
    }
    

    GET /api/v1/listPaymentsFilter

    Returns payments list that match criteria specified in the request .

    Request parameters

    Parameter Description
    accountID ID of the Company account. It can be found in URL of the page "Account" in Control Panel. Parameter accountID may not be specified, if there is only one account
    siteAlias Site alias (LMI_MERCHANT_ID). If provided only this site’s payments will be listed
    periodFrom beginning of period (yyyy-MM-dd), UTC time. If indicated, only payments from this date will be included
    periodTo end of period (yyyy-MM-dd), UTC time. If indicated, only payments until this date will be included
    invoiceID invoice number. If indicated, only payments with this number will be included
    state payment state. If indicated, only payments in this state will be included.

    Parameters used for hashing: login;password;nonce;accountID;siteAlias;periodFrom;periodTo;invoiceID;state. If a parameter is missing, an empty line is written instead (in other words, there will be two consecutive semi-colons).

    Response parameters

    Parameter Description
    Overflow "true", if it is impossible to return all payment data requested. Narrow the search area in that case.
    Payments Array of objects, each of it is similar to object described in getPayment interface.

    Refunds

    Payment refund

    Request:

    POST /api/v1/refundPayment HTTP/1.1
    Host: paymaster.ru
    Content-Type: application/x-www-form-urlencoded
    
    login=TestLogin&nonce=74DF1SM&hash=***&paymentID=131212&amount=23.10
    

    Response:

    {
      "ErrorCode": 0,
      "Refund": {
        "RefundID": 1073969831,
        "ExternalID": null,
        "PaymentID": 131212,
        "Amount": 23.10,
        "ErrorCode": null,
        "ErrorDesc": null,
        "State": "EXECUTING"
      }
    }
    

    POST /api/v1/refundPayment

    This request performs payment refund.

    Request parameters

    Parameter Description
    paymentID Processing payment ID
    amount Refund amount, in the currency of payment
    externalID Optional parameter for external refund ID

    Parameters used for hashing: login;password;nonce;paymentID;amount;externalID

    Pesponse parameters

    Parameter Description
    ExternalID External ID of refund
    PaymentID Processing payment ID
    Status Refund status, see. Refund status list
    Amount Amount refunded
    ErrorCode request error code (see Error codes). May not be presented
    ErrorDesc textual description of the error, if the error code is missing. The description also can not be present if the denial reason is unknown.

    Receiving refunds list

    Request:

    GET /api/v1/listRefunds?login=TestLogin&nonce=74DF1SM&hash=***&paymentID=131212&periodFrom=2019-01-01&periodTo=2019-06-01 HTTP/1.1
    Host: paymaster.ru
    

    Response:

    {
      "ErrorCode": 0,
      "Response": {
        "Overflow": false,
        "Refunds": [{
            "RefundID": 1234,
            "ExternalID": null,
            "PaymentID": 12345,
            "Amount": 10.2,
            "ErrorCode": null,
            "ErrorDesc": null,
            "LastUpdate": "2019-04-17T23:12:02",
            "State": "SUCCESS"
          }, {
            "RefundID": 1236,
            "ExternalID": null,
            "PaymentID": 12346,
            "Amount": 120,
            "ErrorCode": -15,
            "ErrorDesc": "we’ve been waiting for too long time",
            "LastUpdate": "2019-04-17T12:15:02",
            "State": "FAILURE"
          }
        ]
      }
    }
    

    GET /api/v1/listRefunds

    This REST interface returns the list of refunds, by payment or by period.

    Request parameters

    Parameter Description
    accountID ID of the Company account.
    paymentID Payment ID number. If present, only refunds for this payment are displayed
    periodFrom Beginning of period (yyyy-mm-dd). There is no lower limit if parameter does not present
    periodTo End of period, inclusive (yyyy-mm-dd). There is no upper limit if parameter does not present
    externalID Optional parameter for external refund ID

    Parameters used for hashing: login;password;nonce;accountID;paymentID;periodFrom;periodTo;externalID If a parameter is missing, an empty line is written instead (in other words, there will be two consecutive semi-colons).

    Response parameters

    Parameter Description
    ErrorCode Request error code (см. Error codes)
    Overflow True if the list of refunds is cut off. In this case, specify a narrower range for search
    Refunds Refund list. Every object the same as the first Response request object

    DMS payments (Dual Message System)

    Payment confirmation

    Request:

    POST /api/v1/ConfirmPayment HTTP/1.1
    Host: paymaster.ru
    Content-Type: application/x-www-form-urlencoded
    
    login=TestLogin&nonce=74DF1SM&hash=***&paymentID=1232&amount=11
    

    Response:

    {
      "ErrorCode": 0,
      "Payment": {
        "PaymentID": 1,
        "SiteInvoiceID": "12345",
        "SiteID": 1,
        "CurrencyCode": "RUB",
        "Amount": 100,
        "PaymentMethod": "BankCard",
        "PaymentCurrencyCode": "RUB",
        "PaymentAmount": 100,
        "State": "COMPLETE",
        "Purpose": "Payment for order №12345",
        "IsTestPayment": false,
        "LastUpdateTime": "2017-05-22T18:08:52"
      }
    }
    

    POST /api/v1/confirmPayment

    This method complete the payment with held funds. In some cases it is possible to specify amount lower then it was held.

    Request parameters

    Parameter Description
    paymentID Paymaster payment ID. (LMI_SYS_PAYMENT_ID)
    amount Actual payment amount

    Parameters used for hashing: login;password;nonce;paymentID;amount

    Cancelling payment

    Request:

    POST /api/v1/CancelPayment HTTP/1.1
    Host: paymaster.ru
    Content-Type: application/x-www-form-urlencoded
    
    login=TestLogin&nonce=74DF1SM&hash=***&paymentID=1232&error=-8
    

    Responce:

    {
      "ErrorCode": 0,
      "Payment": {
        "PaymentID": 1,
        "SiteInvoiceID": "12345",
        "SiteID": 1,
        "CurrencyCode": "RUB",
        "Amount": 100,
        "PaymentMethod": "BankCard",
        "PaymentCurrencyCode": "RUB",
        "PaymentAmount": 100,
        "State": "COMPLETE",
        "Purpose": "Payment for order №12345",
        "IsTestPayment": false,
        "LastUpdateTime": "2017-05-22T18:08:52"
      }
    }
    

    POST /api/v1/cancelPayment

    This request unhold payer funds.

    Request parameters

    Parameter Description
    paymentID Paymaster payment ID. (LMI_SYS_PAYMENT_ID)
    error Optional. Error code from the list (see Error codes)

    Parameters used for hashing: login;password;nonce;paymentID;error

    Receiving documents list

    Request:

    GET /api/v1/listDocuments?login=TestLogin&nonce=74DF1SM&hash=***&accountID=123&periodFrom=2005-02-17&periodTo=2013-06-17&xml=1 HTTP/1.1
    Host: paymaster.ru
    

    Response:

    <RestController.RestResponse xmlns="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Controllers"xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <ErrorCode>
            0
        </ErrorCode>
        <Response xmlns:a="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Models.REST"i:type="a:RestDocumentList">
            <a:Documents>
                <a:RestDocumentInfo>
                    <a:Created>
                        2013-06-17T12:57:03.6470638Z
                    </a:Created>
                    <a:Description>
                        Акт выполненных работ за Март 2012 г !!!!!!!!!!!!!!!!!
                    </a:Description>
                    <a:DocumentID>
                        123456
                    </a:DocumentID>
                    <a:FileName>
                        act_052012.xls
                    </a:FileName>
                </a:RestDocumentInfo>
                <a:RestDocumentInfo>
                    <a:Created>
                        2013-06-17T12:57:03.6470638Z
                    </a:Created>
                    <a:Description>
                        Invoice #1123 for 05/2012
                    </a:Description>
                    <a:DocumentID>
                        123456
                    </a:DocumentID>
                    <a:FileName>
                        doc_052012.xls
                    </a:FileName>
                </a:RestDocumentInfo>
            </a:Documents>
        </Response>
    </RestController.RestResponse>
    

    GET /api/v1/listDocuments

    The following REST interface returns the list of documents by period.

    Request parameters

    Parameter Description
    accountID ID of the Company account. It can be found in URL of the page "Account" in Control Panel
    periodFrom Beginning of period (yyyy-MM-dd), UTC time. If specified, only documents from this date will be included
    periodTo End of period (yyyy-MM-dd), UTC time. If specified, only documents until this date will be included

    Parameters used for hashing: login;password;nonce;accountID;periodFrom;periodTo

    Responce parameters

    Parameter Description
    Created Document creation date
    Description Document description
    DocumentID Document ID to download content
    FileName Document file name

    Downloading document

    Request:

    GET /api/v1/getDocumentContent?login=TestLogin&nonce=74DF1SM&hash=***&documentID=123456 HTTP/1.1
    Host: paymaster.ru
    

    GET /api/v1/getDocumentContent

    The following REST interface used for downloading document by Document ID. Document content as a response.

    Request parameters

    Parameter Description
    documentID Document ID

    Parameters used for hashing: login;password;nonce;documentID

    Receiving list of payouts

    Request:

    GET /api/v1/listTransfers?login=TestLogin&nonce=74DF1SM&hash=***&accountID=123&periodFrom=2005-02-17&periodTo=2013-06-17&xml=1 HTTP/1.1
    Host: paymaster.ru
    

    Responce:

    <RestController.RestResponse xmlns="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Controllers" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <ErrorCode>
            0
        </ErrorCode>
        <Response xmlns:a="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Models.REST" i:type="a:RestTransferList">
            <a:Transfers>
                <a:RestTransferInfo>
                    <a:Created>
                        2017-09-04T09:36:29.186576Z
                    </a:Created>
                    <a:CurrencyCode>
                        RUB
                    </a:CurrencyCode>
                    <a:PaymentOrderID>
                        11223/4
                    </a:PaymentOrderID>
                    <a:RegisterID>
                        54
                    </a:RegisterID>
                    <a:TransferAmount>
                        101150.00
                    </a:TransferAmount>
                </a:RestTransferInfo>
                <a:RestTransferInfo>
                    <a:Created>
                        2017-09-04T09:36:29.186576Z
                    </a:Created>
                    <a:CurrencyCode>
                        RUB
                    </a:CurrencyCode>
                    <a:PaymentOrderID>
                        11223/5
                    </a:PaymentOrderID>
                    <a:RegisterID>
                        55
                    </a:RegisterID>
                    <a:TransferAmount>
                        20000.00
                    </a:TransferAmount>
                </a:RestTransferInfo>
            </a:Transfers>
        </Response>
    </RestController.RestResponse>
    

    GET /api/v1/listTransfers

    Following method returns payouts list for specified period.

    Request parameters

    Parameter Description
    accountID ID of the Company account. It can be found in URL of the page "Account" in Control Panel
    periodFrom Beginning of period (yyyy-MM-dd), UTC time
    periodTo End of period (yyyy-MM-dd), UTC time

    Parameters used for hashing: login;password;nonce;accountID;periodFrom;periodTo

    Responce parameters

    Parameter Description
    Created Date of payout
    CurrencyCode Payout currency code
    TransferAmount Amount of transfer
    PaymentOrderID Payment order ID
    RegisterID Registry ID

    Downloading registry of a payout

    Request:

    GET /api/v1/getTransferRegister?login=TestLogin&nonce=74DF1SM&hash=***&registerID=123&xml=1 HTTP/1.1
    Host: paymaster.ru
    

    Responce:

    <RestController.RestResponse xmlns="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Controllers" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <ErrorCode>
            0
        </ErrorCode>
        <Response xmlns:a="http://schemas.datacontract.org/2004/07/PaymasterBackoffice.Models.REST" i:type="a:RestRegisterInfo">
            <a:Operations>
                <a:RestRegisterOperationInfo>
                    <a:CurrencyCode>
                        RUB
                    </a:CurrencyCode>
                    <a:InvoiceID>
                        SO223
                    </a:InvoiceID>
                    <a:OperationAmount>
                        1000.00
                    </a:OperationAmount>
                    <a:OperationID>
                        11022
                    </a:OperationID>
                    <a:Stamp>
                        2017-09-04T00:00:00Z
                    </a:Stamp>
                    <a:TransferAmount>
                        998.00
                    </a:TransferAmount>
                </a:RestRegisterOperationInfo>
                <a:RestRegisterOperationInfo>
                    <a:CurrencyCode>
                        RUB
                    </a:CurrencyCode>
                    <a:InvoiceID>
                        SO224
                    </a:InvoiceID>
                    <a:OperationAmount>
                        1500.00
                    </a:OperationAmount>
                    <a:OperationID>
                        11027
                    </a:OperationID>
                    <a:Stamp>
                        2017-09-04T00:00:00Z
                    </a:Stamp>
                    <a:TransferAmount>
                        1497.00
                    </a:TransferAmount>
                </a:RestRegisterOperationInfo>
            </a:Operations>
            <a:PeriodFrom>
                2017-09-03T00:00:00Z
            </a:PeriodFrom>
            <a:PeriodTo>
                2017-09-04T00:00:00Z
            </a:PeriodTo>
            <a:RegisterID>
                54
            </a:RegisterID>
            <a:RegisterNumber>
                540/44
            </a:RegisterNumber>
        </Response>
    </RestController.RestResponse>
    

    GET /api/v1/getTransferRegister

    Thes method returns registry of payout.

    Request parameters

    Parameter Description
    registerID Registry ID

    Parameters used for hashing: login;password;nonce;registerID

    Responce parameters

    Parameter Description
    PeriodFrom Beginnig of period
    PeriodTo End of period
    RegisterNumber Registry ID
    Operations List of payments and refunds by the registry
    OperationID Идентификатор операции
    InvoiceID Номер счета мерчанта
    Stamp Date of operation
    CurrencyCode Operation currency code
    OperationAmount Operation amount
    TransferAmount Transfer amount

    Directory

    Error codes

    Code Description
    -1 Unknown error
    -2 Unknown network error
    -5 Network error of chosen payment system
    -6 Acess prohibited. Wrong login or not enough permissions for requested information
    -7 Incorrect signature of request
    -8 Invoice rejected by merchant
    -9 Invoice expired
    -10 Payment system refusal
    -11 Refund is not possible
    -12 Refund amount exceeded
    -13 Identifier not found
    -14 New request with the same nonce
    -15 Payment expired
    -16 Error simulated via merchant’s request
    -17 Refused by payer
    -18 Incorrect payment amount
    -19 Insufficient funds.
    -20 Internal error. Refresh the page
    -22 Payment system authorization failed
    -25 3D Secure authorization failed
    -26 Invalid card number
    -27 Card expired
    -28 Card blocked
    -29 Amount limit exceeded
    -30 Quantity limit exceeded
    -31 Invalid operation

    Payment status

    Status Description
    INITIATED Payment started
    PROCESSING Payment in progress
    COMPLETE Payment finished successfully
    CANCELLED Payment failed
    HOLD Amount held

    Refund status

    Status Description
    PENDING Placed in line to perform the refund
    EXECUTING Refund in progress
    SUCCESS Refund finished successfully
    FAILURE Refund failed