NAV
cURL PHP Java Perl C#

Change History

Document version Description of changes Change date
1.2 Description of Details70 field for “Send a Document” function is corrected 2021-04-12
1.1 Description of uniqueID and trnID XML fields for “List of Transactions” function is corrected 2020-07-17
1.0 Initial publication of documentation 2017-01-13

Login Instructions

General Information

Enterprise Link PRO (E-Link PRO) allows having access to information of transactions, as well as submitting signed orders to the Bank for their subsequent fulfilment.

Service Activation

To activate the E-Link PRO, select the account in the iRietumu settings and click “Activate”.

Choose the service “Browsing and forwarding of payment orders (PRO)”. Enter the one-time password from the Digipass and click “Confirm”.

Copy the access identifier to use it in your application as an electronic pass further on (the “ticket” parameter).

Logic of Order Creation

A full cycle of an order creation consists of three steps. At the first step, the “Send a Document” function is used. This function registers the order and provides the reference number and results of checking the incoming document. If required, for example after the correction of errors, the document can be sent again.

At the second step, the document registered in the bank under its reference number must be requested by using the function “Receive a Document for Signature”. The XML document of the order will appear in one of the fields.

At the third step, the received XML document must be signed by the XML e-signature based on the certificate according XMLDSig standard and the signed document must be sent to the bank by using the function “Send the Signed Document”.

Service Invocation

Enquiry Format

Sample code:

curl -d "function=<Function name>&ticket=<Ticket>&refno=<Reference number>&language=<Language code>" -E ./<Filename>.pem:<Password>  https://<domain>/elinkpro/Process
<?php
/**
 * Process Enterprise Link Pro request
 * 
 * make sure that curl.cainfo in php.ini is targeted to last CA certificates
 * last extracted CA can be downloaded here: http://curl.haxx.se/ca/cacert.pem
 * 
 * @param   {Array}     $arguments      ASSOC array with arguments for request
 * @param   {String}    $cert_path      path to certificate file
 * @param   {String}    $cert_passwd    certificate password
 * @return  {String}                    response content
 */
function process_enterprise_link_pro( $arguments, $cert_path, $cert_passwd ) {
    $ch = curl_init();
    curl_setopt_array( $ch, array(
        CURLOPT_POST => 1,
        CURLOPT_HEADER => 0,
        CURLOPT_FRESH_CONNECT => 1,
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_FORBID_REUSE => 1,
        CURLOPT_TIMEOUT => 120,
        CURLOPT_URL => "https://<domain>/elinkpro/Process",
        CURLOPT_POSTFIELDS => http_build_query($arguments),
        CURLOPT_SSLCERT => $cert_path,
        CURLOPT_SSLCERTPASSWD => $cert_passwd
    ) );
    $result = curl_exec( $ch ); 
    curl_close( $ch ); 
    return $result; 
}
?>
/**
 * Enterprise Link Pro class for Java 7
 * 
 * MAVEN dependencies:
 * org.apache.httpcomponents : httpclient : 4.4
 */
public class EnterpriseLinkPro {

    private static final String ELINK_PRO_HOST = "https://<domain>";
    private static final String PROCESS_PATH = "/elinkpro/Process";
    private static final String KEYSTORE_TYPE = "PKCS12";

    private HttpHost host;
    private HttpClient httpClient;
    private String filePath;
    private String password;

    public EnterpriseLinkPro(String filePath, String password) throws GeneralSecurityException, IOException {
        this.filePath = filePath;
        this.password = password;
        this.host = HttpHost.create(ELINK_PRO_HOST);
        this.httpClient = HttpClientBuilder.create()
                .setSSLSocketFactory(createSSLConnectionSocketFactory())
                .build();
    }

    private SSLConnectionSocketFactory createSSLConnectionSocketFactory() throws GeneralSecurityException, IOException {
        KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE);
        keyStore.load(new FileInputStream(this.filePath), this.password.toCharArray());

        SSLContext sslContext = SSLContextBuilder.create()
                .loadKeyMaterial(keyStore, this.password.toCharArray())
                .build();

        return new SSLConnectionSocketFactory(sslContext);
    }

    public String process(List<NameValuePair> params) throws ParseException, IOException {
        HttpPost httpPost = new HttpPost(PROCESS_PATH);
        httpPost.setEntity(new UrlEncodedFormEntity(params));

        HttpResponse response = httpClient.execute(host, httpPost);

        return EntityUtils.toString(response.getEntity(), Consts.UTF_8);
    }

}
#!/usr/bin/perl

use LWP::UserAgent;
use HTTP::Request::Common;

# Process Enterprise Link Pro request
#
# @param   {Array}     $arguments       array with arguments for request
# @param   {String}    $cert_path       path to certificate file
# @param   {String}    $cert_passwd     certificate password
# @return  {String}                     response content
sub process_enterprise_link_pro {
    my ( $arguments, $cert_path, $cert_passwd ) = @_;
    my $ua = LWP::UserAgent->new( ssl_opts => {
        SSL_use_cert => 1,
        SSL_cert_file => $cert_path,
        SSL_passwd_cb => sub { $cert_passwd }
    } );
    my $req = POST 'https://<domain>/elinkpro/Process', $arguments;
    my $response = $ua->request( $req );
    return $response->content();
}
/**
 * Enterprise Link Pro class for .NET 4.5
 *
 * Required references:
 * System.Net.Http
 * System.Net.Http.WebRequest
 */
public class EnterpriseLinkPro
{
    private static readonly String ELINK_PRO_URL = "https://<domain>/elinkpro/Process";
    private HttpClient client;

    public EnterpriseLinkPro(String certPath, String password)
    {
        var certHandler = new WebRequestHandler();
        certHandler.ClientCertificateOptions = ClientCertificateOption.Manual;
        certHandler.UseDefaultCredentials = false;
        certHandler.ClientCertificates.Add(new X509Certificate2(certPath, password));

        this.client = new HttpClient(certHandler);
    }

    public async Task<String> Process(Dictionary<string, string> values)
    {
        var response = await client.PostAsync(ELINK_PRO_URL, new FormUrlEncodedContent(values));
        var responseString = await response.Content.ReadAsStringAsync();
        return responseString;
    }
}

Address: https://<domain>/elinkpro/Process

Method: Post

Authorisation: Rietumu ID certificate for the configured activation is used.

Query parameters: The parameters differ depending on the function used. The functions are comprehensively described below.

Response Format for the Information Inquiry

Response structure:

<response>
    <code>code of answer*</code>
    <error/>
    <!-- a set of tags depending on the function -->
</response>

The XML format is used for receiving a list of transactions and comprehensive information about them by using the functions “List of Transactions” and “Outgoing Payment Details” correspondingly.

* – returned function code

Response Code Description
0 The function is successfully finished
1 System failure
2 There are no transactions during the provided period in the provided currency
4 Error in parameters
6 Invalid electronic pass (ticket parameter)

Response Format for Orders

Response structure:

{
    "code": "code of answer*",
    "error": "message of error",
    "signatureRequired": [ "CER" ],
    "refNo": "reference number",
    "error_code": "returned function code",
    "error_message": "message of error",
    "execute_message": "message of successful execute",
    "error_field": "name of the field containing an error",
    "error_level": "error criticality code**"
}

The JSON format is used for making payment orders.

* – returned function code

Response Code Description
0 The function is successfully finished
1 System failure
2 Data not found
4 Error in parameters
5 No session or wrong session parameters
6 Invalid electronic pass (ticket parameter)

** – error criticality index

Response Code Description
0 No errors
2 Non-critical error. The order cannot be executed at this moment (no money for service etc.) but will be processed later
4 Critical error. The order will not be processed

Function “List of Transactions”

This function is used to receive all transactions on the account.

Enquiry Parameters

Sample code:

curl -d "function=Transactions&ticket=JGFIGDMG5965SF44557548958345975934&ccy=EUR&dateFrom=2012-01-26&dateTill=2012-02-28&language=RU&trnID=~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "Transactions",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "ccy" => "EUR",
    "dateFrom" => "2012-01-26",
    "dateTill" => "2012-02-28",
    "language" => "RU",
    "trnID" => "~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "Transactions"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("ccy", "EUR"));
params.add(new BasicNameValuePair("dateFrom", "2012-01-26"));
params.add(new BasicNameValuePair("dateTill", "2012-02-28"));
params.add(new BasicNameValuePair("language", "RU"));
params.add(new BasicNameValuePair("trnID", "~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "Transactions",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    ccy => "EUR",
    dateFrom => "2012-01-26",
    dateTill => "2012-02-28",
    language => "RU",
    trnID => "~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "Transactions" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "ccy", "EUR" },
       { "dateFrom", "2012-01-26" },
       { "dateTill", "2012-02-28" },
       { "language", "RU" },
       { "trnID", "~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#" }
    }
);
Parameter Description
function* Transactions
ticket* Electronic pass provided when the account is connected to Enterprise Link Pro service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
ccy Currency code according to the ISO-4217 standard, for example ccy=EUR
dateFrom* Date of the start of the statement period in ISO yyyy-MM-dd format, for example dateFrom=2012-01-26
dateTill* Date of the end of the statement period in ISO yyyy-MM-dd format, for example dateTill=2012-01-28
language Language of the statement (notes, etc.), for example language=RU. Possible options: RU, EN, LV
trnID ID of the transaction the next page starts from (for a page-by-page statement). The parameter is not provided for the first page.

* compulsory parameters

Description of XML Fields

Response Example:

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <code>0</code>
    <error/>
    <transactions>
        <transaction>
            <uniqueID>EQ-28022013-HEAD-@@SC-7</uniqueID>
            <trnID>~bb~Y#~bbEUR~12387.76#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512150262#~t2~2524554564#~td~01112012#</trnID>
            <date>2012-11-01</date>
            <refno>AAA2004</refno>
            <docno/>
            <benname/>
            <benacc/>
            <benid/>
            <benbank/>
            <benbankswift/>
            <details/>
            <narrative>Interest repay - fund.</narrative>
            <amount>-9.82</amount>
            <currency>EUR</currency>
            <saldo>12387.76</saldo>
            <trtype>YP</trtype>
            <trntype>EQ_440</trntype>
            <trndesc>Interest repay - fund.</trndesc>
            <tcf>Y</tcf>
        </transaction>
        <transaction>
            <uniqueID>EQ-28022013-HEAD-@@SC-8</uniqueID>
            <trnID>~bb~Y#~bbEUR~12183.39#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030097#~of~seq_no#~t1~2512436843#~t2~2525131368#~td~12112012#</trnID>
            <date>2012-11-12</date>
            <refno>I5IC11129901953</refno>
            <docno/>
            <benname/>
            <benacc/>
            <benid/>
            <benbank/>
            <benbankswift/>
            <details>6.97 LVL -- 10.00 EUR (0.697500000)</details>
            <narrative>6.97 LVL -- 10.00 EUR (0.697500000)</narrative>
            <amount>10.0</amount>
            <currency>EUR</currency>
            <saldo>12183.39</saldo>
            <trtype>CONV</trtype>
            <trntype>EQ_543</trntype>
            <trndesc>Currency Exchange</trndesc>
            <tcf>Y</tcf>
        </transaction>
        <transaction>
            <uniqueID>EQ-28022013-HEAD-@@SC-9</uniqueID>
            <trnID>~bb~Y#~bbLVL~2638.06#~cbd~03122012#~ctd~03122012#~fbd~31122000#~hd~05032005#~ls~2513030256#~of~seq_no#~t1~2512299603#~t2~2524860183#~td~07112012#</trnID>
            <date>2012-11-07</date>
            <refno>IVIC11079900909</refno>
            <docno>11-1</docno>
            <benname>ben name</benname>
            <benacc>LV70RIKO000000000000</benacc>
            <benid>111111-22222</benid>
            <benbank>AS DNB BANKA</benbank>
            <benbankswift>RIKOLV2X</benbankswift>
            <details>konta papild.</details>
            <narrative>59: /ID/ 111111-22222, ben name, Rez LV, Nr.LV70RIKO000000000000; 57: AS DNB BANKA, RIKOLV2X; 70: konta papild.;</narrative>
            <amount>-100.0</amount>
            <currency>LVL</currency>
            <saldo>2638.06</saldo>
            <trtype>OO</trtype>
            <trntype>EQ_471</trntype>
            <trndesc>External payment</trndesc>
            <tcf>Y</tcf>
        </transaction>
    </transactions>
    <more>false</more>
</response>
XML Field Description
<uniqueID> Unique identifier of the transaction
<trnID> The transaction ID that is used in the request to get the next page
<date> Transaction date
<refno> Reference number of the transaction
<docno> Document number set by the client
<benname> Beneficiary name
<benacc> Beneficiary account number
<benid> Beneficiary identifier
<benbank> Beneficiary bank
<benbankswift> SWIFT code of the beneficiary bank
<details> Transaction details
<amount> Transaction amount. Sign “-“ means that it is a debit transaction
<currency> Transaction currency
<saldo> Balance after the transaction
<trtype> DTransaction type
<trntype> Transaction type from ABC
<trndesc> Description of the transaction type
<more> Sign of the availability of transactions. The “true” parameter means that not all transactions have been obtained and continuation must be enquired about (with an indication of the identifier of the last obtained transaction <trnID>)

Function “Outgoing Payment Details”

This function is used for receiving information on the specific outgoing transaction.

Enquiry Parameters

Sample code:

curl -d "function=OutgoingPaymentDetails&ticket=JGFIGDMG5965SF44557548958345975934&refno=IVID05249900342&language=RU" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "OutgoingPaymentDetails",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "refno" => "IVID05249900342",
    "language" => "RU"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "OutgoingPaymentDetails"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("refno", "IVID05249900342"));
params.add(new BasicNameValuePair("language", "RU"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "OutgoingPaymentDetails",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    refno => "IVID05249900342",
    language => "RU"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "OutgoingPaymentDetails" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "refno", "IVID05249900342" },
       { "language", "RU" }
    }
);
Parameter Description
function* OutgoingPaymentDetails
ticket* Electronic pass provided during account login for the service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
refno* Reference number of the transaction
language Language of the statement (notes, etc.), for example language=RU. Possible options: RU, EN, LV

* compulsory parameters

Description of XML Fields

Response Example:

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <code>0</code>
    <error/>
    <details>
        <ref_no>IVID05249900342</ref_no>
        <state_id>2</state_id>
        <doc_number/>
        <reg_date>2013-05-24T00:00:00</reg_date>
        <reg_datetime>2013-05-24T16:04:58</reg_datetime>
        <urgency>Standart</urgency>
        <urgency_code>1</urgency_code>
        <rem_acc>LV10RTMB0000000000000</rem_acc>
        <rem_name>ABC Ltd.</rem_name>
        <rem_addr>RĪGA LATVIA</rem_addr>
        <rem_regno>123456789-0</rem_regno>
        <rem_country>LV</rem_country>
        <rem_res>RES</rem_res>
        <pmnt_amount>1000.0</pmnt_amount>
        <pmnt_ccy>AUD</pmnt_ccy>
        <pmnt_value/>
        <cor_name/>
        <cor_addr/>
        <cor_addr1/>
        <cor_bic/>
        <cor_eltype/>
        <cor_el/>
        <cor_country/>
        <bbank_acc/>
        <bbank_name>UBS AG</bbank_name>
        <bbank_addr>ZURICH</bbank_addr>
        <bbank_addr1>45, BAHNHOFSTRASSE</bbank_addr1>
        <bbank_bic>UBSWCHZH80A</bbank_bic>
        <bbank_country>CH</bbank_country>
        <bbank_eltype/>
        <bbank_el/>
        <ben_name>ABC HOLDINGS LIMITED</ben_name>
        <ben_addr>UNIT 88,19THFLOOR BASE</ben_addr>
        <ben_addr1>200 DEF ROAD,Germany</ben_addr1>
        <ben_acciban>CH5000111235FJ1234567</ben_acciban>
        <ben_country>SZ</ben_country>
        <ben_regno>123</ben_regno>
        <ben_res>NONRES</ben_res>
        <charge_type>BEN</charge_type>
        <pmnt_details>test ALL FIELDS</pmnt_details>
        <add_info>Поле Information to the Bank.</add_info>
        <rietumuid>000000</rietumuid>
        <charge_amnt>0.0</charge_amnt>
        <charge_ccy/>
        <amk_code>213</amk_code>
        <tran_type_desc>Payment to another bank</tran_type_desc>
        <lng>EN</lng>
        <oper_type>Debit</oper_type>
        <state_id_desc>Rejected</state_id_desc>
        <cor_bank_acc/>
        <oper_type_v>D</oper_type_v>
        <pmnt_amount_text>one thousand, 00</pmnt_amount_text>
    </details>
</response>
XML Field Description
<ref_no> Reference number of the transaction
<state_id> Transaction state *
<doc_number> Document number set by the client
<reg_date> Transaction registration date
<reg_datetime> Date and time of the registration
<urgency> Urgency of the transaction **
<urgency_code> Urgency code **
<rem_acc> Account of the sender
<rem_name> Name of the sender
<rem_addr> Address of the sender
<rem_regno> Registration name of the sender
<rem_country> Country of the sender
<rem_res> Whether the sender is a resident of Latvia. Possible options: RES, NONRES
<pmnt_amount> Transaction amount
<pmnt_ccy> Transaction currency
<pmnt_value> Value date
<cor_name> Name of the correspondent bank
<cor_addr> Address of the correspondent bank
<cor_addr1>
<cor_bic> SWIFT of the correspondent bank
<cor_eltype> National code type
<cor_el> National code
<cor_country> Country of the correspondent bank
<bbank_acc> Account of the beneficiary bank
<bbank_name> Name of the beneficiary bank
<bbank_addr> Address of the beneficiary bank
<bbank_addr1>
<bbank_bic> SWIFT of the beneficiary bank
<bbank_country> Country of the beneficiary bank
<bbank_eltype> National code type
<bbank_el> National code
<ben_name> Beneficiary name
<ben_acciban> Beneficiary account in IBAN format
<ben_addr> Address of the beneficiary
<ben_addr1>
<ben_country> Country of the beneficiary
<ben_regno> Registration number of the beneficiary
<ben_res> Whether the beneficiary is a resident of Latvia. Possible options: RES, NONRES
<charge_type> Charge type ***
<pmnt_details> Payment details
<add_info> Additional information
<rietumuid> Rietumu ID
<charge_amnt> Charge amount. The value is not returned.
<charge_ccy> Charge currency. The value is not returned.
<amk_code> AMK code of the transaction. Is used when a resident of Latvia remits more than EUR 5 000 to a non-resident.
<tran_type_desc> Transaction type description
<lng> Language used in the enquiry
<oper_type> Operation type. Possible options (the language depends on ): Debit, Credit
<state_id_desc> Code of the transaction state *
<cor_bank_acc> Account number of the beneficiary bank in the correspondent bank
<oper_type_v> Operation type code. Possible options: D, C
<pmnt_amount_text> Payment amount in words

* - possible options of the transaction state

State Description Code
In the bank 0, 3, 4
For signature 20
Deferred 1
Cancelled 2, 7
Sent 5, 6

** - possible options of urgency

Description of Urgency Code
Standard 1
Express 2
Economy 3

*** - possible options of charge types

Charge Type Description
OUR Paid by the sender
BEN Paid by the beneficiary
SHA Paid separately

Function “Send a Document”

This function registers a payment order in the bank and returns errors, when such are found.

Enquiry Parameters

Sample code:

curl -d "function=PostDocument&ticket=JGFIGDMG5965SF44557548958345975934&language=RU&doc=<XML content>" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "PostDocument",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "language" => "RU",
    "doc" => "<XML content>"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "PostDocument"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("language", "RU"));
params.add(new BasicNameValuePair("doc", "<XML content>"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "PostDocument",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    language => "RU",
    doc => "<XML content>"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "PostDocument" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "language", "RU" },
       { "doc", "<XML content>" }
    }
);
Parameter Description
function* PostDocument
ticket* Electronic pass provided during account login for the service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
language Language used for notifying about errors. Possible options: RU, EN, LV
doc* Document text in XML format

* compulsory parameters

XML Format of a Payment Order

Example of XML Document:

<RBdocument type="payment">
    <DocNo>1-3</DocNo>
    <SendCopyeMail/>
    <SendCopyiRietumu>N</SendCopyiRietumu>
    <User>000000</User>
    <System></System>
    <AddInfo72>additional info</AddInfo72>
    <AmkCode>0</AmkCode>
    <Amount>100.00</Amount>
    <BenBank>
        <BenBankAcc>A111111</BenBankAcc>
        <BenBankAddr1>AXION SWISS BANK SA</BenBankAddr1>
        <BenBankAddr2>LUGANO</BenBankAddr2>
        <BenBankAddr3>1, VIA BOSSI</BenBankAddr3>
        <BenBankBic>UNCECH22XXX</BenBankBic>
        <BenBankCountry>CH</BenBankCountry>
        <BenBankEl/>
        <BenBankElType/>
    </BenBank>
    <Beneficiary>
        <BenAcc>CH0000000000000000000</BenAcc>
        <BenAddr1>TEST COMPANY LIMITED</BenAddr1>
        <BenAddr2>address line 1</BenAddr2>
        <BenAddr3>address line 2</BenAddr3>
        <BenCountry>CH</BenCountry>
        <BenID>1234567</BenID>
    </Beneficiary>
    <Ccy>EUR</Ccy>
    <Charge>OUR</Charge>
    <Details70>payment details</Details70>
    <Intermediary>
        <IntBankAcc/>
        <IntBankAddr1>ASIA PACIFIC FINANCIAL SERVICES CHI</IntBankAddr1>
        <IntBankAddr2>NA LIMITED</IntBankAddr2>
        <IntBankAddr3>LANZHOU GANSU</IntBankAddr3>
        <IntBankBic>APFVCNB1XXX</IntBankBic>
        <IntBankCountry>CN</IntBankCountry>
        <IntBankEl/>
        <IntBankElType/>
    </Intermediary>
    <Rate>0.0</Rate>
    <Sender>
        <SenderAcc>LV10RTMB0000000000000</SenderAcc>
        <SenderCountry/>
    </Sender>
    <Urgency>1</Urgency>
</RBdocument>

Successful JSON response:

{
    "code": 0, 
    "error": "", 
    "signatureRequired": [ "CER", "DGP", "OTP" ],
    "refNo": "HVEE07099900001", 
    "error_code": "IERR_OK",
    "error_message": "The order has been executed (IERR_OK)",
    "execute_message": "",
    "error_field": "",
    "error_level": 0,
    "fee_ccy": "",
    "fee_amount": 0.0,
    "errors": [
        {
            "error_code": "IERR_OK",
            "error_message": "The order has been executed (IERR_OK)",
            "execute_message": "",
            "error_field": "",
            "error_level": 0
        }
    ]
}

Successful JSON response with errors:

{
    "code": 0, 
    "error": "", 
    "signatureRequired": [ "CER", "DGP", "OTP" ],
    "refNo": "HVEE07099900002", 
    "error_code": "IPM_BENNOT2",
    "error_message": "Beneficiary name not found\/ not indicated (Beneficiary name not found)",
    "execute_message": "",
    "error_field": "BenAddr1",
    "error_level": 4,
    "fee_ccy": "",
    "fee_amount": 0.0,
    "errors": [
        {
            "error_code": "IPM_BENNOT2",
            "error_message": "Beneficiary name not found\/ not indicated (Beneficiary name not found)",
            "execute_message": "",
            "error_field": "BenAddr1",
            "error_level": 4
        },
        {
            "error_code": "IERR_FVALUE",
            "error_message": "Postponed payment. The payment instruction will be postponed until selected execution date. (Future Value)",
            "execute_message": "",
            "error_field": "",
            "error_level": 2
        }
    ]
}
Field Description Length Allowed Values Required
<DocNo> Number of the document 15 charset_All* N
<System> System, leave empty Y
<User> User identifier - Rietumu ID 6 0-9 Y
<Amount> Payment amount 15.2 Y
<Ccy> Currency 3 ISO 4217, 3-digit code Y
<Sender>
<SenderAcc> Sender account 21 IBAN. Always an account at Rietumu Y
</Sender>
<Beneficiary>
<BenAcc> Receiver’s account 34 charset_ACCOUNT** Y
<BenAddr1> Receiver’s name 34 charset_All* Y
<BenAddr2> Receiver’s address (line 1) 34 charset_All* N
<BenAddr3> Receiver’s address (line 2) 34 charset_All* N
<BenCountry> Receiver’s country of residence 2 ISO 3166-1 alpha-2 code Y
<BenID> Registration number of the receiver 34 charset_All* N
</Beneficiary>
<BenBank>
<BenBankAcc> Beneficiary Bank account at the correspondent bank (RKZ – payment processing centre) 34 charset_ACCOUNT** N
<BenBankAddr1> Name of the Beneficiary Bank 34 charset_All* Y
<BenBankAddr2> Address of Beneficiary Bank 1 34 charset_All* N
<BenBankAddr3> Address of Beneficiary Bank 2 34 charset_All* N
<BenBankBic> SWIFT of the Beneficiary Bank 11 A-Za-z0-9 N
<BenBankCountry> Country of the Beneficiary Bank 2 ISO 3166-1 alpha-2 code Y
<BenBankEl> National clearing code 30 charset_All* N
<BenBankElType> Clearing code type 2 ELTYPE*** Y, if <BenBankEl> is filled
</BenBank>
<Intermediary>
<IntBankAcc> Account in Settlement Center (RKZ – payment processing centre) 34 charset_ACCOUNT** N
<IntBankAddr1> Name of the Correspondent Bank 34 charset_All* N
<IntBankAddr2> Address of Correspondent Bank 1 34 charset_All* N
<IntBankAddr3> Address of Correspondent Bank 2 34 charset_All* N
<IntBankBic> SWIFT of the Correspondent Bank 11 A-Za-z0-9 N
<IntBankCountry> Country of the Correspondent Bank 2 ISO 3166-1 alpha-2 code Y, if <IntBankAddr1> is filled
<IntBankEl> National clearing code 30 charset_All* N
<IntBankElType> Clearing code type 2 ELTYPE*** Y, if <IntBankEl> is filled
</Intermediary>
<Details70> Note 140 charset_All* Y
<AddInfo72> Additional information 200 charset_All* N
<Rate> Fixed value “0.0” 1.1 Y
<SendCopyeMail> E-mail address for receiving a SWIFT copy. Paid service 60 A-Za-z0-9а-яА-Я!#$%’*+-/=?^_`{|}~.@ N
<SendCopyiRietumu> SWIFT copy receipt at iRietumu. Paid service 1 Y/N N
<Urgency> Urgency 1 1 - Normal payment
2 - Urgent payment
3 - Economic payment
Y
<DesiredDate> Desired execute date 10 YYYY-MM-DD N
<Charge> Commission type 3 BEN - at the expense of the receiver
OUR - at the expense of the sender
SHA - separately
DEF - automatic (the value will be chosen by the bank depending on the payment parameters)
Y
<AmkCode> External payment code according to the reference book of the Bank of Latvia 3 0-9 Y, when payment is made from a LV resident to a LV non-resident in an amount exceeding EUR 10000

* – A-Za-z0-9?:().,’+{};!?&-_[]`/“<space>а-яА-Я <Latvian alphabet symbols>

** – A-Za-z0-9?:().,’+{};!?&-_[]`/”<space>

*** – two-digit code, the values of which are presented in the table

Code Description
RU Bank Identification Code (БИК/BIC)
AT Austrian Bankleitzahl
AU Australian Bank State Branch (BSB)
BL German Bankleitzahl
CC Canadian Payments Association Payment Routing
CH CHIPS Universal Identifier
CP USA CHIPS Participant Identifier
ES Spanish Domestic Interbanking Code
FW USA Fedwire Routing Number
HK Bank Code of Hong Kong
IE Irish National Clearing Code (NSC)
IT Italian Domestic Identification Code
MF MFO (Other)
NZ New Zealand National Clearing Code
PT Portuguese National Clearing Code
SC UK Domestic Sort Code
SW Swiss Clearing Code (BC or SIC)

Function “Receive a Document for Signature”

This function returns the earlier registered document for its further signature.

Enquiry Parameters

Sample code:

curl -d "function=GetDocumentForSign&ticket=JGFIGDMG5965SF44557548958345975934&language=RU&refNo=HVEE07099900001" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "GetDocumentForSign",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "language" => "RU",
    "refNo" => "HVEE07099900001"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "GetDocumentForSign"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("language", "RU"));
params.add(new BasicNameValuePair("refNo", "HVEE07099900001"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "GetDocumentForSign",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    language => "RU",
    refNo => "HVEE07099900001"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "GetDocumentForSign" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "language", "RU" },
       { "refNo", "HVEE07099900001" }
    }
);
Parameter Description
function* GetDocumentForSign
ticket* Electronic pass provided during account login for the service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
language Language used for notifying about errors. Possible options: RU, EN, LV
refNo* Reference number of the document

* compulsory parameters

Response Example:

{
    "code": 0,
    "error": "", 
    "signatureRequired": [ "CER" ], 
    "expectedSignatures": [], 
    "existingSignatures": [],
    "doc": "Text of the XML document"
}

Function “Send the Signed Document”

Sample code:

# W3C specification for XMLDSig is available here: http://www.w3.org/TR/xmldsig-core/
# OpenSSL documentation is available here: https://www.openssl.org/docs/apps/openssl.html
#
# Manually signing XML document using console tools is counterproductive so please check other solutions.
<?php
/**
 * Sign XML content using XMLDSig enveloped method for PHP 5.3
 *
 * Requires classes XMLSecurityKey and XMLSecurityDSig
 * from https://github.com/formapro/xmlseclib
 *
 * @param    string $XMLContent
 * @param    string $certificatePath
 * @param    string $certificatePassword
 *
 * @return    string                            signed XML
 * @throws    Exception
 *
 * Usage:
 * $signedContent = XMLDSig_SignEnveloped($contentToSign, './cert.pem', 'qwerty');
 */
function XMLDSig_SignEnveloped($XMLContent, $certificatePath, $certificatePassword) {
    if (!function_exists('openssl_pkey_get_private'))
        throw new Exception('Openssl PHP extension is required in ');
    $certificateContent = file_get_contents($certificatePath);
    $privateKey         = openssl_pkey_get_private($certificateContent, $certificatePassword);
    if (!$privateKey)
        throw new Exception("Unable to load private key in ");
    $keyDetails = openssl_pkey_get_details($privateKey);

    $document = new DOMDocument();
    $document->loadXML($XMLContent);

    $objXMLSecurityKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'private'));
    $objXMLSecurityKey->loadKey($privateKey);
    $objXMLSecDSig = new XMLSecurityDSig("");
    $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N_COMMENTS);
    $objXMLSecDSig->addReference($document, XMLSecurityDSig::SHA1, array('http://www.w3.org/2000/09/xmldsig#enveloped-signature'), array('force_uri' => true));
    $objXMLSecDSig->sign($objXMLSecurityKey, $document->documentElement);
    $objXMLSecDSig->add509Cert($certificateContent);

    $RSAKeyValueTpl = "<KeyValue><RSAKeyValue><Modulus>%s</Modulus><Exponent>%s</Exponent></RSAKeyValue></KeyValue>";
    $modulus        = base64_encode($keyDetails['rsa']['n']);
    $exponent       = base64_encode($keyDetails['rsa']['e']);
    $RSAKeyValue    = sprintf($RSAKeyValueTpl, $modulus, $exponent);

    return str_replace("</KeyInfo>", $RSAKeyValue . "</KeyInfo>", $document->saveXML());
}
?>
/**
 * XMLDSig class for Java 7
 *
 * Required:
 * 1. Bouncy Castle 1.38 or newer
 *      from https://www.bouncycastle.org/java.html
 * 
 * 2. Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
 *      from http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
 * 
 * Usage:
 * XMLDSig xmlDSig = new XMLDSig("./cert.p12", "qwerty");
 * String signedContent = xmlDSig.signEnveloped(contentToSign);
 */
public class XMLDSig {

    private KeyStore keyStore;
    private String alias;
    private XMLSignature signature;
    private DocumentBuilderFactory documentBuilderFactory;
    private TransformerFactory transformerFactory;
    private String filePath;
    private String password;

    public XMLDSig(String filePath, String password) throws GeneralSecurityException, IOException {
        this.filePath = filePath;
        this.password = password;

        Security.addProvider(new BouncyCastleProvider());

        keyStore = loadKeystore();
        alias = getAlias();
        signature = createSignature();

        documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        transformerFactory = TransformerFactory.newInstance();
    }

    private KeyStore loadKeystore() throws GeneralSecurityException, IOException {
        KeyStore keyStore = KeyStore.getInstance("PKCS12", "BC");
        keyStore.load(new FileInputStream(filePath), password.toCharArray());

        return keyStore;
    }

    private String getAlias() throws GeneralSecurityException {
        String alias = null;
        Enumeration<String> enumeration = keyStore.aliases();
        while(enumeration.hasMoreElements()) {
            alias = (String)enumeration.nextElement();
            break;
        }
        if (alias.isEmpty()) {
            throw new RuntimeException("Key store does not contain entry with alias");
        }

        return alias;
    }

    private XMLSignature createSignature() throws GeneralSecurityException {
        XMLSignatureFactory signatureFactory = XMLSignatureFactory.getInstance("DOM");
        return signatureFactory.newXMLSignature(createSignedInfo(signatureFactory), createKeyInfo(signatureFactory));
    }

    private SignedInfo createSignedInfo(XMLSignatureFactory signatureFactory) throws GeneralSecurityException {
        CanonicalizationMethod canonicalizationMethod = signatureFactory.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
                (C14NMethodParameterSpec) null);

        SignatureMethod signatureMethod = signatureFactory.newSignatureMethod(SignatureMethod.RSA_SHA1, null);

        DigestMethod digestMethod = signatureFactory.newDigestMethod(DigestMethod.SHA1, null);
        Transform transform = signatureFactory.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null);
        Reference reference = signatureFactory.newReference("", digestMethod, Collections.singletonList(transform), null, null);

        return signatureFactory.newSignedInfo(canonicalizationMethod, signatureMethod, Collections.singletonList(reference));
    }

    private KeyInfo createKeyInfo(XMLSignatureFactory signatureFactory) throws GeneralSecurityException {
        KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
        ArrayList<XMLStructure> keys = new ArrayList<XMLStructure>();

        X509Certificate certificate = getX509Certificate();
        keys.add(keyInfoFactory.newKeyValue(certificate.getPublicKey()));

        X509Data certificateInfo = keyInfoFactory.newX509Data(Collections.singletonList(certificate));
        keys.add(certificateInfo);

        return keyInfoFactory.newKeyInfo(keys);
    }

    private X509Certificate getX509Certificate() throws GeneralSecurityException {
        return (X509Certificate) keyStore.getCertificate(alias);
    }

    private PrivateKey getX509PrivateKey() throws GeneralSecurityException {
        return (PrivateKey) keyStore.getKey(alias, password.toCharArray());
    }

    public String signEnveloped(String documentSource) throws Exception {
        DocumentBuilder newDocumentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = newDocumentBuilder.parse(new InputSource(new StringReader(documentSource)));

        DOMSignContext signContext = new DOMSignContext(getX509PrivateKey(), document.getDocumentElement());
        signature.sign(signContext);

        StringWriter writer = new StringWriter();
        Transformer transformer = transformerFactory.newTransformer();
        transformer.transform(new DOMSource(document), new StreamResult(writer));
        return writer.toString();
    }

}
#!/usr/bin/perl

use XML::XPath;
use MIME::Base64;
use Crypt::OpenSSL::X509;
use Crypt::OpenSSL::RSA;
use File::Slurp;
use Digest::SHA1 qw(sha1);
use XML::CanonicalizeXML;
# Sign XML content using XMLDSig enveloped method for Perl 5.20
#
# Certificate in PEM format without encryption can be extracted from P12 certificate
# openssl pkcs12 -in ATTID1TR.p12 -out certkey.pem -clcerts -nodes
#
# @param   {String}    $XMLContent          XML content to be signed
# @param   {String}    $certificatePath     path to certificate file in PEM format without encryption
# @return  {String}                         XML content
#
# Usage: 
# my $signedContent = XMLDSig_SignEnveloped($contentToSign, "./certkey.pem");
sub XMLDSig_SignEnveloped {
    my ( $XMLContent, $certificatePath ) = @_;

    my $xml;
    my $parser = XML::XPath->new( xml => $XMLContent );
    my $nodeset = $parser->find('/');
    foreach my $node ($nodeset->get_nodelist) {
        $xml = XML::XPath::XMLParser::as_string( $node );
        last;
    }
    $signed = $XMLContent;

    my $certContent = read_file($certificatePath);

    my $rsaKey = Crypt::OpenSSL::RSA->new_private_key( $certContent );
    $rsaKey->use_pkcs1_padding();
    my $bigNum = ( $rsaKey->get_key_parameters() )[1];
    my $bin = $bigNum->to_bin();
    my $exp = encode_base64( $bin, '' );
    $bigNum = ( $rsaKey->get_key_parameters() )[0];
    $bin = $bigNum->to_bin();
    my $mod = encode_base64( $bin, '' );
    my $keyContent = "<KeyValue><RSAKeyValue><Modulus>$mod</Modulus><Exponent>$exp</Exponent></RSAKeyValue></KeyValue>";
    my $x509 = Crypt::OpenSSL::X509->new_from_string( $certContent );
    my $certString = $x509->as_string();
    $certString =~ s/-----BEGIN CERTIFICATE-----//;
    $certString =~ s/-----END CERTIFICATE-----//;
    $certString =~ s/\n//g;
    $certContent = "<X509Data><X509Certificate>$certString</X509Certificate></X509Data>";
    my $keyInfo = "<KeyInfo>".$certContent.$keyContent."</KeyInfo>";

    my $canonical = XML::CanonicalizeXML::canonicalize( $xml, '<XPath>(//. | //@* | //namespace::*)</XPath>', "", 1, 1 );
    my $bin_digest    = sha1( $canonical );
    my $digest        = encode_base64( $bin_digest, '' );
    my $digest_xml    = qq{<Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>$digest</DigestValue></Reference>};
    my $signed_info   = qq{<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>$digest_xml</SignedInfo>};
    $canonical_sign_info        = XML::CanonicalizeXML::canonicalize( $signed_info, '<XPath>(//. | //@* | //namespace::*)</XPath>', "", 1, 1 );

    my $bin_signature = $rsaKey->sign( $canonical_sign_info );
    my $signature     = encode_base64( $bin_signature, "" );
    my $signature_xml = qq{<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">$signed_info<SignatureValue>$signature</SignatureValue>$keyInfo</Signature>};
    $signed =~ s/(<\/[^>]*>)$/$signature_xml$1/;
    return $signed;
};
/**
 * XMLDSig class for .NET 4.5
 *
 * Required references:
 * System.Security
 * 
 * Usage:
 * var xmlDSig = new XMLDSig("./cert.p12", "qwerty");
 * var signedContent = xmlDSig.SignEnveloped(contentToSign);
 */
public class XMLDSig
{
    private X509Certificate2 x509Certificate2;
    private RSACryptoServiceProvider privateKey;

    public XMLDSig(String certificatePath, String certificatePassword)
    {
        x509Certificate2 = new X509Certificate2(certificatePath, certificatePassword);
        privateKey = (RSACryptoServiceProvider)x509Certificate2.PrivateKey;
    }

    public String SignEnveloped(String XMLContent)
    {
        var document = new XmlDocument();
        document.PreserveWhitespace = true;
        document.LoadXml(XMLContent);
        SignedXml signedXML = new SignedXml(document);

        signedXML.SigningKey = privateKey;
        signedXML.SignedInfo.CanonicalizationMethod = SignedXml.XmlDsigC14NWithCommentsTransformUrl;
        signedXML.SignedInfo.SignatureMethod = SignedXml.XmlDsigRSASHA1Url;

        Reference reference = new Reference();
        reference.Uri = "";
        reference.AddTransform(new XmlDsigEnvelopedSignatureTransform());
        signedXML.SignedInfo.AddReference(reference);

        KeyInfo keyInfo = new KeyInfo();
        keyInfo.AddClause(new KeyInfoX509Data(x509Certificate2));
        keyInfo.AddClause(new RSAKeyValue(privateKey));
        signedXML.KeyInfo = keyInfo;

        signedXML.ComputeSignature();
        XmlElement xmlDigitalSignature = signedXML.GetXml();
        document.DocumentElement.AppendChild(document.ImportNode(xmlDigitalSignature, true));
        return document.OuterXml;
    }
}

This function sends a signed document to the bank for execution. In the event of errors, they are returned.

Prior to sending a document, it must be signed in accordance with the XMLDSig standard (XML Digital Signature), the “Envelope” method. Only a payment order section included in the XML tags <RBdocument> and XAdES is signed.

Enquiry Parameters

Sample code:

curl -d "function=PostSignedDocument&ticket=JGFIGDMG5965SF44557548958345975934&language=RU&refNo=HVEE07099900001&doc=<XML content>" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "PostSignedDocument",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "language" => "RU",
    "refNo" => "HVEE07099900001",
    "doc" => "<XML content>"
), "./cert.pem", "qwerty"  );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "PostSignedDocument"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("language", "RU"));
params.add(new BasicNameValuePair("refNo", "HVEE07099900001"));
params.add(new BasicNameValuePair("doc", "<XML content>"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "PostSignedDocument",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    language => "RU",
    refNo => "HVEE07099900001",
    doc => "<XML content>"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "PostSignedDocument" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "language", "RU" },
       { "refNo", "HVEE07099900001" },
       { "doc", "<XML content>" }
    }
);

Example of Signed XML Document

<RBdocument type="payment">
    <DocNo>1-3</DocNo>
    <SendCopyeMail/>
    <SendCopyiRietumu>N</SendCopyiRietumu>
    <User>000000</User>
    <System>ELinkPRO</System>
    <AddInfo72>additional info</AddInfo72>
    <AmkCode>0</AmkCode>
    <Amount>100.00</Amount>
    <BenBank>
        <BenBankAcc>A111111</BenBankAcc>
        <BenBankAddr1>AXION SWISS BANK SA</BenBankAddr1>
        <BenBankAddr2>LUGANO</BenBankAddr2>
        <BenBankAddr3>1, VIA BOSSI</BenBankAddr3>
        <BenBankBic>UNCECH22XXX</BenBankBic>
        <BenBankCountry>CH</BenBankCountry>
        <BenBankEl/>
        <BenBankElType/>
    </BenBank>
    <Beneficiary>
        <BenAcc>CH0000000000000000000</BenAcc>
        <BenAddr1>TEST COMPANY LIMITED</BenAddr1>
        Инструкция по настройке Enterprise Link PRO
        23
        <BenAddr2>address line 1</BenAddr2>
        <BenAddr3>address line 2</BenAddr3>
        <BenCountry>CH</BenCountry>
        <BenID>1234567</BenID>
    </Beneficiary>
    <Ccy>EUR</Ccy>
    <Charge>OUR</Charge>
    <Details70>payment details</Details70>
    <Intermediary>
        <IntBankAcc/>
        <IntBankAddr1>ASIA PACIFIC FINANCIAL SERVICES CHI</IntBankAddr1>
        <IntBankAddr2>NA LIMITED</IntBankAddr2>
        <IntBankAddr3>LANZHOU GANSU</IntBankAddr3>
        <IntBankBic>APFVCNB1XXX</IntBankBic>
        <IntBankCountry>CN</IntBankCountry>
        <IntBankEl/>
        <IntBankElType/>
    </Intermediary>
    <Rate>0.0</Rate>
    <Sender>
        <SenderAcc>LV10RTMB0000000000000</SenderAcc>
        <SenderCountry/>
    </Sender>
    <Urgency>1</Urgency>
    <RegistrationDateTime>2014-07-07T10:42:26</RegistrationDateTime>
    <RefNo>HVEE07099900001</RefNo>
    <SignerSID>jcs_WhEny0eiG1s1FppetEw</SignerSID>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <Reference URI="">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <DigestValue>Z/G0FYqtbpB6Wof2CQkuIoDOAVs=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>gJg8hHotw6fvuaPErg68rTH/OVnVYmohrfsYfwIW0vVhCLmDuTowEmgdnJWYzcKn2lttReQoV8cJ
            KX8uvTgrasmrHYZ3zuq9BH70yh0P7fZjb4gZRv0ptxtWFBgBuF4gkp7u4f5SYG4mckiN6+pBic4H
            asvbrfvTrXJSmy3/oBE=</SignatureValue>
        <KeyInfo>
            <KeyValue>
                <RSAKeyValue>
                    <Modulus>tPr8PUX9Cf5o2j25o1g1Tb/W6MiCDED9C0LlP9k/hK9uJkUL3fbMEfMDjtRa83+AfnYHMTG81tNp
                        h9+aLOeKNobDKG3KCYxEXqvfGva0a9OBLi8lULzVdqit+hBfCEpwKCSZNshu2AXA7KFw58CWTzth
                        +2A8f7z5GcgdTgxJu1E=</Modulus>
                    <Exponent>Aw==</Exponent>
                </RSAKeyValue>
            </KeyValue>
            <X509Data>
                <X509Certificate>MIICcDCCAdmgAwIBAgIGAUTPAVTCMA0GCSqGSIb3DQEBBQUAMG8xCzAJBgNVBAYTAkxWMRYwFAYD
                    VQQKEw1SaWV0dW11IEJhbmthMR4wHAYDVQQLExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKDAmBgNV
                    BAMTHyh0ZXN0KSBSQiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTQwMzE3MDc0NjE0WhcNMTYw
                    MzA2MDc0NjE0WjBDMQ8wDQYDVQQDDAY0MjM2NzMxIzAhBgNVBAsMGkRpZ2l0YWwgSWRlbnRpZmll
                    ciBDbGFzcyAyMQswCQYDVQQGEwJMVjCBnTANBgkqhkiG9w0BAQEFAAOBiwAwgYcCgYEAtPr8PUX9
                    Cf5o2j25o1g1Tb/W6MiCDED9C0LlP9k/hK9uJkUL3fbMEfMDjtRa83+AfnYHMTG81tNph9+aLOeK
                    NobDKG3KCYxEXqvfGva0a9OBLi8lULzVdqit+hBfCEpwKCSZNshu2AXA7KFw58CWTzth+2A8f7z5
                    GcgdTgxJu1ECAQOjRTBDMAsGA1UdDwQEAwIB/jA0BgNVHSUBAf8EKjAoBggrBgEFBQcDAQYIKwYB
                    BQUHAwIGCCsGAQUFBwMJBggrBgEFBQcDBDANBgkqhkiG9w0BAQUFAAOBgQADBNN0K6wYm9G09yII
                    cPl8APAkbGPTm3eCUy50kkD9DnNwJilGY5Pdm1aqKQZ5GmbP+P4k6d6XKjB9TJSiBxzRLBurULes
                    LPaVxqWDp54gT7FFRr8Gz0CiaKdTr2xrzO+sCaMs3PzZ48WPrBZeYSedwPr7Gu3JjzxCD3dTq/BM
                    Ng==</X509Certificate>
            </X509Data>
        </KeyInfo>
    </Signature>
</RBdocument>

Successful JSON response:

{
    "code": 0,
    "error": "",
    "refNo": " HVEE07099900003",
    "error_code": "IERR_OK",
    "error_message": "",
    "error_field": "",
    "error_level": 0
}

Successful JSON response with errors:

{
    "code": 0,
    "error": "",
    "refNo": " HVEE07099900004",
    "error_code": "IERR_SIG_BAD",
    "error_message": "Invalid signature",
    "execute_message": "",
    "error_field": "",
    "error_level": 4,
    "errors": [
        {
            "error_code": "IERR_SIG_BAD",
            "error_message": "Invalid signature",
            "execute_message": "",
            "error_field": "",
            "error_level": 4
        }
    ]
}
Parameter Description
function* PostSignedDocument
ticket* Electronic pass provided during account login for the service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
language Language used for notifying about errors. Possible options: RU, EN, LV
refNo* Reference number of the document
doc* Text of a signed document in XML format

* compulsory parameters

ISO 20022

JSC “Rietumu Banka” supports work with ISO 20022 standard XML documents through Enterprise Link Pro system.

Following functions are used to work with ISO 20022 standard XML documents:

Function „Payment Initiation”

Function PostISO20022 is used to send ISO 20022 XML pain.001.001.03 format payment initiation message from the client to the bank.

Prior to sending a document, it must be signed in accordance with the XMLDSig standard (XML Digital Signature), the “Enveloped” method. Only a payment order section included in the XML tags and XAdES is signed.

Enquiry Parameters

Sample code:

curl -d "function=PostISO20022&rid=123456&ticket=JGFIGDMG5965SF44557548958345975934&resultFormat=XML&doc=<XML content>" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "PostISO20022",
    "rid" => "123456",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "resultFormat" => "XML",
    "doc" => "<XML content>"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "PostISO20022"));
params.add(new BasicNameValuePair("rid", "123456"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("resultFormat", "XML"));
params.add(new BasicNameValuePair("doc", "<XML content>"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "PostISO20022",
    rid => "123456",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    resultFormat => "XML",
    doc => "<XML content>"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "PostISO20022" },
       { "rid", "123456" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "resultFormat", "XML" },
       { "doc", "<XML content>" }
    }
);

Example:

<Document>
    <CstmrPmtStsRpt>
        <GrpHdr>
            <MsgId>1459416333517</MsgId>
            <CreDtTm>2016-01-31T12:25:33</CreDtTm>
            <InitgPty>
                <Id>
                    <OrgId>
                        <BICOrBEI>RTMBLV2X</BICOrBEI>
                    </OrgId>
                </Id>
            </InitgPty>
        </GrpHdr>
        <OrgnlGrpInfAndSts>
            <OrgnlMsgId>000000UniqMessageId-000012345678989</OrgnlMsgId>
            <OrgnlMsgNmId>pain.001.001.03</OrgnlMsgNmId>
            <OrgnlCreDtTm>2016-03-22T10:03:35</OrgnlCreDtTm>
            <GrpSts>ACSP</GrpSts>
            <StsRsnInf>
                <Rsn>
                    <Cd>NARR</Cd>
                </Rsn>
                <AddtlInf>Accepted for execution. RefNo : XIEG01319900188</AddtlInf>
            </StsRsnInf>
        </OrgnlGrpInfAndSts>
    </CstmrPmtStsRpt>
</Document>
Parameter Description
function* PostISO20022
rid* Rietumu ID
ticket* Electronic pass provided when the account is connected to Enterprise Link Pro service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
resultFormat* XML
doc* Text of a signed document in XML format. Document must be signed in accordance with the XMLDSig standard (XML Digital Signature), the “Enveloped” method.

* compulsory parameters

Result of payment batch processing is returned in a payment status response message in ISO 20022 XML pain.002.001.03 format.

Function „Payment Status”

Function ISO20022Status is used to get the payment status in ISO 20022 XML pain.002.001.03 format from the bank.

Enquiry Parameters

Sample code:

curl -d "function=ISO20022Status&rid=123456&ticket=JGFIGDMG5965SF44557548958345975934&resultFormat=XML&msgId=1234566333517" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "ISO20022Status",
    "rid" => "123456",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "resultFormat" => "XML",
    "msgId" => "1234566333517"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "ISO20022Status"));
params.add(new BasicNameValuePair("rid", "123456"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("resultFormat", "XML"));
params.add(new BasicNameValuePair("msgId", "1234566333517"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "ISO20022Status",
    rid => "123456",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    resultFormat => "XML",
    msgId => "1234566333517"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "ISO20022Status" },
       { "rid", "123456" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "resultFormat", "XML" },
       { "msgId", "1234566333517" }
    }
);
Parameter Description
function* ISO20022Status
rid* Rietumu ID
ticket* Electronic pass provided when the account is connected to Enterprise Link Pro service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
resultFormat* XML
msgId* The payment order file identifier from the original payment initiation message (pain.001.001.03).

* compulsory parameters

Function „Receive a Document for Signature”

Function GetISO20022ForSign is used to get the document for signature in case multi-level signing scheme is used.

Enquiry Parameters

Sample code:

curl -d "function=GetISO20022ForSign&rid=123456&ticket=JGFIGDMG5965SF44557548958345975934&resultFormat=XML&msgId=1234566333517" -E ./cert.pem:qwerty https://<domain>/elinkpro/Process
<?php
$response = process_enterprise_link_pro( array(
    "function" => "GetISO20022ForSign",
    "rid" => "123456",
    "ticket" => "JGFIGDMG5965SF44557548958345975934",
    "resultFormat" => "XML",
    "msgId" => "1234566333517"
), "./cert.pem", "qwerty" );
?>
EnterpriseLinkPro enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("function", "GetISO20022ForSign"));
params.add(new BasicNameValuePair("rid", "123456"));
params.add(new BasicNameValuePair("ticket", "JGFIGDMG5965SF44557548958345975934"));
params.add(new BasicNameValuePair("resultFormat", "XML"));
params.add(new BasicNameValuePair("msgId", "1234566333517"));

String result = enterpriseLinkPro.process(params);
$response = process_enterprise_link_pro( [
    function => "GetISO20022ForSign",
    rid => "123456",
    ticket => "JGFIGDMG5965SF44557548958345975934",
    resultFormat => "XML",
    msgId => "1234566333517"
], './cert.pem', 'qwerty' );
var enterpriseLinkPro = new EnterpriseLinkPro("./cert.p12", "qwerty");

var result = await enterpriseLinkPro.Process(new Dictionary<string, string>
    {
       { "function", "GetISO20022ForSign" },
       { "rid", "123456" },
       { "ticket", "JGFIGDMG5965SF44557548958345975934" },
       { "resultFormat", "XML" },
       { "msgId", "1234566333517" }
    }
);
Parameter Description
function* GetISO20022ForSign
rid* Rietumu ID
ticket* Electronic pass provided when the account is connected to Enterprise Link Pro service at iRietumu, for example ticket=JGFIGDMG5965SF44557548958345975934
resultFormat* XML
msgId* The payment order file identifier from the original payment initiation message (pain.001.001.03).

* compulsory parameters

ISO 20022 XML Documents

Payment Initiation Message pain.001.001.03

General Requirements

Given documentation must be used with ISO 20022 Message Definition Report format description, since given documentation contains only data about those elements of the messages that are used in the bank. If message contains elements not described in this documentation, then those elements will be ignored.

Encoding

JSC “Rietumu Banka” supports “UTF-8 without BOM” encoding.

Payment Initiation Message Content Description

The report contains two mandatory blocks: Header and Payment Information.

Header: This block is indicated only once and contains file identification elements - payment identifier, message creation date and time, payment initiating party (representative).

Payment Information: File may contain one or more payment blocks. Each such block contains elements by which the payer (debtor) can be identified - debtor, debtor’s account. Also these blocks have information about Credit Transfer, which contain information about beneficiary, beneficiary’s bank, transfer amount and payment information.

The table describes message fields in the following format:

ISO Index No. Or. Mult. Message element <XML tag> ISO Type Comment about data in the field
[1..1] + Message root

ISO Index No. – Message element number. Number corresponds to ISO 20022 XML standard description, which may be found at www.iso20022.org under “Catalogue of ISO 20022 messages” with a reference to “pain.001.001.03”.

Or. – Indicates a choice possibility. One or the other element may be included in the message.

Mult. – Indicates if the element is mandatory and it’s occurrence. Possible values and their meanings:

Message element – Element name in accordance with ISO 20022 XML.

XML tag – XML tag of the corresponding element in the message.

ISO Type – XML tag content description.

Comment about data in the field – Additional comment about data in the field.

Message Elements

ISO Index No. Or. Mult. Message element <XML tag> ISO Type Comment about data in the field
Customer Credit Transfer Initiation <CstmrCdtTrfInitn>
1.0 [1..1] +GroupHeader <GrpHdr> Component
1.1 [1..1] ++MessageIdentification <MsgId> Max35Text Unique message identifier assigned by the creator. 6 first characters must coincide with Rietumu ID.
1.2 [1..1] ++CreationDateTime <CreDtTm> ISODateTime (YYYY-MM-DDThh:mm:ss, for example: 2015-11-21T09:15:39)
1.6 [1..1] ++NumberOfTransactions <NbOfTxs> Max15NumericText Total number of payments in the file.
1.7 [0..1] ++ControlSum <CtrlSum> Decimal Number Total amount of payments (regardless of currency). For example, 100EUR; 60USD; 50GBP - field value: 210.
1.8 + [1..1] ++Initiating Party <InitgPty> Party Identification Component Information on payment initiator - client’s representative. It is accepted but not used.
9.1.0 [0..1] +++Name <Nm> Max140Text
9.1.12 [0..1] +++Identification <Id> Component
9.1.13 {Or [1..1] ++++OrganisationIdentification <OrgId> Component Organization identifier.
9.1.14 [0..1] +++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] +++++Other <Othr> Component
9.1.16 [1..1] ++++++Identification <Id> Max35Text
9.1.17 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.18 [1..1] +++++++Code <Cd> Code If taxpayer identification number is being indicated - TXID.
9.1.21 Or} [1..1] ++++PrivateIdentification <PrvtId> Component Private person identifier.
9.1.27 [0..n] +++++Other <Othr> Component
9.1.28 [1..1] ++++++Identification <Id> Max35Text Private person’s code.
9.1.29 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.30 [1..1] +++++++Code <Cd> Code If person’s code is set - NIDN.
2.0 [1..n] +PaymentInformation <PmtInf> Component Payment information block.
2.1 [1..1] ++PaymentInformation Identification <PmtInfId> Max35Text Unique payment block identifier (assigned by payment initiator).
2.2 [1..1] ++PaymentMethod <PmtMtd> Code Only TRF code is accepted.
2.4 [0..1] ++NumberOfTransactions <NbOfTxs> Max15NumericText Number of payments in <PmtInf> block.
2.5 [0..1] ++ControlSum <CtrlSum> Decimal Number Amount of payments in <PmtInf> block, regardless of currency.
2.6 [0..1] ++PaymentTypeInformation <PmtTpInf> Component Aggregate of elements that indicate payment type/priority.
2.11 [0..1] +++LocalInstrument <LclInstrm> Choice Component
2.12 {Or [1..1] ++++Code <Cd> Code Payment execution speed for all payment orders in a given block. SDCL - Express, any other value - Standard. If this information is filled at a lower level, the field is ignored.
2.13 Or} [1..1] ++++Proprietary <Prtry> Max35Text Payment priority: NORM - Economy; HIGH - Standard; EXPR - Express. If this information is filled at a lower level (field 2.38), the field is ignored.
2.17 [1..1] ++RequestedExecutionDate <ReqdExctnDt> ISODate Date on which the payments will be sent for execution. Not more than 30 days in the future. Past dates are not accepted.
2.19 + [1..1] ++Debtor <Dbtr> Party Identification Component Payer data. The payer is identified by the payer’s account number (field. 2.20).
9.1.0 [0..1] +++Name <Nm> Max140Text Accepted but not used. It will be taken from Rietumu Bank database, based on the payer’s account number.
9.1.1 [0..1] +++PostalAddress <PstlAdr> Component Accepted but not used.
9.1.10 [0..1] ++++Country <Ctry> CountryCode Accepted but not used.
9.1.11 [0..7] ++++AdressLine <AdrLine> Max70Text Accepted but not used.
9.1.12 [0..1] +++Identification <Id> Choice Component Accepted but not used.
9.1.13 {Or [1..1] ++++OrganisationIdentification <OrgId> Component Accepted but not used. It will be taken from Rietumu Bank database, based on the payer’s account number (field. 2.20).
9.1.14 [0..1] +++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] +++++Other <Othr> Component
9.1.16 [1..1] ++++++Identification <Id> Max35Text
9.1.17 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.18 [1..1] +++++++Code <Cd> Code
9.1.21 Or} [1..1] ++++PrivateIdentification <PrvtId> Component Accepted but not used. It will be taken from Rietumu Bank database, based on the payer’s account number (field. 2.20).
9.1.22 [0..1] +++++DateAndPlaceOfBirth <DtAndPlcOfBirth> Component
9.1.23 [1..1] ++++++BirthDate <BirthDt> ISODate
9.1.25 [1..1] ++++++CityOfBirth <CityOfBirth> Max35Text
9.1.26 [1..1] ++++++CountryOfBirth <CtryOfBirth> CountryCode
9.1.27 [0..n] +++++Other <Othr> Component
9.1.28 [1..1] ++++++Identification <Id> Max35Text
9.1.29 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.30 [1..1] +++++++Code <Cd> Code
2.20 + [1..1] ++DebtorAccount <DbtrAcct> Component Information on the payer’s account, from which the payment will be made.
1.1.0 [1..1] +++Identification <Id> Account Identification Component Payer’s account identifier.
1.1.1 [1..1] ++++IBAN <IBAN> IBANIdentifier Account number in IBAN format. This field identifies account, from which the payment will be made.
1.1.11 [0..1] +++Currency <Ccy> Currency Code Accepted but not used. Payment currency will be determined after each payment CCY.
2.21 + [1..1] ++DebtorAgent <DbtrAgt> Financial Institution Identification Component
6.1.0 [1..1] +++FinancialInstitutionIdentification <FinInstnId> Component
6.1.1 [0..1] ++++BIC <BIC> BICIdentifier Bank BIC code - RTMBLV2X.
2.23 + [0..1] ++UltimateDebtor <UltmtDbtr> Party Identification Component Accepted but not used.
9.1.0 [0..1] +++Name <Nm> Max140Text
9.1.1 [0..1] +++PostalAddress <PstlAdr> Component
9.1.10 [0..1] ++++Country <Ctry> CountryCode
9.1.11 [0..7] ++++AdressLine <AdrLine> Max70Text
9.1.12 [0..1] +++Identification <Id> Choice Component
9.1.13 {Or [1..1] ++++OrganisationIdentification <OrgId> Component Company identifier.
9.1.14 [0..1] +++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] +++++Other <Othr> Component
9.1.16 [1..1] ++++++Identification <Id> Max35Text
9.1.17 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.18 [1..1] +++++++Code <Cd> Code
9.1.21 Or} [1..1] ++++PrivateIdentification <PrvtId> Component
9.1.22 [0..1] +++++DateAndPlaceOfBirth <DtAndPlcOfBirth> Component
9.1.23 [1..1] ++++++BirthDate <BirthDt> ISODate
9.1.25 [1..1] ++++++CityOfBirth <CityOfBirth> Max35Text
9.1.26 [1..1] ++++++CountryOfBirth <CtryOfBirth> CountryCode
9.1.27 [0..n] +++++Other <Othr> Component
9.1.28 [1..1] ++++++Identification <Id> Max35Text
9.1.29 [0..1] ++++++SchemeName <SchmeNm> Choice Component
9.1.30 [1..1] +++++++Code <Cd> Code
9.1.33 [0..1] +++CountryOfResidence <CtryOfRes> CountryCode
2.24 [0..1] ++ChargeBearer <ChrgBr> Code Refers to the side who pays transaction-related fees. One of the codes is allowed: DEBT - fees are paid by the payer; SHAR or SLEV - fees are paid separately; CRED - fees are paid by receiver. If the field is not filled it is considered SHAR.If this information is filled at a lower level (field 2.51), the field is ignored.
2.27 [1..n] ++CreditTransferTransactionInformation <CrdtTrfTxInf> Component Each <CrdtTrfTxInf> block contains information about one unique payment.
2.28 [1..1] +++PaymentIdentification <PmtId> Component Payment identification section.
2.29 [0..1] ++++InstructionIdentification <InstrId> Max35Text Accepted but not used.
2.3 [1..1] ++++End-To-EndIdentification <EndToEndId> Max35Text Unique payment number. It is transferred to the beneficiary’s bank if possible.
2.31 [0..1] +++PaymentTypeInformation <PmtTpInf> Component Contains information on priority of the payment.
2.33 [0..1] ++++ServiceLevel <SvcLvl> Choice Component Accepted but not used.
2.34 [1..1] +++++Code <Cd> Code
2.36 [0..1] ++++LocalInstrument <LclInstrm> Choice Component
2.38 [1..1] +++++Proprietary <Prtry> Max35Text Payment priority: NORM - Economy; HIGH - Standard; EXPR - Express. If this information is filled at a higher level (field 2.13), the higher level field is ignored.
2.39 [0..1] ++++CategoryPurpose <CtgyPurp> Choice Component Accepted but not used.
2.4 [1..1] +++++Code <Cd> Code
2.42 [1..1] +++Amount <Amt> Payment amount and currency.
2.43 [1..1] ++++InstructedAmount <InstdAmt Ccy=“AAA”> Amount Payment amount and currency. For example, if it is necessary to transfer 1000 EUR: <InstdAmt Ccy=“EUR”>1000</InstdAmt>. Both amount and currency must be specified.
2.51 [0..1] +++ChargeBearer <ChrgBr> Code Refers to the side who pays transaction-related fees. One of the codes is allowed: DEBT - fees are paid by the payer; SHAR or SLEV - fees are paid separately; CRED - fees are paid by receiver. If the field is not filled it is considered SHAR. If this information is filled at a higher level (field 2.24), the higher level field is ignored.
2.70 + [0..1] +++UltimateDebtor <UltmtDbtr> Identification Accepted but not used.
9.1.0 [0..1] ++++Name <Nm> Max140Text
9.1.1 [0..1] ++++PostalAddress <PstlAdr> Component
9.1.10 [0..1] +++++Country <Ctry> CountryCode
9.1.11 [0..7] +++++AdressLine <AdrLine> Max70Text
9.1.12 [0..1] ++++Identification <Id> Choice Component
9.1.13 {Or [1..1] +++++OrganisationIdentification <OrgId> Component
9.1.14 [0..1 ++++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] ++++++Other <Othr> Component
9.1.16 [1..1] +++++++Identification <Id> Max35Text
9.1.17 [0..1] +++++++SchemeName <SchmeNm> Choice Component
9.1.18 [1..1] ++++++++Code <Cd> Code
9.1.21 Or} [1..1] +++++PrivateIdentification <PrvtId> Component
9.1.22 [0..1] ++++++DateAndPlaceOfBirth <DtAndPlcOfBirth> Component
9.1.23 [1..1] +++++++BirthDate <BirthDt> ISODate
9.1.25 [1..1] ++++++CityOfBirth <CityOfBirth> Max35Text
9.1.26 [1..1] +++++++CountryOfBirth <CtryOfBirth> CountryCode
9.1.27 [0..n] ++++++Other <Othr> Component
9.1.28 [1..1] +++++++Identification <Id> Max35Text
9.1.29 [0..1] +++++++SchemeName <SchmeNm> Choice Component
9.1.30 [1..1] ++++++++Code <Cd> Code
9.1.33 [0..1] ++++CountryOfResidence <CtryOfRes> CountryCode
2.71 + [0..1] +++IntermediaryAgent1 <IntrmyAgt1> Financial Institution Identification Component Correspondent bank of beneficiary bank.
6.1.0 [1..1] ++++FinancialInstitutionIdentification <FinInstnId> Component
6.1.1 [0..1] +++++BIC <BIC> BICIdentifier Bank Identifier Code - BIC. Specify only for SWIFT.
6.1.2 [0..1] +++++ClearingSystemMemberIdentification <ClrSysMmbId> Component Clearing system which identifier is specified. Should be specified in case if BIC specified is not a SWIFT code.
6.1.3 [0..1] ++++++ClearingSystemIdentification <ClrSysId> Choice Component
6.1.4 [1..1] +++++++Code <Cd> Code Clearing system identifiers are available at http://www.iso20022.org/external_code_list.page in list ExternalClearingSystemIdentification1Code. Should be specified in case if BIC specified is not a SWIFT code.
6.1.6 [1..1] ++++++MemberIdentification <MmbId> Max35Text Correspondent bank identifier within the clearing system. Should be specified in case if BIC specified is not a SWIFT code.
6.1.7 [0..1] +++++Name <Nm> Max140Text Correspondent bank name.
6.1.8 [0..1] +++++PostalAddress <PstlAdr> Component Correspondent bank address.
6.1.17 [0..1] ++++++Country <Ctry> CountryCode
6.1.18 [0..7] ++++++AdressLine <AdrLine> Max70Text First 140 characters are being used, including the bank name.
6.1.25 [0..1] ++++BranchIdentification <BrnchId> Component Accepted but not used.
6.1.26 [0..1] +++++Identification <Id> Max35Text
6.1.27 [0..1] +++++Name <Nm> Max140Text
6.1.28 [0..1] +++++PostalAddress <PstlAdr> Component
6.1.37 [0..1] ++++++Country <Ctry> CountryCode
6.1.38 [0..7] ++++++AdressLine <AdrLine> Max70Text
2.72 + [0..1] +++IntermediaryAgentAccount1 <IntrmyAgt1Acct> Cash Account Component Account number in correspondent bank of beneficiary bank.
1.1.0 [1..1] ++++Identification <Id> Identification
1.1.1 {Or [1..1] +++++IBAN <IBAN> IBANIdentifier Account number only in IBAN format.
1.1.2 Or} [1..1] +++++Other <Othr> Component
1.1.3 [1..1] ++++++Identification <Id> Max34Text
1.1.4 [0..1] ++++++SchemeName <SchmeNm> Choice Component
1.1.5 [1..1] +++++++Code <Cd> Code
2.73 + [0..1] +++IntermediaryAgent2 <IntrmyAgt2> Financial Institution Identification Component Accepted but not used.
2.74 + [0..1] +++IntermediaryAgentAccount2 <IntrmyAgt2Acct> Cash Account Component Accepted but not used.
2.77 + [0..1] +++CreditorAgent <CdtrAgt> Financial Institution Identification Component Beneficiary bank.
6.1.0 [1..1] ++++FinancialInstitutionIdentification <FinInstnId> Component
6.1.1 [0..1] +++++BIC <BIC> BICIdentifier Bank Identifier Code - BIC. Specify only for SWIFT.
6.1.2 [0..1] +++++ClearingSystemMemberIdentification <ClrSysMmbId> Component Clearing system which identifier is specified. Should be specified in case if BIC specified is not a SWIFT code.
6.1.3 [0..1] ++++++ClearingSystemIdentification <ClrSysId> Choice Component
6.1.4 [1..1] +++++++Code <Cd> Code Clearing system identifiers are available at http://www.iso20022.org/external_code_list.page in list ExternalClearingSystemIdentification1Code. Should be specified in case if BIC specified is not a SWIFT code.
6.1.6 [1..1] ++++++MemberIdentification <MmbId> Max35Text Beneficiary bank identifier within the clearing system.
6.1.7 [0..1] +++++Name <Nm> Max140Text Beneficiary bank name.
6.1.8 [0..1] +++++PostalAddress <PstlAdr> Component Beneficiary bank mail address.
6.1.17 [0..1] ++++++Country <Ctry> CountryCode Country code.
6.1.18 [0..7] ++++++AdressLine <AdrLine> Max70Text First 140 characters are being used, including the bank name.
2.78 + [0..1] +++CreditorAgentAccount <CdtrAgtAcct> Cash Account Component Beneficiary bank account number in correspondent bank.
1.1.0 [1..1] ++++Identification <Id> Account Identification Component
1.1.1 {Or [1..1] +++++IBAN <IBAN> IBANIdentifier Account number only in IBAN format.
1.1.2 Or} [1..1] +++++Other <Othr> Component If account number is not in IBAN format.
1.1.3 [1..1] ++++++Identification <Id> Max34Text
2.79 + [0..1] +++Creditor <Cdtr> Party Identification Component Information about beneficiary (creditor) of the payment.
9.1.0 [0..1] ++++Name <Nm> Max140Text Name/name surname of receiver. In case of SEPA payment field length is limited to 70 characters.
9.1.1 [0..1] ++++PostalAddress <PstlAdr> Component Beneficiary address.
9.1.10 [0..1] +++++Country <Ctry> CountryCode
9.1.11 [0..7] +++++AdressLine <AdrLine> Max70Text It is used in the first 140 characters, along with the receiver’s name.
9.1.12 [0..1] ++++Identification <Id> Choice Component
9.1.13 {Or [1..1] +++++OrganisationIdentification <OrgId> Component Company identifier.
9.1.14 [0..1] ++++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] +++++++Other <Othr> Component
9.1.16 [1..1] ++++++++Identification <Id> Max35Text Company registration number or tax payer number.
9.1.17 [0..1] ++++++++SchemeName <SchmeNm> Choice Component
9.1.18 {Or [1..1] +++++++++Code <Cd> Code If taxpayer identification number is being indicated - TXID.
9.1.19 Or} [1..1] +++++++++Proprietary <Prtry> Max35Text
9.1.20 [0..1] ++++++++Issuer <Issr> Max35Text
9.1.21 Or} [1..1] ++++++PrivateIdentification <PrvtId> Component Private person identifier.
9.1.22 [0..1] +++++++DateAndPlaceOfBirth <DtAndPlcOfBirth> Component
9.1.23 [1..1] ++++++++BirthDate <BirthDt> ISODate
9.1.25 [1..1] ++++++++CityOfBirth <CityOfBirth> Max35Text
9.1.26 [1..1] ++++++++CountryOfBirth <CtryOfBirth> CountryCode Country code.
9.1.27 [0..n] ++++++Other <Othr> Component
9.1.28 [1..1] +++++++Identification <Id> Max35Text If person’s code is set - NIDN.
9.1.29 [0..1] +++++++SchemeName <SchmeNm> Choice Component
9.1.30 {Or [1..1] ++++++++Code <Cd> Code
9.1.31 Or} [1..1] ++++++++Proprietary <Prtry> Max35Text
9.1.32 [0..1] +++++++Issuer <Issr> Max35Text
9.1.33 [0..1] ++++CountryOfResidence <CtryOfRes> CountryCode Country code.
2.80 + [0..1] +++CreditorAccount <CdtrAcct> Cash Account Component Information about receiver’s account number (account to be credited). REQUIRED FIELD
1.1.0 [1..1] ++++Identification <Id> Account Identification Component
1.1.1 {Or [1..1] +++++IBAN <IBAN> IBANIdentifier Account to be credited in IBAN format. Mandatory for Latvian and SEPA payments.
1.1.2 Or} [1..1] +++++Other <Othr> Component
1.1.3 [1..1] ++++++Identification <Id> Max34Text Receiver’s account in non-IBAN format.
2.81 + [0..1] +++UltimateCreditor <UltmCdtr> Party Identification Component Accepted but not used.
9.1.0 [0..1] ++++Name <Nm> Max140Text
9.1.12 [0..1] ++++Identification <Id> Choice Component
9.1.13 {Or [1..1] +++++OrganisationIdentification <OrgId> Component Company identifier.
9.1.14 [0..1] ++++++BICOrBEI <BICOrBEI> Identifier
9.1.15 [0..n] +++++++Other <Othr> Component
9.1.16 [1..1] ++++++++Identification <Id> Max35Text
9.1.17 [0..1] ++++++++SchemeName <SchmeNm> Choice Component
9.1.18 [1..1] +++++++++Code <Cd> Code
9.1.21 Or} [1..1] ++++++PrivateIdentification <PrvtId> Component Private person identifier.
9.1.22 [0..1] +++++++DateAndPlaceOfBirth <DtAndPlcOfBirth> Component
9.1.23 [1..1] ++++++++BirthDate <BirthDt> ISODate
9.1.25 [1..1] +++++++CityOfBirth <CityOfBirth> Max35Text
9.1.26 [1..1] ++++++++CountryOfBirth <CtryOfBirth> CountryCode
9.1.27 [0..n] ++++++Other <Othr> Component
9.1.28 [1..1] +++++++Identification <Id> Max35Text
9.1.29 [0..1] +++++++SchemeName <SchmeNm> Choice Component
9.1.33 [0..1] ++++CountryOfResidence <CtryOfRes> CountryCode
2.86 [0..1] +++Purpose <Purp> Choice Component
2.87 [1..1] ++++Code <Cd> ExternalPurposeCode
2.89 [0..10] +++RegulatoryReporting <RgltryRptg> Component Is used for AMK code input, for VO codes in case of Russian ruble payments.
11.1.1 [0..1] ++++Authority <Authrty> Component
11.1.3 [0..1] +++++Country <Ctry> CountryCode Country code (LV in case of AMK, RU in case of Russian rubles).
11.1.4 [0..n] ++++Details <Dtls> Component
11.1.5 [0..1] +++++Type <Tp> Max35Text AMK - external payment classification code in case of Latvia. VO - currency operation code in case of Russia.
11.1.7 [0..1] +++++Country <Ctry> CountryCode
11.1.8 [0..1] +++++Code <Cd> Code Precise information/reference code. AMK - 3 characters, VO - 5 characters.
11.1.10 [0..1] +++++Information <Inf> Max35Text
2.98 [0..1] +++RemittanceInformation <RmtInf> Component Payment details/purpose.
2.99 {Or [0..1] ++++Unstructured <Ustrd> Max140Text Information about receiver (Payment details/purpose) in free form, max 140 characters allowed. Cannot be simultaneously filled with structured information element (field 2.100). Element can only be used one time in each payment.
2.1 Or} [0..1] ++++Structured <Strd> Component Structured information for beneficiary (Payment details/purpose). Cannot be simultaneously filled with unstructured information element (field 2.99). Element can only be used one time in each payment. Total length cannot exceed 140 characters.
2.12 [0..1] +++++CreditorReferenceInformation <CdtrRefInf> Component
2.121 [0..1] ++++++Type <Tp> Component Creditor reference type.
2.122 [1..1] +++++++CodeOrProprietary <CdOrPrtry> Component
2.123 [1..1] ++++++++Code <Cd> Code
2.125 [0..1] ++++++++Issuer <Issuer> Max35Text Payment reference issuer.
2.126 [0..1] ++++++Reference <Ref> Max35Text Payment reference number.

Specific Information Input

AMK Code Indication

XML sample:

<RgltryRptg>
    <Authrty>
        <Ctry>LV</Ctry>
    </Authrty>
    <Dtls>
        <Tp>AMK</Tp>
        <Cd>111</Cd>
    </Dtls>
</RgltryRptg>

In order to indicate AMK code, the section „RegulatoryReporting” (field 2.89) must be filled with the following information:

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.89 [0..10] +++RegulatoryReporting <RgltryRptg> Component
11.1.1 [0..1] ++++Authority <Authrty> Component
11.1.3 [0..1] +++++Country <Ctry> CountryCode Country code - LV.
11.1.4 [0..n] ++++Details <Dtls> Component
11.1.5 [0..1] +++++Type <Tp> Max35Text Code type - AMK.
11.1.8 [0..1] +++++Code <Cd> Code Example of transaction code: 111 - export import of goods

Ruble Payments to Russia

To specify correct payment execution following information must be filled:

Receiver’s Bank Code – BIK

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.77 + [0..1] +++CreditorAgent <CdtrAgt> Financial Institution Identification Component Beneficiary bank.
6.1.0 [1..1] ++++FinancialInstitutionIdentification <FinInstnId> Component Financial institutions identification section.
6.1.2 [0..1] +++++ClearingSystemMemberIdentification <ClrSysMmbId> Component
6.1.3 [0..1] ++++++ClearingSystemIdentification <ClrSysId> Choice Component Clearing system identifier.
6.1.4 [1..1] +++++++Code <Cd> Code Constant code - RUCBC.
6.1.6 [1..1] ++++++MemberIdentification <MmbId> Max35Text BIK value of beneficiary bank.

*This section also indicates the receiver’s bank name and address.

Correspondent Account of Receiver’s Bank

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.78 + [0..1] +++CreditorAgentAccount <CdtrAgtAcct> Cash Account Component Beneficiary bank account number in correspondent bank.
1.1.0 [1..1] ++++Identification <Id>
1.1.2 [1..1] +++++Other <Othr>
1.1.3 [1..1] ++++++Identification <Id> Receiver bank’s correspondent account (account number).

Receiver’s INN Code

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.79 + [0..1] +++Creditor <Cdtr> Party Identification Component
9.1.12 [0..1] ++++Identification <Id> Choice Component
9.1.13 [1..1] +++++OrganisationIdentification <OrgId> Component Company identifier.
9.1.15 [0..n] +++++++Other <Othr> Component
9.1.16 [1..1] ++++++++Identification <Id> Max35Text INN code (for example INN1234567890).
9.1.17 [0..1] ++++++++SchemeName <SchmeNm> Choice Component
9.1.19 [1..1] +++++++++Proprietary <Prtry> Max35Text Code type, constant INN.

Receiver’s KPP Code

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.79 + [0..1] +++Creditor <Cdtr> Party Identification Component
9.1.12 [0..1] ++++Identification <Id> Choice Component
9.1.13 [1..1] +++++OrganisationIdentification <OrgId> Component Company identifier.
9.1.15 [0..n] +++++++Other <Othr> Component
9.1.16 [1..1] ++++++++Identification <Id> Max35Text KPP code (for example KPP987654321).
9.1.17 [0..1] ++++++++SchemeName <SchmeNm> Choice Component
9.1.19 [1..1] +++++++++Proprietary <Prtry> Max35Text Code type, constant KPP.

Currency Operation Code (Code VO)

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
2.89 [0..10] +++RegulatoryReporting <RgltryRptg> Component
11.1.1 [0..1] ++++Authority <Authrty> Component Refers to information receiver (for example state institute that requested additional information about transaction).
11.1.3 [0..1] +++++Country <Ctry> CountryCode Country code - RU.
11.1.4 [0..n] ++++Details <Dtls> Component Accurate information on the regulatory requirements for the data.
11.1.5 [0..1] +++++Type <Tp> Max35Text Code type - VO. VO - currency operation code in case of Russia.
11.1.10 [0..1] +++++Code <Inf> Max35Text Currency operation code (5 digits).

Payment Status pain.002.001.03

Payment Status Content Description

The report contains two mandatory blocks: Header and information about original payment order batch.

Header: This block is indicated only once and contains file identification elements - payment identifier, message creation date and time, payment initiating party (representative).

Information about the original payment order: file from the client can contain one (or more) payment blocks, and client receives corresponding structure for status report.

The table describes message fields in the following format:

ISO Index No. Or. Mult. Message element <XML tag> ISO Type Comment about data in the field
[1..1] + Message root

ISO Index No. – Message element number. Number corresponds to ISO 20022 XML standard description, which may be found at www.iso20022.org under “Catalogue of ISO 20022 messages” with a reference to “pain.001.001.03”.

Or. – Indicates a choice possibility. One or the other element may be included in the message.

Mult. – Indicates if the element is mandatory and it’s occurrence. Possible values and their meanings:

Message element – Element name in accordance with ISO 20022 XML.

XML tag – XML tag of the corresponding element in the message.

ISO Type – XML tag content description.

Comment about data in the field – Additional comment about data in the field.

Message Elements

ISO Index No. Mult. Message element <XML tag> ISO Type Comment about data in the field
0.0 [1..1] CustomerPaymentStatusReport <CstmrPmtStsRpt>
1.0 [1..1] +GroupHeader <GrpHdr> Component Message information.
1.1 [1..1] ++MessageIdentification <MsgId> Max35Text Unique message identifier assigned by the creator.
1.2 [1..1] ++CreationDateTime <CreDtTm> ISODateTime Creation date and time (YYYY-MMDDThh:mm:ss, for example: 2012-11-21T09:10:49).
1.3 [1..1] ++InitiatingParty <InitgPty> Component Financial institution which holds the debit account (the bank, which will execute the payment).
9.1.12 [1..1] +++Identification <Id> Component
9.1.13 [1..1] ++++OrganisationIdentification <OrgId> Component
9.1.14 [1..1] +++++BICOrBEI <BICOrBEI> Identifier Bank BIC code.
2 [1..1] +OriginalGroupInformationAndStatus <OrgnlGrpInfAndSts> Component Information about the payment initiation message.
2.1 [1..1] ++OriginalMessageIdentification <OrgnlMsgId> Max35Text Payment order message identifier from pain.001.001 file.
2.2 [1..1] ++OriginalMessageNameIdentification <OrgnlMsgNmId> Max35Text Payment order message identifier scheme - pain.001.001.03.
2.6 [0..1] ++GroupStatus <GrpSts> TransactionGroupStatus3Code Status of all transactions. JSC “Rietumu Banka” uses the following codes: RJCT - if whole payment package was cancelled. PDNG - processing. PART - even if 1 payment is not yet complete. ACSC - all payments are processed.
2.7 [0..n] ++StatusReasonInformation <StsRsnInf> Component Information on transaction processing status.
2.9 [0..1] +++Reason <Rsn> Component
2.10 [1..1] ++++Code <Cd> ExternalStatusReason1Code
2.12 [0..n] +++AdditionalInformation <AddtlInf> Max105Text Textual information on the status.
3.0 [0..n] +OriginalPaymentInformationAndStatus <OrgnlPmtInfAndSts> Component Information about payment initiation packet.
3.1 [1..1] ++OriginalPaymentInformationIdentification <OrgnlPmtInfId> Max35Text The original payment batch identifier (<PmtInfId>).
3.15 [0..n] ++TransactionInformationAndStatus <TxInfAndSts> Component Information about the transaction.
3.17 [0..1] +++OriginalInstructionIdentification <OrgnlInstrId> Max35Text The original transaction identifier.
3.18 [0..1] +++OriginalEndtoEndIdentification <OrgnlEndToEndId> Max35Text The original transaction end-to-end identifier.
3.19 [0..1] +++TransactionStatus <TxSts> TransactionIndividualStatus3Code Transaction execution status. JSC “Rietumu Banka” uses the following codes: RJCT - payment cancelled. PDNG - payment is being processed. ACSC - payment complete.
3.20 [0..n] +++StatusReasonInformation <StsRsnInf> Component Information about transaction execution.
3.21 [0..1] +++Originator <Orgtr> Component
9.1.12 [0..1] ++++Identification <Id> Component
9.1.13 [1..1] +++++OrganisationIdentification <OrgId> Component
9.1.14 [1..1] ++++++BICorBEI <BICOrBEI> AnyBICIdentifier
3.22 [0..1] ++++Reason <Rsn> Component Transaction status reason code.
3.23 [1..1] +++++Code <Cd> ExternalStatusReason1Code Status codes are available at http://www.iso20022.org/External_Code_Lists_and_DSS.page External Code Lists spreadsheet. If status code is NARR, see AddtlInf of the element for more details.
3.25 [0..n] ++++AdditionalInformation <AddtlInf> Max105Text Textual information about transaction process and/or error message.
3.30 [0..1] +++AccountServicerReference <AcctSvcrRef> Max35Text Transaction reference number granted by Rietumu Bank.
3.32 [0..1] +++OriginalTransactionReference <OrgnlTxRef> Component Information for additional identification of the transaction.
3.34 [0..1] ++++Amount <Amt> Component
3.35 [1..1] +++++InstructedAmount <InstdAmt Ccy=“AAA”> Amount
3.41 [1..1] ++++RequestedExecutionDate <ReqdExctnDt> DateTime
3.121 [1..1] ++++Debtor <Dbtr> Component
9.1.0 [1..1] +++++Name <Nm> Text
3.122 [1..1] ++++DebtorAccount <DbtrAcct>
1.1.0 [1..1] +++++Identification <Id>
1.1.1 [1..1] ++++++IBAN <IBAN> Identifier
1.1.11 [1..1] +++++Currency <Ccy> Code
3.123 [1..1] ++++DebtorAgent <DbtrAgt>
6.1.0 [1..1] +++++FinancialInstitutionIdentification <FinInstnId>
6.1.1 [1..1] ++++++BIC <BIC> Identifier
3.125 [0..1] ++++CreditorAgent <CdtrAgt>
6.1.0 [1..1] +++++FinancialInstitutionIdentification <FinInstnId>
6.1.1 [1..1] ++++++BIC <BIC> Identifier
6.1.2 [1..1] ++++++ClearingSystemMemberIdentification <ClrSysMmbId>
6.1.3 [0..1] +++++++ClearingSystemIdentification <ClrSysId>
6.1.4 [1..1] ++++++++Code <Cd> Code
6.1.6 [1..1] +++++++MemberIdentification <MmbId> Text
3.127 [1..1] ++++Creditor <Cdtr>
9.1.0 [1..1] +++++Name <Nm> Text
3.128 [1..1] ++++CreditorAccount <CdtrAcct>
1.1.0 [1..1] +++++Identification <Id>
1.1.1 [1..1] ++++++IBAN <IBAN> Identifier
1.1.2 [1..1] ++++++Other <Othr>
1.1.3 [1..1] +++++++Identification <Id> Text