Вы находитесь на странице: 1из 42

Swedbank Gateway service description Version 3.

Revision history .................................................................................................................... 5 Introduction ......................................................................................................................... 6 Swedbank Gateway specification ......................................................................................... 6

Sending request data to the Bank............................................................................................ 7 PUT ..................................................................................................................................... 7 Receiving responses from Bank ............................................................................................... 7 GET ..................................................................................................................................... 7 DELETE ................................................................................................................................ 7 Cryptocraphy ........................................................................................................................ 7
SGW Exceptions and errors .................................................................................................. 9

Example error message .......................................................................................................... 9 Error codes used ................................................................................................................. 10 Troubleshooting .................................................................................................................. 13
Service Communication test .............................................................................................. 14

Service decription ................................................................................................................ 14 Example request XML........................................................................................................... 14 Description of fields in request XML ....................................................................................... 14 Example response XML ........................................................................................................ 14 Description of fields in response XML ..................................................................................... 14
Service Account Balance.................................................................................................. 15

Service decription ................................................................................................................ 15 Example request XML........................................................................................................... 15 Description of fields in request XML ....................................................................................... 15 Example response XML ........................................................................................................ 15 Description of fields in response XML ..................................................................................... 16
Service Payment .............................................................................................................. 17

Service description............................................................................................................... 17 Example request XML........................................................................................................... 17 Description of fields in request XML ....................................................................................... 19 Estonian domestic payment .................................................................................................. 19 Latvian domestic payment .................................................................................................... 19 Lithuanian domestic payment ............................................................................................... 20 Foreign payment ................................................................................................................. 21 Example response XML ........................................................................................................ 22
2

Description of fields in response XML ..................................................................................... 22


Service Account statement .............................................................................................. 23

Service description............................................................................................................... 23 Example request XML........................................................................................................... 23 Description of fields in request XML ....................................................................................... 23 Example response XML ........................................................................................................ 23 Description of fields in response XML ..................................................................................... 25
Service Exchange rates.................................................................................................... 26

Service description............................................................................................................... 26 Example request XML........................................................................................................... 26 Description of fields in request XML ....................................................................................... 26 Example response XML ........................................................................................................ 26 Description of fields in response XML ..................................................................................... 27
Service Currency exchange ............................................................................................. 28

Service description............................................................................................................... 28 Example request XML........................................................................................................... 28 Description of fields in request XML ....................................................................................... 28 Example response XML ........................................................................................................ 29 Description of fields in response XML ..................................................................................... 29
Service Alert on transactions........................................................................................... 30

Service description............................................................................................................... 30 Example request XML........................................................................................................... 30 Example response XML ........................................................................................................ 30 Description of fields in response XML ..................................................................................... 31
Service Regular statement .............................................................................................. 32

Service description............................................................................................................... 32 Example request XML........................................................................................................... 32 Example response XML ........................................................................................................ 32


Service Sending e-invoices .............................................................................................. 33

Service description............................................................................................................... 33 Example request XML........................................................................................................... 33 Description of fields in request XML ....................................................................................... 33 Example response XML ........................................................................................................ 33 Description of fields in response XML ..................................................................................... 34
Service e-invoices for customer ...................................................................................... 34

Service description............................................................................................................... 34
3

Example request XML........................................................................................................... 34 Example response XML ........................................................................................................ 34


Service direct debit payer agreement management ....................................................... 35

Service description............................................................................................................... 35 Example request XML........................................................................................................... 35 Description of fields in request XML ....................................................................................... 36 Example response XML ........................................................................................................ 36 Description of fields in response XML ..................................................................................... 37
Service direct debit payer agreement changes ............................................................... 38

Service description............................................................................................................... 38 Example request XML........................................................................................................... 38 Example response XML ........................................................................................................ 38 Description of fields in response XML ..................................................................................... 39
Service direct debit payment requests ............................................................................ 40

Service description............................................................................................................... 40 Example request XML........................................................................................................... 40 Description of fields in request XML ....................................................................................... 40 Example response XML ........................................................................................................ 41 Description of fields in response XML ..................................................................................... 42
Service POS raport delivery ............................................................................................. 42

Service description............................................................................................................... 42 Example request XML........................................................................................................... 42 Example response XML ........................................................................................................ 42

Revision history
Version 2.9 Changes Changed EE domestic payment fields: BeneficiaryName (length 70) Changed Foreign payment fields: BeneficiaryName (length 70) BeneficiaryAddress (length 70+optional) Details (length 140) Cost (comment) BalanceOfPaymentsCountry (comment) Changed LV domestic payment fields: BeneficiaryName (length 70) BeneficiaryBankCode (mandatory) Added new error codes Added more information to service specification EE payment document number (length) Foregin payment tag: BeneficiaryIBAN removed Added additional information about Active MQ in paragraph Service specification > More about message exchange and ACK: XML validation demand in paragraph HGW Exceptions and errors Lithuanian fields (OrderingParty/IBAN, OrderingParty/Name, Assignee/IBAN, Assignee/Name) are set to optional Re-Branding - Product name change HansaGateway Swedbank Gateway HGW SGW Incoming file name and request id must be unique Removed sample client information LT payment tag change: Assignee/IBAN =>Assignee/Account LT payment tag change: OrderingParty/IBAN =>Ordering/Account Foreign payment <cost> rule fix Major changes in communication protocol. Droping Active MQ and starting to use HTTP protocol. All communication parameters are changed. Added info about HTTP protocol at the pg 6. Added additional tag for LV in statements and alert - tag BIC Added info about troubleshooting Schema fixing Added beneficiary ID to Lithuanian local payments Removed EE domestic payment priority U not valid after 01.01.2011; foreign payment BalanceOfPaymentsCode is mandatory as from 50,000 EUR equivalent for EE Made by Mrt Arm Date 05.12.2008

2.10

Mrt Arm

11.12.2008

2.11

Mrt Arm

07.01.2009

2.12

Mrt Arm

27.01.2009

2.13

Mrt Arm

04.03.2009

2.14 2.15

Mrt Arm Mrt Arm

13.05.2009 07.07.2009

3.0

Mrt Arm

14.09.2009

3.1 3.2 3.3 3.4 3.5

Mrt Arm Mrt Arm Rain Pajur Rain Pajur Rain Pajur

09.11.2009 18.01.2010 30.03.2010 30.08.2010 03.01.2011

Introduction
Swedbank Gateway (SGW) is the data communications channel between client IS and Swedbank where client and bank exchange data in XML format. It operates 24 hours a day, which means that information is available regardless of what time you are working or need to access it. You can use the SGW channel if your software supports it or if you develop the required interface for your information system.

Swedbank Gateway specification


As above already mentioned, SGW is the data communication channel, where between Bank and client are exchanged Requests data and Response data. SGW using for communication standard HTTPS protocol with PUT, GET and DELETE requests methods. Client send to the bank data requests with HTTP request PUT. Client receives responses from bank by using HTTP request GET method. SGW address in production environment is https://swedbankgateway.net To be able to start using this service, customer has to fulfill following prerequisites: Swedbank Gateway service agreement Develop needed software for exchanging data between Client IS and Bank IS or using Bank sample lightweight SGW Client for communication. Successful testing results from Swedbank Gateway Sandbox environment.

Sending request data to the Bank PUT * Request body cdoc file * Header CorrelationID Client can set correlation ID, which helps connect request and response data. ID must be unique. * Response codes: 200 OK 500 Internal error Receiving responses from Bank Getting response data from bank consist from two steps: 1. with GET request will be received response data 2. with DELETE request must be send out confirmation that you received the response message. If during the 1 hour after GETting the response DELETE request server does not receive, then response message will be sent into responses queue again. GET There is`nt request parameters, only response will be received. * Body cdoc file * Header CorrelationID Client set CorrelationID with PUT request. * Header TrackingID Bank side message ID. * Response codes: 200 OK 400 Bad request 404 No messages 500 Internal error DELETE * Header TrackingID Bank side message ID * Response codes: 200 OK 400 Bad request. Most probably with current Tracking ID message not found 500 Internal error Cryptocraphy Whole cryptographic solution is build according to PKI crypto standard. Customer must remind it, when they are building their own client program. Swedbank Gateway is accepting only encrypted and signed DigDoc containing XML document with service-specific contents. Certificates must be trusted by Bank IS! Certificates what are involved in the process: * Client Communication Certificate * Transaction certificate * Bank certificate. DigiDoc We are using version 1.3 of the DigiDoc file format (.xsd can be found at this address http://www.sk.ee/file.php?id=266, description in .pdf form here http://www.sk.ee/file.php?id=267). Request DigiDoc itself has to be encrypted using Swedbanks public key (Recipient property of that EncryptedKey in DigiDoc has to be SGW it is possible to encrypt DigiDoc for several recipients and this rule lets us to choose correct encrypted transport key block for decryption). It also has to be signed by SGW agreement owner. Signed with Client Communication Certificate Private Key and incase of transactions, additionally with Transaction certificate with OCSP confirmation. Response is a crypted and signed DigiDoc or a plaintext XML with error details when request could not be processed. 7

Sending request files to Bank

Sign with Client Communication Certificate Private Key Incase of transactions - Sign additionally with Authorized Person Certificate Private Key + OCSP

Encrypt with Bank Public Key CDOC: Encrypted with Bank Public Key

DDOC: Signed container

DDOC: Signed container

Send to Bank

Request XML file

Request XML file

Request XML file

Receiving response files from Bank (except Alert service response)


Decrypt with Client Communication Certificate Private Key DDOC: Signed with Bank Certificate

CDOC: Encrypted with Client Communication Certificate Public Key DDOC: Signed with Bank Certificate

Verify Bank Signature

Receive from bank

Response XML file

Response XML file

Response XML file

Receiving Alert service response from Bank


Decrypt with Client Communication Certificate Private Key

CDOC: Encrypted with Client Communication Certificate Public Key

Receive Alert from bank Alert response XML file Alert response XML file

SGW Exceptions and errors


At first it is possible to get exceptions from message broker these will be of Exception class with plain-text message telling what exactly did not we like (we limit acceptable message content size, we require JMSReplyTo property to be set). And then there are cases when request can not be processed by processors - request XML does not pass validation, signer does not have access to given accounts, some service is disabled in bank to name some most probable reasons. If processor decides that trying later again will not help, it writes an error message in XML form into response queue. This response is not encrypted if we were not able to decrypt encrypted DigiDoc or did not find ERP certificate details from signed DigiDoc. Do avoid cases when customer side xml-s are not valid, bank strongly recommend before signing xml and sending to the bank, validate xml-s in client side. Validation XSD locations are described in the xml headers of hgw-response and SGW request files, but validation xsd-s also can be found from following links: https://www.swedbank.ee/hgw/valid/hgw.xsd https://www.swedbank.ee/hgw/valid/hgw-response.xsd

Example error message <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <HGWError> <Code>AccountNotAllowed</Code> <Message>You have no rights to these accounts through HGW agreement. </Message> </HGWError> </B4B>

Error codes used There might not listed all error codes and error description. We try to give our best to keep following list updated!

Error LimitsExceeded AccountNotAllowed FileValidatingError FileParsingError FileSizeOverLimit UnknownCertificate InvalidCurrency InvalidDigiDoc HGWProtocolError

Decription Limits Exceeded This account is not accessible through HGW agreements with given Client Communication Certificate. Input .xml can not be validated using our .xsd. Input .xml could not be digested we are validating before so this should be rare File is too large Certificate is unknown Currency is wrong We could not read input DigiDoc. We expect one and only one payload in DigiDoc. Whenever we have encountered something we can not be sure how to map, it will come out as a TechnicalError. Account number given in request .xml is not a valid IBAN (although it passed .xsd validation) Client Communication Certificate is not tied to any SGW agreements. Some of the parameters expected in request .xml are not valid. Payment RemitterAccount Not Given Payment To The Same Account Is Not Allowed Name Match Is Too Small Defective Beneficiary Data Missing Beneficiaries Missing Reference Number Invalid Reference Number Prefix Reference Number Too Long Reference Number Too Short Reference Number Cannot Contain Characters Non Standard Reference Number Non Standard Account Number Missing Details Or Reference Number Not An IBAN Account Number Invalid Remitter Account Beneficiary Name Too Long Missing Beneficiary Name Missing Amount Missing Beneficiary Address

TechnicalError

InvalidIBAN NoRights InvalidParameter paymentRemitterAccountNotGiven paymentToTheSameAccountIsNotAllowed nameMatchIsTooSmall defectiveBeneficiaryData missingBeneficiaries missingReferenceNumber invalidReferenceNumberPrefix referenceNumberTooLong referenceNumberTooShort referenceNumberCannotContainCharacters nonStandardReferenceNumber nonStandardAccountNumber missingDetailsOrReferenceNumber notAnIBANAccountNumber invalidRemitterAccount beneficiaryNameTooLong missingBeneficiaryName missingAmount missingBeneficiaryAddress 10

missingBeneficiaryAccount invalidBeneficiaryBank missingDetails missingValueDate invalidRemitterAccountNumber paymentAlreadySentToBank invalidSwiftFormatForBeneficiaryName invalidSwiftFormatForBeneficiaryAddress invalidSwiftFormatForBeneficiaryBankName invalidBeneficiaryAccountNumber invalidCorrespondentBankBIC invalidCorrespondentBankAccountNumber invalidSwiftFormatForDetails invalidSwiftFormatForCorrespondentBankName invalidSwiftFormatForCorrespondentAccountNumber invalidSwiftFormatForIntermediateBankName invalidSwiftFormatForIntermediateAccountNumber missingCorrespondentBankNameOrSWIFT missingIntermediateBankNameOrSWIFT missingBeneficiarySWIFT bothIntermediateAndCorrespondentBankInfoRequired invalidRemitterReferenceNumber remitterReferenceNumberTooLong missingCorrespondentBankNameAndAddress missingCorrespondentBankBIC invalidSwiftFormatForCorrespondentBankAddress invalidSwiftFormatForBeneficiaryBankAddress invalidSwiftFormatForInstructionDetails amountTooBig documentNumberMissing dateOfBirthIsMissing cityIsMissing countryIsMissing documentNumberContainsIllegalCharacters provinceContainsIllegalCharacters countryContainsIllegalCharacters beneficiaryCountryIsMissing beneficiaryAddressTooLong detailsTooLong paymentDataContainsInvalidCharacters RemitterIBAN InvalidRemitterIBAN BeneficiaryIBAN ReferenceNumber Details MissingDetails MissingDetailsOrReferenceNumber ValueDateFormat 11

Missing Beneficiary Account Invalid Beneficiary Bank Missing Details Missing Value Date Invalid Remitter Account Number Payment Already Sent ToBank Invalid Swift Format For Beneficiary Name Invalid Swift Format For Beneficiary Address Invalid Swift Format For Beneficiary Bank Name Iinvalid Beneficiary Account Number Invalid Correspondent Bank BIC Invalid Correspondent Bank Account Number Invalid Swift Format For Details Invalid Swift Format For Correspondent Bank Name Invalid Swift Format For Correspondent Account Number Invalid Swift Format For Intermediate Bank Name Invalid Swift Format For Intermediate Account Number Missing Correspondent Bank Name Or SWIFT Missing Intermediate Bank Name Or SWIFT Missing Beneficiary SWIFT Both Intermediate And Correspondent Bank Info Required Invalid Remitter Reference Number Remitter Reference Number Too Long Missing Correspondent Bank Name And Address Missing Correspondent Bank BIC Invalid Swift Format For Correspondent Bank Address Invalid Swift Format For Beneficiary Bank Address Invalid Swift Format For Instruction Details Amount Too Big Document Number Missing Date Of Birth Is Missing City Is Missing Country Is Missing Document Number Contains Illegal Characters Province Contains Illegal Characters Country Contains Illegal Characters Beneficiary Country Is Missing Beneficiary Address Too Long Details Too Long Payment Data Contains Invalid Characters Remitter IBAN is invalid! Remitter IBAN is invalid! Beneficiary IBAN is invalid! Reference number is invalid! Payment details or reference number must be set! Payment details are missing! Payment details or reference number must be set! Value date format is invalid!

ReferenceLV Amount BeneficiaryName Costs ValueDate Currency unknownAccount NoRights BeneficiaryBankCode dailyLimitExceeded monthlyLimitExceeded agreementLevelDailyLimitExceeded agreementLevelMonthlyLimitExceeded RemitterPaymentID BeneficiaryBankAccount BeneficiaryBankName AccountNotAllowed nameMatchIsTooSmall domesticPaymentCouldBeOnlyInLocalCurrency beneficiaryNameTooLong paymentToTheSameAccountIsNotAllowed ExchangeRateNotFound intrabankPaymentCannotBeUrgent incorrectFormatOrderingPartyId missingOrderingPartyName incorrectFormatAssigneeId missingAssigneeName invalidCurrency H0011 BeneficiaryAddress DocumentNumber ERR00006 ERR00057 missingBopCode balanceOfPaymentsCode BankCodeNotFound notAllowedRouteForAccount 6009 91 84 6100 6093 6094 NotEnoughFunds

Reference number is not supported in Latvia! Amount is missing or invalid! Beneficiary name is missing! Costs is incorrect! Invalid date! Invalid currency! ERP signature is not tied to any HGW agreements. Beneficiary bank code is invalid! Daily limit of mandate exceeded! Monthly limit of mandate exceeded! Daily limit of agreement exceeded! Monthly limit of agreement exceeded! Payment ID is missing! Beneficiary bank account is invalid! Beneficiary bank name is invalid! None of the signers can access this account! The account number and the name do not coincide! Only local currency is allowed for domestic payments! Beneficiary name is too long! Remitter and beneficiary accounts must be different! Currency not found! Intrabank payment cannot be urgent! Incorrect Ordering Party ID! Ordering party name is missing! Incorrect Assignee ID! Assignee name is missing! Invalid currency! DUPLICATE PAYMENT! You have already made a payment with the same data within 24 hours. Payment cancelled! Beneficiary address is missing! Document number is missing! Invalid currency! Balance of Payments code is missing! Balance of Payments code is missing! Balance of Payments code is missing! Bank code could not be found! Beneficiary's bank does not correspond to the beneficiary's account! Insufficient funds for transaction on the account! Operations are currently not permitted! Currency does not exist! Blocking of current account failed! Currency exchange is not permitted! Currency exchange is not permitted! Insufficient funds for transaction on the account!

12

Troubleshooting Incase of problems, for example if Customer system havent received responses from Bank side or there are some suspicious that some messages are lost or etc - incase You would like to track some messages or transactions. Then please forward to your agreed contact person in Bank, following data: Transport certificate name Filename When they sent message(file), time Account nr What answer customer received if any?

More information Bank gets for troubleshooting, then faster bank can answer or solve the issue!

13

Service Communication test


Service decription Client initiated query to receive a pong response to a ping request. Response is sent at first by message processor reading incoming message queue (Pong from attribute SGW) and then from each country where customer has an active agreement (EE/LT/LV). Value property from Ping request is returned with Pong response. Example request XML <?xml version="1.0" encoding="UTF-8"?> <Ping> <Value>Test</Value> </Ping> Description of fields in request XML Ping Ping/Value AN (0 210) Something that customer wants to be sent back. 1..1 0..1

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <Pong from="HGW"> <Value>Test</Value> </Pong> </B4B> Description of fields in response XML Pong Pong @ from Pong/Value A (3) AN (0 210) EE/LT/LV/SGW to show which processor responded. Value from Ping request. 1..* 1..1 1..1

14

Service Account Balance


Service decription Client initiated query to receive the balance of one specific account or all accounts listed in SGW agreement on a given time. Given time is the most up to date balance bank can send to customer. It is possible to ask balance for one specific account or for every account accessible through Swedbank Gateway agreement. If Account number is given in balance request, it has to correspond to IBAN standard. It is also possible to specify a date in the past, SGW returns end of day balances in that case. Message with AccountNotAllowed exception is returned if account requested is not listed in any of SGW agreements available for given Client Communication Certificate. If account number is omitted, there will be one response for each Swedbank branch where an SGW agreement is visible for given transport/ERP certificate combination. Example request XML <?xml version="1.0" encoding="UTF-8"?> <GetBalance> <IBAN>LT117300010000131196</IBAN> <Date>2007-08-20</Date> </GetBalance> Description of fields in request XML GetBalance GetBalance/IBAN GetBalance/Date AN (4 35) D Account number in IBAN format. Balance data. Defaulting to current day. 1..1 0..1 0..1

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <Balance> <Date>2007-08-20</Date> <AccountInfo> <IBAN>LT117300010000131196</IBAN> <BIC>HABALT2X</BIC> <BankName><![CDATA[AB bankas HANSABANKAS]]></BankName> </AccountInfo> <Currencies> <Currency id="LTL"> <Deposit>-301.07</Deposit> <Reserved>0.00</Reserved> <Credit>0.00</Credit> <Available>-301.07</Available> </Currency> <Currency id="USD"> <Deposit>-100.00</Deposit> <Reserved>0.00</Reserved> <Credit>0.00</Credit> <Available>-100.00</Available> </Currency> </Currencies> </Balance> </B4B> 15

Description of fields in response XML Balance Balance/Date D One Balance element for each account in response. Balance date. If none was given in request, banks operation date. One AccountInfo element in each Balance element. Account number Responding bank BIC code Responding bank name One Currencies element in each Balance element. One Currency element for each currency on given account. Currency code is returned as id attribute of Currency element. Account balance Total of reservations Overdraft limit Deposit Reserved + Credit 1..* 1..1

Balance/AccountInfo Balance/AccountInfo/IBAN Balance/AccountInfo/BIC Balance/AccountInfo/BankName Balance/Currencies Balance/Currencies/Currency Balance/Currencies/Currency/id Balance/Currencies/Currency/Deposit Balance/Currencies/Currency/Reserved Balance/Currencies/Currency/Credit Balance/Currencies/Currency/Available A (3) N N N N AN (4 - 35) AN (8) CDATA

1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 1..1 1..1 1..1

16

Service Payment
Service description Payment is a customer-initiated query. Customer can send one or more payments with one request (there are different payment formats for domestic and foreign payments and there are also countryspecific differences between estonian, latvian and lithuanian domestic payments. Like all other SGW services, payments are in one .xml file contained in crypted and signed digidoc. Swedbank responds with one or more status report as payments are being processed. Every SGW agreement has agreement-specific limits for payments (daily limit usage resets on every midnight, monthly limit usage on midnight with arrival of 1st of next month) and call-back limit that every payment is checked against. SGW agreement may have a list of users who are permitted to make transactions (operations like payment and currency exchange) with daily and monthly limits of their own. Limits are saved in agreement in local currency and payment amount is checked against them after being converted into local currency using central bank rate. Payment service requires that DigiDoc containing payments file is signed by Client Communication certificate and at least one user with transaction certificate. Client Communication certificate signature is used to locate the SGW agreement (as it is done with other services) while user signatures define users and their access rights to the accounts that payments are made from. If more than one user has signed payments then SGW will try to use limits of users ordered by signing timestamp and then signature location in DigiDoc. If first user does not have enough available limits, next users limit is checked and so on. If no user has enough available limit left for given payment, that payment will fail with error code showing whether it was daily limit or monthly limit that was not enough (daily limit is checked first). If payment amount exceeds over checking limit in agreement, payment will be made only after back-office employee has called and verified payment but limits (both daily and monthly limits for both user and agreement) are used during initial processing by SGW. Example request XML <?xml version="1.0" encoding="UTF-8"?> <B4B> <Payments> <DomesticPaymentEE> <ID>C1_D_EE_01</ID> <DocumentNumber>C1_D_EE_01</DocumentNumber> <ValueDate>2007-08-14</ValueDate> <Priority>N</Priority> <RemitterIBAN>EE352200221000127267</RemitterIBAN> <Amount>6.78</Amount> <Currency>EEK</Currency> <BeneficiaryIBAN>EE922200221010214144</BeneficiaryIBAN> <BeneficiaryName>U'NEILL</BeneficiaryName> <Details>B4B Estonian Domestic payment, Happy1 - 1</Details> <ReferenceNumber>7605262</ReferenceNumber> </DomesticPaymentEE> <DomesticPaymentLT> <ID>C1_D_LT_01</ID> <DocumentNumber>C1_D_LT_01</DocumentNumber> <ValueDate>2007-08-14</ValueDate> <Priority>N</Priority> <RemitterIBAN>LT257300010161511493</RemitterIBAN> <Amount>2.45</Amount> <Currency>LTL</Currency> <BeneficiaryIBAN>LT617300010071014501</BeneficiaryIBAN> <BeneficiaryName>KAL PVI</BeneficiaryName> <Details>B4B Lithuanin Domestic payment, Happy1 - 1</Details> 17

</DomesticPaymentLT> <DomesticPaymentLV> <ID>C1_D_LV_01</ID> <DocumentNumber>C1_D_LV_01</DocumentNumber> <ValueDate>2007-08-14</ValueDate> <Priority>N</Priority> <RemitterIBAN>LV35HABA0551000141298</RemitterIBAN> <Amount>1.24</Amount> <Currency>USD</Currency> <BeneficiaryIBAN>LV13UNLA0001001609573</BeneficiaryIBAN> <BeneficiaryName>Maris</BeneficiaryName> <Details>B4B Latvian Domestic payment, Happy1 - 1</Details> <BeneficiaryResidence>LV</BeneficiaryResidence> <BeneficiaryBankCode>UNLALV2X</BeneficiaryBankCode> </DomesticPaymentLV> <ForeignPayment> <ID>C1FLT01</ID> <DocumentNumber>1</DocumentNumber> <ValueDate>2007-08-14</ValueDate> <Priority>N</Priority> <RemitterIBAN>LT257300010161511493</RemitterIBAN> <Amount>6.31</Amount> <Currency>LTL</Currency> <DebitCurrency>USD</DebitCurrency> <BeneficiaryAddress>Peatnav 4 - 14, Tallinn, Eesti Vabariik</BeneficiaryAddress> <BeneficiaryName>Toomas Nipi</BeneficiaryName> <BeneficiaryResidence>LB</BeneficiaryResidence> <Details>B4B Lithuanian Foreign payment, Happy1 - 1</Details> <Costs>O</Costs> <BalanceOfPaymentsCode>200</BalanceOfPaymentsCode> <BalanceOfPaymentsCountry>EE</BalanceOfPaymentsCountry> <BeneficiaryBank> <Name>Hansabank</Name> <BIC>HABAEE2X</BIC> <Account>EE922200221010214144</Account> </BeneficiaryBank> </ForeignPayment> </Payments> </B4B>

18

Description of fields in request XML At the moment there are four different payment types supported by SGW. Payments Estonian domestic payment Payments/DomesticPaymentEE ID AN (1 - 50) Id of a payment. We suggest it to be unique in payment file. This value is not shown to beneficiary. Document number of payment shown to beneficiary. YYYY-MM-DD N = Normal Payer account number. Needs to be in IBAN format. Needs to be positive. . is used as decimal separator. Beneficiary account in IBAN format. Either details or number may be Either details or number may be reference missing. reference missing. 0..* 1..1 1..1

DocumentNumber ValueDate Priority RemitterIBAN Amount Currency BeneficiaryIBAN BeneficiaryName Details ReferenceNumber Latvian domestic payment Payments/DomesticPaymentLV ID

AN (1 8) D A (1) AN (4 - 35) N A (3) AN (4 35) AN (1 70) AN (0 300) AN (0 20)

1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1

AN (1 - 50)

DocumentNumber ValueDate Priority RemitterIBAN Amount Currency BeneficiaryIBAN BeneficiaryID BeneficiaryName Details BudgetCode BeneficiaryResidence BalanceOfPaymentsCode

AN (1 10) D A (1) AN (4 - 35) N A (3) AN (4 35) AN (1 15) AN (1 70) AN (0 300) N (0 10) A (2) N (3)

Id of a payment. We suggest it to be unique in payment file. This value is not shown to beneficiary. Document number of payment shown to beneficiary. YYYY-MM-DD N = Normal, U = Urgent Payer account number. Needs to be in IBAN format. Needs to be positive. . is used as decimal separator. Beneficiary account in IBAN format.

0..* 1..1

1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..1 1..1 1..1 0..1 1..1 0..1

BeneficiaryBankCode 19

AN (8 11)

Country code Mandatory from 1000 LVL (or equivalent) when latvian resident is paying to a nonresident. SWIFT

1..1

Lithuanian domestic payment Payments/DomesticPaymentLT ID AN (1 - 50) Id of a payment. We suggest it to be unique in payment file. This value is not shown to beneficiary. Document number of payment shown to beneficiary. YYYY-MM-DD N = Normal, U = Urgent. Payer account number. Needs to be in IBAN format. Needs to be positive. . is used as decimal separator. Beneficiary account in IBAN format. 0..* 1..1

DocumentNumber ValueDate Priority RemitterIBAN Amount Currency BeneficiaryIBAN BeneficiaryName Details ReferenceNumber ReferenceToPayer BeneficiaryRegistrationCode ReferenceToBeneficiary OrderingParty OrderingParty/Account OrderingParty/Id OrderingParty/Name Assignee Assignee/Account Assignee/Id Assignee/Name

AN (1 10) D A (1) AN (4 - 35) N A (3) AN (4 35) AN AN AN AN AN AN (1 (0 (0 (1 (1 (1 200) 300) 28) 16) 15) 16)

1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1 0..1

AN (4 35) AN (1 11) AN (1 140) AN (4 35) AN (1 11) AN (1 140)

20

Foreign payment Payments/ForeignPayment ID AN (1 - 50) Id of a payment. We suggest it to be unique in payment file. This value is not shown to beneficiary. Document number of payment shown to beneficiary. YYYY-MM-DD N = Normal, U = Urgent, E = Express. EE and LT (O = commission is paid by remitter, S = commission is shared between both parties) LV (O = commission is paid by remitter, B =commission is shared between parties Payer account number. Needs to be in IBAN format. Needs to be positive. . is used as decimal separator. 0..* 1..1

DocumentNumber ValueDate Priority Costs

AN (1 8) D A (1) A (1)

1..1 1..1 1..1 1..1

RemitterIBAN Amount Currency DebitCurrency BeneficiaryName Details BeneficiaryAddress BeneficiaryResidence BalanceOfPaymentsCode

AN (4-35) N A (3) A (3) AN (1 70) AN (1 140) AN (1 - 70) A (2) N (3)

1..1 1..1 1..1 1..1 1..1 1..1 0..1 1..1 0..1

BalanceOfPaymentsCountry BeneficiaryBank BeneficiaryBank/Name BeneficiaryBank/BIC BeneficiaryBank/Account CorrespondentBank CorrespondentBank/Name CorrespondentBank/BIC CorrespondentBank/Account IntermediaryBank IntermediaryBank/Name IntermediaryBank/BIC IntermediaryBank/Account

A (2)

Country code Mandatory as from 50,000 EUR equivalent for EE and from 1000 LVL equivalent for LV EE, LV:Conditional->; LT - not used Country code EE, LV:Conditional->; LT - not used

1..1 1..1 1..1 0..1 1..1 0..1 1..1 0..1 0..1 0..1 1..1 0..1 0..1

AN (1 - 140) AN (8 11) AN (4 35) AN (1 - 140) AN (8 11) AN (4 35) AN (1 - 140) AN (8 11) AN (4 35)

Large chars. only

21

Example response XML As above example has payments from three different countries (domestic payment in estonia, domestic payment in latvia, domestic payment and foreign payment in lithuania), there will be at least three responses to it (each country processes payments separately). If for some reason it is not possible to debit domestic payments during first processing (customer might not have had enough money on account, transactions were disabled in banking core or payments value date is later than banking day are most common reasons to it), domestic payment will be first put into processing state. There will be a separate status report about payment when it has been processed further. <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <PaymentStatus> <Payment id="C1_D_EE_01" status="processing"/> </PaymentStatus> </B4B> <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <PaymentStatus> <Payment id="C1_F_LT_01" status="processing"/> <Payment id="C1_D_LT_01" status="success" bankReference="2007081400034136"/> </PaymentStatus> </B4B> <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <PaymentStatus> <Payment id="C1_D_LV_01" status="failed" error="None of signers can access this account!"/> </PaymentStatus> </B4B> <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <PaymentStatus> <Payment id="C1_D_EE_01" status="success" bankReference="2007081400235531"/> </PaymentStatus> </B4B> Description of fields in response XML B4B/PaymentStatus PaymentStatus/Payment Payment @ id Payment @ status Payment @ bankReference Root element of status report Payment details Payment id assigned by remitter success/failed/processing state of payment For payment in success state Swedbank Gateway also reports reference to debiting operation. For payment in failed state Swedbank Gateway reports the reason of failure. 1..1 1..* 1..1 1..1 0..1

AN (1 - 50) A N (16)

Payment @ error 22

0..1

Service Account statement


Service description Customer can use this service to request a list of transactions on account in given period. Account statement is returned in one or more responses with one response containing up to 10 000 transaction records (this number may change in production environment). Statement/Partial elements value in response XML is used to show if this response is last part of statement or not (Complete means last part, Partial being the opposite). Example request XML <?xml version="1.0" encoding="UTF-8"?> <AccountStatement> <StartDate>2007-06-09</StartDate> <EndDate>2007-06-17</EndDate> <IBAN>EE392200221011508011</IBAN> </AccountStatement> Description of fields in request XML AccountStatement StartDate EndDate IBAN D D AN (4 35) Request validation will return error if StartDate is later than EndDate or missing. Request validation will return error is EndDate is later than previous day or missing. Account number 1..1 1..1 1..1 1..1

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <Statement> <AccountInfo> <IBAN>EE392200221011508011</IBAN> <BIC>HABAEE2X</BIC> <BankName><![CDATA[AS HANSAPANK]]></BankName> </AccountInfo> <Partial>complete</Partial> <Period> <StartDate>2007-06-09</StartDate> <EndDate>2007-06-17</EndDate> </Period> <Customer> <Name><![CDATA[AS LILLEKE]]></Name> <LegalID><![CDATA[10444444]]></LegalID> </Customer> <Currency id="EEK"> <OpeningBalance>45010.12</OpeningBalance> <ClosingBalance>35027.12</ClosingBalance> <Transactions> <Transaction> <TypeCode>MK</TypeCode> <TransactionDate>2007-06-14</TransactionDate> <ReferenceDate>2007-05-11</ReferenceDate> <BankReference>2007061400000190</BankReference> <DocumentNumber>4</DocumentNumber> <Description><![CDATA[test kik ok]]></Description> 23

<Amount>-1.00</Amount> <Counterparty> <Name><![CDATA[as lilleke]]></Name> <LegalID><![CDATA[]]></LegalID> <IBAN>EE482200221011515415</IBAN> </Counterparty> </Transaction> <Transaction> <TypeCode>TT</TypeCode> <TransactionDate>2007-06-14</TransactionDate> <BankReference>2007061400000190</BankReference> <Description><![CDATA[MK teenustasu]]></Description> <Amount>-2.00</Amount> <Counterparty> <Name><![CDATA[]]></Name> <LegalID><![CDATA[]]></LegalID> <IBAN></IBAN> </Counterparty> </Transaction> <Transaction> <TypeCode>X</TypeCode> <TransactionDate>2007-06-14</TransactionDate> <BankReference>2007061400000238</BankReference> <Description><![CDATA[VV: EEK -> EUR 636.74 kurss 15.6735]]></Description> <Amount>-9980.00</Amount> <Counterparty> <Name><![CDATA[]]></Name> <LegalID><![CDATA[]]></LegalID> <IBAN></IBAN> </Counterparty> </Transaction> </Transactions> </Currency> <Currency id="EUR"> <OpeningBalance>1023.23</OpeningBalance> <ClosingBalance>1659.97</ClosingBalance> <Transactions> <Transaction> <TypeCode>X</TypeCode> <TransactionDate>2007-06-14</TransactionDate> <BankReference>2007061400000238</BankReference> <Description><![CDATA[VV: EEK 9,980.00 -> EUR kurss 15.6735]]></Description> <Amount>636.74</Amount> <Counterparty> <Name><![CDATA[]]></Name> <LegalID><![CDATA[]]></LegalID> <IBAN></IBAN> </Counterparty> </Transaction> </Transactions> </Currency> <Currency id="USD"> <OpeningBalance>475.00</OpeningBalance> <ClosingBalance>475.00</ClosingBalance> <Transactions> </Transactions> </Currency> 24

Description of fields in response XML B4B/Statement AccountInfo AccountInfo/IBAN AccountInfo/BIC AccountInfo/BankName Partial Page Period Period/StartDate Period/EndDate Customer Customer/Name Customer/LegalID Currency Currency @ id Currency/OpeningBalance Currency/ClosingBalance Currency/Transactions Transactions/Transaction Transaction/TypeCode Transaction/TransactionDate Transaction/ReferenceDate Transaction/BankReference Transaction/DocumentNumber Transaction/ReferenceNumber Transaction/Description Transaction/Amount Transaction/ReferenceToPayer Transaction/Counterparty Counterparty/Name Counterparty/LegalID Counterparty/IBAN Counterparty/BIC Counterparty/ ReferenceToBeneficiary Transaction/OrderingParty A (3) N N Container element inside Statement/Currency AN (2) D D N (16) AN (1 30) AN (1 60) CDATA N AN (1 - 16) AN (4 35) AN (8) CDATA A D Container element inside B4B/Statement Account number Bank code of responding bank Name of responding bank Partial/Complete Container element inside B4B/Statement Start date from request End date from request Container element inside B4B/Statement Name of account owner Registration number of account owner Container element inside B4B/Statement Currency code is given in id attribute of Currency element 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 1..1 1..1 0..* 1..1 1..1 0..1 1..1 0..1 0..1 1..1 1..1 0..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1

D D

CDATA CDATA

Document date Payment document number Reference to beneficiary

Lithuanian-specific Container element inside Transactions/Transaction

CDATA CDATA AN (4 35) AN (1 - 16) Latvian specific Lithuanian-specific Container element inside Transactions/Transaction. Used for Lithuanian payments. AN (4 35) AN (1 11) AN (1 140) Container element inside Transactions/Transaction. Used for Lithuanian payments. AN (4 35)

OrderingParty/Account OrderingParty/Id OrderingParty/Name Transaction/Assignee

0..1 0..1 0..1 0..1

Assignee/Account 25

0..1

Assignee/Id Assignee/Name

AN (1 11) AN (1 140)

0..1 0..1

Service Exchange rates


Service description Customer can use this service to request currency exchange rates from different branches on Swedbank. HGW is providing currency rates for cash exchange (only current rate), local central bank (current rate and history) and currency exchange on account (current rate and history). It is possible to query rates for one, several or all rated currencies. SGWException is thrown if period requested is in future, past rates for cash exchange are requested or BIC of wrong bank is given. It is also possible that requested transaction type is not allowed for some of given currencies in which case SGWException is also thrown. Response data is ordered by currency code and rate date. In case of central bank rates (ExchangeRateType is Central in request XML), buy and sell rates for currency are same. Example request XML <?xml version="1.0" encoding="UTF-8"?> <ExchangeRateRequest> <BIC>HABAEE2X</BIC> <ExchangeRateType>Transfer</ExchangeRateType> <StartDate>2007-06-27</StartDate> <EndDate>2007-07-01</EndDate> <Currencies> <Currency>USD</Currency> <Currency>NOK</Currency> <Currency>EUR</Currency> </Currencies> </ExchangeRateRequest> Description of fields in request XML ExchangeRateRequest BIC AN (8) Root element of request document Code of bank that should respond (HABAEE2X for Estonian, HABALV2X for Latvian and HABALT2X for Lithuanian branch) Transfer/Cash/Central If not given, current banking day is used If not given, current banking day is used Container element for currencies listing. If not given, all allowed currencies are listed in response 1..1 1..1

ExchangeRateType StartDate EndDate Currencies Currencies/Currency

A D D

1..1 0..1 0..1 0..1 1..*

A (3)

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <ExchangeRateResponse> <BIC>HABAEE2X</BIC> <ExchangeRateType>Transfer</ExchangeRateType> <ExchangeRateInfo BaseCurrency="EEK"> <CurrencyInfo Date="2007-06-30"> <Currency>EUR</Currency> 26

<Buy>15.62000</Buy> <Sell>15.67350</Sell> </CurrencyInfo> <CurrencyInfo Date="2007-07-01"> <Currency>EUR</Currency> <Buy>15.62000</Buy> <Sell>15.67350</Sell> </CurrencyInfo> <CurrencyInfo Date="2007-06-30"> <Currency>NOK</Currency> <Buy>1.96000</Buy> <Sell>1.99200</Sell> </CurrencyInfo> <CurrencyInfo Date="2007-07-01"> <Currency>NOK</Currency> <Buy>1.96000</Buy> <Sell>1.99200</Sell> </CurrencyInfo> <CurrencyInfo Date="2007-06-30"> <Currency>USD</Currency> <Buy>12.25400</Buy> <Sell>12.48850</Sell> </CurrencyInfo> <CurrencyInfo Date="2007-07-01"> <Currency>USD</Currency> <Buy>12.25400</Buy> <Sell>12.48850</Sell> </CurrencyInfo> </ExchangeRateInfo> </ExchangeRateResponse> </B4B> Description of fields in response XML B4B/ExchangeRateResponse BIC ExchangeRateType ExchangeRateInfo ExchangeRateInfo @ BaseCurrency AN (8) A Container element for response Code of bank responding Transfer/Cash/Central Container element for currencies listing in ExchangeRateResponse element. Currency against what rates are given by bank is contained in BaseCurrency attribute. Container element for currency info in ExchangeRateInfo element Date parameter of CurrencyInfo element. Bank buys at this rate Bank sells at this rate 1..1 1..1 1..1 1..1 1..1

A (3)

CurrencyInfo CurrencyInfo @ Date CurrencyInfo/Currency CurrencyInfo/Buy CurrencyInfo/Sell D A (3) N N

0..* 1..1 1..1 1..1 1..1

27

Service Currency exchange


Service description Customer can use this service to perform currency exchange on given account. It is possible to specify worst acceptable rates for both currencies in currency exchange request and SGW will throw SGWException if any of rates offered by bank is not good enough to match them. SGW will also throw SGWException when there is not enough funds in sell currency on account or transactions are disabled in bank information system or BIC given is not of Swedbanks branch. Response contains rates used and bank reference code if currency exchange is performed successfully. Example request XML <?xml version="1.0" encoding="UTF-8"?> <CurrencyExchangeRequest> <BIC>HABAEE2X</BIC> <IBAN>EE922200221010214144</IBAN> <Buy> <Currency>USD</Currency> <Amount>2500</Amount> <Rate>11.50811</Rate> </Buy> <Sell> <Currency>EUR</Currency> <Rate>15.638</Rate> </Sell> </CurrencyExchangeRequest> Description of fields in request XML BIC AN (8) BIC of Swedbanks local branch (HABAEE2X for Estonian, HABALV2X for Latvian and HABALT2X for Lithuanian branch). Account number where currency exchange is performed. Currency that customer wishes to buy. Amount that customer wishes to buy. Has to be empty when sell amount is given, is calculated from sell amount then. When given, bank will perform exchange only if rate offered by bank is same or better than this. Currency that customer wishes to sell. Amount that customer wishes to sell. Has to be empty when buy amount is given and is calculated from buy amount then. When given, bank will perform exchange only if rate offered by bank is same or better than this. 1..1

IBAN Buy/Currency Buy/Amount

AN (4 35) A (3) N

1..1 1..1 0..1

Buy/Rate Sell/Currency Sell/Amount

N A (3) N

0..1 1..1 0..1

Sell/Rate

0..1

28

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <CurrencyExchangeResponse> <BIC>HABAEE2X</BIC> <IBAN>EE562200221008103199</IBAN> <BankReference>2007070200000195</BankReference> <Buy> <Currency>USD</Currency> <Amount>2500.00</Amount> <Rate>12.48850</Rate> </Buy> <Sell> <Currency>EUR</Currency> <Amount>1998.80</Amount> <Rate>15.62000</Rate> </Sell> </CurrencyExchangeResponse> </B4B> Description of fields in response XML B4B/CurrencyExchangeResponse BIC IBAN BankReference Buy/Currency Buy/Amount Buy/Rate Sell/Currency Sell/Amount Sell/Rate ExchangeRateType ExchangeRateInfo AN (8) AN (4 35) N (16) A (3) N N A (3) N N A Container element for response Code of bank responding Account number where currency exchange is performed. Bank reference for operation Currency that customer bought Amount that customer bought Currency that customer sold Amount that customer sold Transfer Container element for currencies listing in ExchangeRateResponse element. 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1

29

Service Alert on transactions


Service description It is possible for a customer to get a notification about every transaction that is done on a given account. This service has to be activated for every account through SGW agreement and customer can choose to be notified about incoming payments or outgoing payments. Important to mention is that alerts xmls are only encrypted. We do not add bank signature there. Please see schema above. For every transaction passing filter a message for each agreements client communication certificate. Message waiting pickup in queue 24h. After that message will be deleted from system. Example request XML There is none bank is generating these messages based on SGW agreement details. Example response XML It differs from statement response only by different container element (Alert instead of Statement) and missing statement-specific elements (Period, Partial and starting-ending balances for currency). <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <Alert> <AccountInfo> <IBAN>EE922200221010214144</IBAN> <BIC>HABAEE2X</BIC> <BankName><![CDATA[AS HANSAPANK]]></BankName> </AccountInfo> <Customer> <Name><![CDATA[GUID "KAL-RIK" U'NEILL]]></Name> <LegalID><![CDATA[3764444444]]></LegalID> </Customer> <Currency id="EEK"> <Transactions> <Transaction> <TypeCode>MK</TypeCode> <TransactionDate>2007-11-26</TransactionDate> <ReferenceDate>2007-11-26</ReferenceDate> <BankReference>2007112600000348</BankReference> <DocumentNumber>C1_D_EE_09</DocumentNumber> <ReferenceNumber>7605262</ReferenceNumber> <Description><![CDATA[B4B Estonian Domestic payment, value date 2007-08-20]]></Description> <Amount>-7.56</Amount> <Counterparty> <Name><![CDATA[Toomas Nipi]]></Name> <LegalID><![CDATA[]]></LegalID> <IBAN>EE352200221000127267</IBAN> </Counterparty> </Transaction> </Transactions> </Currency> </Alert> </B4B>

30

Description of fields in response XML B4B/Alert AccountInfo AccountInfo/IBAN AccountInfo/BIC AccountInfo/BankName Customer Customer/Name Customer/LegalID Currency Currency @ id Currency/Transactions Transactions/Transaction Transaction/TypeCode Transaction/TransactionDate Transaction/ReferenceDate Transaction/BankReference Transaction/DocumentNumber Transaction/ReferenceNumber Transaction/Description Transaction/Amount Transaction/ReferenceToPayer Transaction/Counterparty Counterparty/Name Counterparty/LegalID Counterparty/IBAN Counterparty/BIC Counterparty/ReferenceToBeneficiary Transaction/OrderingParty AN (2) D D N (16) AN (1 30) AN (1 60) CDATA N AN (1 - 16) A (3) AN (4 35) AN (8) CDATA Container element inside B4B/Alert Account number Bank code of responding bank Name of responding bank Container element inside B4B/Statement Name of account owner Registration number of account owner Container element inside B4B/Alert Currency code is given in id attribute of Currency element Container element inside Alert /Currency Container element inside Currency/Transactions 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 0..1 1..1 0..1 0..1 1..1 1..1 0..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1

CDATA CDATA

Document date Payment document number Reference to beneficiary

Lithuanian-specific Container element inside Transactions/Transaction

CDATA CDATA AN (4 35) AN (1 - 16) Latvian specific Lithuanian-specific Container element inside Transactions/Transaction. Used for lithuanian payments.

OrderingParty/Account OrderingParty/Id OrderingParty/Name Transaction/Assignee

AN (4 35) AN (1 11) AN (1 140) Container element inside Transactions/Transaction. Used for lithuanian payments. AN (4 35) AN (1 11) AN (1 140)

0..1 0..1 0..1 0..1

Assignee/Account Assignee/Id Assignee/Name

0..1 0..1 0..1

31

Service Regular statement


Service description It is possible for a customer to get an account statement automatically according to global schedule bank is using for all regular statements (This is once per day and bank will try to send it before midday). Statement will be generated for previous day from 00:00 until 24:00. If no transaction made on that day, empty statement will be generated. Every statement is crypted for client communication certificate tied to given SGW agreement. Example request XML There is none bank is generating these messages based on SGW agreement details. Example response XML Start date is either current banking day (for first statement) or day of the last operation in previous statement. End date is always current banking day. Otherwise it is just like an account statement. If there were no transactions since previous statements last operation, an empty statement is returned.

32

Service Sending e-invoices


Before using this service, it is important to know terms and conditions of e-invoicing service! Separate E-invoice seller agreement must in force. Service description SGW allows customers to send e-invoices to buyers. This service differs from other SGW services a little because it requires two .xml documents in DigiDoc container one that SGW uses to locate einvoice agreement for customer and other containing the actual e-invoices. SGW is sending that file to e-invoices processor and responds to customer with processing result. SGW is requiring that in case of several files in one DigiDoc container, one has to end with request.xml. That file is processed as SGW request .xml and validated against hgw.xsd. Example request XML <?xml version="1.0" encoding="UTF-8"?> <EinvoiceIncoming> <Filename>einvoices.xml </Filename> <CountryCode>EE</CountryCode> <ContractId>12345</ContractId> </EinvoiceIncoming> Description of fields in request XML Filename CountryCode ContractId AN A (2) AN Name of the payload file in DigiDoc container. Country code can be omitted if customer has SGW agreement in only one country. EE/LV/LT otherwise. E-invoice seller agreement number. 1..1 0..1 1..1

Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <ImportResult> <Statistics> <TotalCount>8</TotalCount> <DefectiveCount>2</DefectiveCount> </Statistics> <DefectiveInvoices> <Invoice invoiceId="2"> <Errors> <Error id="66"/> <Error id="33"/> </Errors> </Invoice> </DefectiveInvoices> </ImportResult> </B4B>

33

Description of fields in response XML B4B/ImportResult Statistics Statistics/TotalCount Statistics/DefectiveCount DefectiveInvoices Invoice Invoice @ invoiceId Invoice/Errors Errors/Error Error @ id AN N N Container element inside B4B/ImportResult Number of e-invoices found in payload .xml Number of e-invoices with errors. Container element inside B4B/ImportResult Container element for each defective e-invoice ID for defective invoice Container inside Invoice Element for error code for each error Error code used by e-invoice processor. 1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 1..* 1..1

Service e-invoices for customer


Service description Customer can choose SGW as a channel to receive e-invoices meant for him/her. SGW is periodically checking for unread e-invoices and sends their content .xml (without applying sellers style sheets) into customers transport queue crypted with customer ERP public key. Forwarded e-invoices are also marked as downloaded so they wont show as unread in other electronic channels (like telehansa.net). Example request XML There is none bank is generating these messages based on SGW agreement details. Example response XML This depends on e-invoice processing.

34

Service direct debit payer agreement management


Before using this service, it is important to know terms and conditions of Direct Debit service! Separate direct debit benifitary agreement must in force. Service description If customer is allowing his/her customers to make new and close existing direct debit payer agreements through his/her information system, we allow syncing this data through SGW. Example request XML <?xml version="1.0" encoding="utf-8"?> <DirectDebitAgreements> <Header> <CountryCode>EE</CountryCode> <BeneficiaryAgreement>12345</BeneficiaryAgreement> </Header> <Agreements> <Agreement> <SequenceNumber>1</SequenceNumber> <Operation>ADD</Operation> <Payer> <RegistrationNumber>37605265719</RegistrationNumber> <AccountNumber>EE082200001100701729</AccountNumber> <Name>Pvi</Name> </Payer> <Limit>1500.12</Limit> <CurrencyCode>EEK</CurrencyCode> <ReferenceNumber>123000123</ReferenceNumber> <Utility>654654</Utility> <Discount>456456</Discount> <DebitingPeriod> <From>12</From> <To>15</To> </DebitingPeriod> <AgreementValid> <From>2008-08-14</From> <To>2012-07-14</To> </AgreementValid> </Agreement> <Agreement> <SequenceNumber>2</SequenceNumber> <Operation>REMOVE</Operation> <Payer> <RegistrationNumber>3764444444</RegistrationNumber> <AccountNumber>EE082200001100701729</AccountNumber> <AgreementNumber>1</AgreementNumber> <Name>Pvi</Name> </Payer> <ReferenceNumber>123000123</ReferenceNumber> </Agreement> </Agreements> </DirectDebitAgreements>

35

Description of fields in request XML Header/BeneficiaryAgreement Header/CountryCode Agreements/Agreement Agreement/SequenceNumber Agreement/Operation Agreement/Payer Payer/Name Payer/AccountNumber Payer/AgreementNumber Payer/RegistrationNumber Agreement/Limit Agreement/CurrencyCode Agreement/ReferenceNumber Agreement/Utility Agreement/Discount Agreement/DebitingPeriod DebitingPeriod/From DebitingPeriod/To Agreement/AgreementValid AgreementValid/From AgreementValid/To Example response XML <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <DirectDebitImportResult> <Header> <CountryCode>EE</CountryCode> <BeneficiaryAgreement>12345</BeneficiaryAgreement> </Header> <Statistics> <TotalCount>2</TotalCount> <DefectiveCount>0</DefectiveCount> <RemovedCount>1</RemovedCount> <InsertedCount>1</InsertedCount> </Statistics> <Agreements> <Agreement recordId="2" operation="REMOVE"/> <Agreement recordId="1" operation="ADD" agreementNumber="65421"/> </Agreements> </DirectDebitImportResult> </B4B> 36 N N N (1 16) A (2) Direct debit beneficiary agreement number. Country code EE/LV/LT. Container element for each agreement add/remove request Agreement change id Operation code Container for payer agreement owner data Payer name Payer account number Payer agreement number (used for REMOVE operation) Payer registration number Payer agreemend debiting limit (used for ADD operation) Debiting limit currency (used for ADD operation in LV) Reference number for payer Utility code (used in LV for ADD operation) Discount code (used in LV for ADD operation) Container for debiting period, used for ADD operation First day of debiting period Last day of debiting period Container for agreement period, used for ADD operation. First date of period Last date of period 1..1 1..1 0..* 1..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1 1..1 0..1 0..1 0..1 1..1 1..1 0..1 1..1 1..1

N ADD/REMOVE

A (1 200) AN (1 35) N (1 16) A N A (3) AN (1 20) AN (0 300) AN (0 300)

D D

Description of fields in response XML B4B/DirectDebitImportResult Header/CountryCode Header/BeneficiaryAgreement Statistics/TotalCount Statistics/DefectiveCount Statistics/RemovedCount Statistics/InsertedCount Agreements/Agreement Agreement @ recordId Agreement @ operation Agreement @ agreementNumber Agreement/Errors Errors/Error Error @ id A (2) N (1 16) N N N N Country code Direct debit beneficiary agreement number. Total number of agreements processed by given processor Number of agreements that failed validation Number of agreements that were removed Number of bew agreements Container for every processed agreement Sequence number from request XML Operation code from request XML Agreement number for created payer agreement Container for errors for given agreement change operation Element for every error Error code 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 0..1 0..1 1..* 1..1

N ADD/REMOVE N (1 16)

37

Service direct debit payer agreement changes


Before using this service, it is important to know terms and conditions of Direct Debit service! Separate direct debit benifitary agreement must in force. Service description This service is used to notify customer about changed payer agreements for every direct debit beneficiary agreement. Example request XML There is none bank is generating these messages based on SGW agreement details. Example response XML This is inverse of previous service. So XML sent by bank has same structure as customers request in that service. Bank does not expect any response to these messages and responds with XML validation error if one is sent. <?xml version="1.0" encoding="utf-8"?> <DirectDebitAgreements> <Header> <CountryCode>EE</CountryCode> <BeneficiaryAgreement>12345</BeneficiaryAgreement> </Header> <Agreements> <Agreement> <SequenceNumber>1</SequenceNumber> <Operation>ADD</Operation> <Payer> <Name>Pvi</Name> <AccountNumber>EE082200001100701729</AccountNumber> <AgreementNumber>65421</AgreementNumber> <RegistrationNumber>3764444444</RegistrationNumber> </Payer> <Limit>1500.12</Limit> <CurrencyCode>EEK</CurrencyCode> <ReferenceNumber>123000123</ReferenceNumber> <Utility>654654</Utility> <Discount>456456</Discount> <DebitingPeriod> <From>12</From> <To>15</To> </DebitingPeriod> <AgreementValid> <From>2008-08-14</From> <To>2012-07-14</To> </AgreementValid> </Agreement> </Agreements> </DirectDebitAgreements>

38

Description of fields in response XML Header/BeneficiaryAgreement Header/CountryCode Agreements/Agreement Agreement/SequenceNumber Agreement/Operation Agreement/Payer Payer/Name Payer/AccountNumber Payer/AgreementNumber Payer/RegistrationNumber Agreement/Limit Agreement/CurrencyCode Agreement/ReferenceNumber Agreement/Utility Agreement/Discount Agreement/DebitingPeriod DebitingPeriod/From DebitingPeriod/To Agreement/AgreementValid AgreementValid/From AgreementValid/To N N N (1 16) A (2) Direct debit beneficiary agreement number. Country code EE/LV/LT. Container element for each agreement add/remove request Agreement change id Operation code Container for payer agreement owner data Payer name Payer account number Payer agreement number Payer registration number Payer agreemend debiting limit (used for ADD operation) Debiting limit currency (used for ADD operation in LV) Reference number for payer Utility code (used in LV for ADD operation) Discount code (used in LV for ADD operation) Container for debiting period, used for ADD operation First day of debiting period Last day of debiting period Container for agreement period, used for ADD operation. First date of period Last date of period 1..1 1..1 0..* 1..1 1..1 1..1 1..1 1..1 1..1 0..1 0..1 1..1 0..1 0..1 0..1 1..1 1..1 0..1 1..1 1..1

N ADD/REMOVE

A (1 200) AN (1 35) N (1 16) A N A (3) AN (1 20) AN (0 300) AN (0 300)

D D

39

Service direct debit payment requests


Before using this service, it is important to know terms and conditions of Direct Debit service! Separate direct debit benifitary agreement must in force. Service description This service allows customer to send payment requests to one or more payers with valid direct debit payer agreement. Although direct debit operation exists in all Baltic countries, local implementation differ so our XML has different requirements for each country. Example request XML <?xml version="1.0" encoding="UTF-8"?> <DirectDebit> <Header> <BeneficiaryAgreement>12345</BeneficiaryAgreement> <CountryCode>EE</CountryCode> </Header> <Payments> <Payment> <Description>Paymment description</Description> <Payer> <Name>Customer name</Name> <Agreement>54321</Agreement> </Payer> <PaymentDate>2008-08-12</PaymentDate> <Amount>341.12</Amount> <ReferenceNumber>123123</ReferenceNumber> </Payment> </Payments> </DirectDebit> Description of fields in request XML Header/BeneficiaryAgreement Header/CountryCode Payments/Payment Payment/Payer Payer/Name Payer/AccountNumber Payer/Agreement Payment/PaymentDate Payment/CurrencyCode Payment/Amount Payment/Description Payment/ReferenceNumber Payment/Utility Payment/Discount N (1 16) A (2) Direct debit beneficiary agreement number. Country code EE/LV/LT. Container element for each payment request Container element for payer data Name of the payer. Required in EE and LV. Account number of the payer. Required in LT. Direct debit payer agreement number. Required in EE and LT. Date of the payment. Required in EE and LV. Currency of payment. Required in LV. EE and LT always use local currency. Amount of payment. Description of payment Reference number of payer Utility code. Required in LV. Discount code. Required in LV. 1..1 1..1 0..* 1..1 0..1 0..1 0..1 0..1 0..1 1..1 0..1 1..1 0..1 0..1

AN (1 200) AN (1 35) N (1 16) D A (3) N AN AN AN AN

(0 (0 (0 (0

300) 20) 300) 300)

40

Example response XML Direct debit payment requests are processed a lot like payments initial validation is done by SGW processor that is forwarding valid payments to local processor splitting them into blocks of 100 payments (this number could change in production environment depending on SGW performance). Local processor is able to check payer agreement data (if reference number matches given payer, payer name is correct and so on) and stores valid requests into database. This two-tier processing also means that SGW responds with at least two messages one from SGW processor and another from local processor. If there were more payment requests than block size, then response from SGW processor contains statistics about all of them and local processor responds for each block it has processed. It is also possible that first response is sent by local processor (because SGW processor could be still processing large incoming message while local processor has finished its first block). Structure for response file is still the same: <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <DirectDebitPaymentsImportResult from="HGW"> <Header> <CountryCode>EE</CountryCode> <BeneficiaryAgreement>12345</BeneficiaryAgreement> </Header> <Statistics> <TotalCount>1</TotalCount> <DefectiveCount>0</DefectiveCount> </Statistics> <DefectivePayments> </DefectivePayments> </DirectDebitPaymentsImportResult> </B4B> <?xml version="1.0" encoding="UTF-8"?> <B4B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://hansagateway.net/valid/hgw-response.xsd"> <DirectDebitPaymentsImportResult from="EE"> <Header> <CountryCode>EE</CountryCode> <BeneficiaryAgreement>12345</BeneficiaryAgreement> </Header> <Statistics> <TotalCount>1</TotalCount> <DefectiveCount>1</DefectiveCount> </Statistics> <DefectivePayments> <Payment recordId="1"> <Errors> <Error id="nameMatchIsTooSmall"/> </Errors> </Payment> </DefectivePayments> </DirectDebitPaymentsImportResult> </B4B>

41

Description of fields in response XML B4B/DirectDebitPaymentsImportResult DirectDebitImportResult @ from Header/CountryCode Header/BeneficiaryAgreement Statistics/TotalCount Statistics/DefectiveCount DefectivePayments DefectivePayments/Payment Payment @ recordId Payment/Errors Errors/Error Error @ id A (2 - 3) A (2) N (1 16) N N Processor id HGW/EE/LV/LT Country code Direct debit beneficiary agreement number. Total number of payments processed by given processor Number of payments that failed validation by given processor. Container for defective payment listing Container for payment data Payment location in request file. Container for payment errors Element for error code Validation error code 1..1 1..1 1..1 1..1 1..1 1..1 1..1 0..* 1..1 1..1 1..* 1..1

Service POS raport delivery


Service description This service is used as delivery channel for POS raports from bank to customer. Example request XML There is none bank is generating these messages based on POS agreement and SGW agreement details. Example response XML Response XML is not generated by SGW server, therefore there is no example given. Please refer to POS report generator documentation about details.

42

Вам также может понравиться