Payment Initiation Service Providers (PISP) are authorized to initiate a payment on behalf of the customer if they have given such permission.
Citadele API contains these endpoints:
Create payment initiation – allows initiating single SEPA payment
Get payment details – allows to get back transaction details of given payment
Get payment status – allows getting status of given payment
Funds confirmation – checks whether a specific amount is available at point of time of the request on a given account or card.
How to use payment initiation service
create payment initiation request
create payment initiation
curl --cert ./cert.pem \
-H "X-Request-ID: <random-UUID>" \
-H "TPP-Redirect-URI: <TPP-SUCCESS-URL-REDIRECT>" \
-H "TPP-Nok-Redirect-URI: <TPP-FAILURE-URL-REDIRECT>" \
-H "PSU-IP-Address: <IP-Address>" \
https://api.citadele.lv/psd2/v1/payments/sepa-credit-transfers \
-X POST \
-H "Content-Type: application/json" \
-d '{"creditorAccount":"LV59PARX00XXXXXXX0001","debtorAccount":"LV52PARX00XXXXXXX0001", "creditorName": "KRISTAPS PORZINĢIS", "instructedAmount": {"currency": "EUR", "amount": 19.99}, "creditorAddress": {"buildingNumber": "2a", "city": "Riga","country": "LV", "postalCode": "LV-10","street": "Republikas Laukums"}, "remittanceInformationUnstructured": "Payment for good cause"}')
}
In response you will receive:
Response
200 OK
{
"transactionStatus":null,
"paymentId":"f9fb461a52804c4ebe4377b80f5bd079",
"transactionFees":null,
"transactionFeeIndicator":null,
"scaMethods":null,
"chosenScaMethod":null,
"challengeData":null,
"_links":{
"scaRedirect":"https://online.citadele.lv/amai/startp.htm?jsessionid=route.amai-miranda-2&loc=LV&lang=EN&url=<TPP-SUCCESS-URL-REDIRECT>¬OkUrl=<TPP-FAILURE-URL-REDIRECT>&token=eyJhbGciOiJSUzUxMiJ9.eyJpc3MiOiJDb25zZW50TWFuYWdlciIsInN1YiI6InBheW1lbnQiLCJkYXRhIjp7ImVuZFRvRW5kSWRlbnRpZmljYXRpb24iOm51bGwsImRlYnRvckFjY291bnQiOiJMVjUyUEFSWDAwMTQ5NzUzMjAwMDEiLCJpbnN0cnVjdGVkQW1vdW50Ijp7ImN1cnJlbmN5IjoiRVVSIiwiYW1vdW50IjoiMS4xMSJ9LCJjcmVkaXRvckFjY291bnQiOiJMVjU5UEFSWDAwMjExMjk4MzAwMDEiLCJjcmVkaXRvckFnZW50IjpudWxsLCJjcmVkaXRvck5hbWUiOiJNT05UQSBQUklFRMSSTkEtU0VSR0lKRVZTS0EiLCJjcmVkaXRvckFkZHJlc3MiOnsic3RyZWV0IjoiUmVwdWJsaWthcyBMYXVrdW1zIiwiYnVpbGRpbmdOdW1iZXIiOiIyYSIsImNpdHkiOiJSaWdhIiwicG9zdGFsQ29kZSI6IkxWLTEwIiwiY291bnRyeSI6IkxWIn0sInJlbWl0dGFuY2VJbmZvcm1hdGlvblVuc3RydWN0dXJlZCI6IlBTRDIgdGVzdCBwYXltZW50IHRvIHdpZmUiLCJwYXltZW50SWQiOiJmOWZiNDYxYTUyODA0YzRlYmU0Mzc3YjgwZjViZDA3MyIsInRwcElkIjoiUFNET1AtVEVTVC1UUFAtNmNkYTdmZTAtYzE2YSIsInRwcE5hbWUiOiJTQU5EQk9YY2l0YWRlbGUuZnktcGFzaHV0In0sImlhdCI6MTU2ODEwNjUyOCwiZXhwIjoxNTY4MTA3NDI4fQ.aLhbaTVcPGDGH5HlQYcTczXqjD18GRVTMhPe0OuX2vJ6lpTQJWPb44-uvXvDi4o4eJwQaF20g3CyZ_7T0PBLv7Bc5YPp5M-D4zNKcuZTYnMRrUuDhDM6nssJ-iAlUSd2SiviU7Z2obTZapNhXygjBidGafaR1Q4_nlBnn-1R0BPLUlGPn-c-HmMUBjxP0yGSSDw0NtAS-69wZ-hCV6EO-RQmn7ZtDOOCrnwcVQ5CcXo6e9QdmkNT341RY049RayBJnBV2QSycVPX4K0Ie5nm3GytZlEj2Nq9Hb42YCx10zXSSAedkrVqgGQEuWT2YAnG6gexBDuA"
},
"psuMessage":null,
"tppMessages":null
}
Extract paymentId → it can be later used to check payment status and payment info
To proceed - redirect PSU to URL extracted from "_links.scaRedirect"
open url in browser → you will receive AMAI authorization window.
After entering valid login name and valid password and submiting the page → authorization screen will be shown.
It will ask for authorization code depending on device being used by PSU.
After that payment details will be prepared (with data supplied in init payment API call)
After tapping next → authorization screen will be shown
After successful payment PSU is redirected to <TPP-SUCCESS-URL-REDIRECT>
If payment is cancelled then user is redirected to <TPP-FAILURE-URL-REDIRECT>
After that it is possible to check payment status and payment info
Get payment status
curl --cert ./cert.pem \
-X GET \
"https://api.citadele.lv/psd2/v1/payments/f9fb461a52804c4ebe4377b80f5bd079/status" \
-H "Accept: application/json" \
-H "PSU-IP-Port: <PSU_IP>" \
-H "X-Request-ID: <random_UUID>"
Response:
Payment status
200 OK
{"transactionStatus":"ACSC"}
Payment info request:
payment info request
curl --cert ./cert.pem \
-X GET \
"https://api.citadele.lv/psd2/v1/payments/f9fb461a52804c4ebe4377b80f5bd079" \
-H "Accept: application/json" \
-H "PSU-IP-Port: <PSU-IP>" \
-H "X-Request-ID: <random_UUID>")
Response:
Payment info
200 OK
{
"endToEndIdentification":null,
"debtorAccount":{
"iban":"LV52PARX00XXXXXXX0001",
"currency":null
},
"instructedAmount":{
"currency":"EUR",
"amount":"1.11"
},
"creditorAccount":{
"iban":"LV59PARX00XXXXXXX0001",
"currency":null
},
"creditorAgent":null,
"creditorName":"KRISTAPS PORZIŅĢIS",
"creditorAddress":null,
"remittanceInformationUnstructured":null,
"transactionStatus":"ACSC"
}