LogoLogo
Connect
Connect
  • 🏡Welcome to LHV Connect API
  • 📺News and Updates
    • 📈Performance and Stats
    • 🔔Notice of Change
  • 🧭Quick Start Guide
  • 🎥Connect Fundamentals
    • Authentication and Certificates
    • Environments
    • Messaging Pattern
    • Service Provider model
    • Technical limitations
    • Encoding and Languages
    • Response Compression
    • Dates and Time Zones
    • Response Codes and Error handling
    • Onboarding
    • Live Proving
    • LHV UK and Estonia integrations
    • FAQ and Tips
  • 📖Service Catalogue
    • 💚Heartbeat
      • Heartbeat - GET
      • Heartbeat Advanced - GET
    • 📩Messages Services
      • Get next message
      • Get list of messages
      • Get list of messages V2
      • Get message by response ID
      • Count number of messages
      • Mark message as processed
      • Mark batch of messages as processed
      • Mark batch of messages as processed V2
      • Messages Metadata
      • Get compressed message for testing
    • 💰Account Information Services
      • Account Balance
      • Account Statement
      • Transaction Notification
        • Incoming Bacs Credit Notification
    • 💸Payment Initiation Services
      • Pain.001.001.09
      • Pain.002.001.10
      • Samples
      • Authentication methods
      • Payment Scheme Selection
      • Payment Return Initiation
      • Payments Service Idempotency
      • Payments Originating Overseas
      • Legacy documents
        • pain.001.001.03 format
    • ✅Confirmation of Payee Services
      • Confirmation of Payee - Requester
      • Confirmation of Payee - Responder
    • 😶‍🌫️VIBAN Services
      • VIBAN Open
      • VIBAN Bulk Open
      • VIBAN Modify
      • VIBAN Info
      • VIBAN Close
      • VIBAN Notification
    • 🔗Indirect Scheme Access
      • Agency Account Synchronization
      • RTF - Routing Table Files message
      • 🧾Payment Collection Services
        • 💷Bacs Direct Debit
          • Bacs Direct Debit Mandate Initiation Request
          • Bacs Direct Debit Mandate Initiation Response
          • Bacs Direct Debit Mandate Initiation Response Confirmation
          • Bacs Direct Debit Mandate Cancellation Request
          • Bacs Direct Debit Mandate Cancellation Response
          • Direct Debit Incoming Collection Notification Request
          • Direct Debit Collection Notification Response
          • Direct Debit Collection Notification Response Confirmation
          • Direct Debit Reversal Notification Request
          • Examples
    • 📨Webhooks
      • Webhook Format and Processing
      • Managing Webhook Configurations
      • Webhook Security
      • Webhook Metadata
      • Full Bodied Webhooks
  • 🗓️Reference
    • Glossary
    • Code Reference Tables
      • Balance Type Codes
      • Credit and Debit Transaction Codes
      • Payment Scheme Codes
      • Direct Debit Scheme Codes
      • Payment Reject Codes
      • Payment Return Codes
      • Bacs Direct Debit Mandate Reject Codes
      • Bacs Direct Debit Reject Codes
      • Bacs Direct Debit Reversal Reason
      • Bank Transaction Codes
      • Transaction Purpose Codes
      • Category Purpose Codes
      • Private Person Identification Codes
      • Organisation Identification Type Codes
      • Payment Priority Codes
      • Charges Bearer Codes
  • ☎️Support
    • Contact
Powered by GitBook
On this page
  • Sample
  • Summary

Was this helpful?

  1. Service Catalogue
  2. Payment Initiation Services

Payments Service Idempotency

Idempotency is a crucial concept in payment processing systems to ensure that operations like fund transfers are not accidentally performed more than once. This is particularly important in scenarios where network issues, retries, or other uncertainties might lead to the same operation being requested multiple times. In the context of the LHV Connect API, idempotency helps in avoiding duplicate payments when the same request is inadvertently submitted more than once.

Idempotency and the PAIN.001 File

For the Payments service in LHV Connect, idempotency is managed using the MsgId (Message Identification) field in the PAIN.001 XML file. The PAIN.001 file is a standardized format used for initiating credit transfer payments. Here's how it works:

  • MsgId Field: The MsgId field is a unique identifier for each payment instruction. When a payment request is submitted, the system records the MsgId. If a subsequent request is made with the same MsgId, the system recognizes it as a duplicate and ignores the new request, ensuring that the payment is not processed more than once.

  • Uniqueness of MsgId: It is critical that the MsgId is unique for each new payment request. Reusing the same MsgId across different requests will trigger the idempotency check, causing the system to reject the duplicate request. Therefore, careful management of MsgId values is essential for avoiding unintentional rejections or processing errors.

  • Practical Example: Suppose a payment initiation request is sent with a MsgId of PAY-12345. If the payment process needs to be retried due to a timeout or any other issue, resending the request with the same MsgId (PAY-12345) will not result in a duplicate payment. The system will recognize this MsgId and ensure that only one payment is executed.

However, it does not prevent the processing of payments that have similar amounts, payment details, or other fields, as long as each request has a unique MsgId. This means that two payment requests with identical amounts, recipients, and dates can still be processed separately if their MsgId values differ. Therefore, while idempotency protects against accidental re-submission of the same transaction, it does not prevent intentional or unintentional creation of similar but distinct payments.

Sample

Sample of related PAIN.001 request and response where uniqueness check finds a duplicate message:

-- Check is done with MsgId = UNIQUE-1001 field
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
    <CstmrCdtTrfInitn>
        <GrpHdr>
            <MsgId>PAY-12345</MsgId>
            <CreDtTm>2024-08-21T10:00:00</CreDtTm>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>1000.00</CtrlSum>
            <InitgPty>
                <Nm>Sample Company</Nm>
            </InitgPty>
        </GrpHdr>
        <PmtInf>
            <PmtInfId>PAYMENT-001</PmtInfId>
            <PmtMtd>TRF</PmtMtd>
            <BtchBookg>false</BtchBookg>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>1000.00</CtrlSum>
            ...
            
-- Related Response message
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03">
    <CstmrPmtStsRpt>
        <GrpHdr>
            <MsgId>3000023259</MsgId>
            <CreDtTm>2024-08-21T10:00:00.409+01:00</CreDtTm>
            <InitgPty>
                <Id>
                    <OrgId>
                        <BICOrBEI>LHVBGB2LXXX</BICOrBEI>
                    </OrgId>
                </Id>
            </InitgPty>
        </GrpHdr>
        <OrgnlGrpInfAndSts>
            <OrgnlMsgId>PAY-12345</OrgnlMsgId>
            <OrgnlMsgNmId>pain.001.001.03</OrgnlMsgNmId>
            <GrpSts>RJCT</GrpSts>
            <StsRsnInf>
                <Rsn>
                    <Cd>NARR</Cd>
                </Rsn>
                <AddtlInf>Duplicate message.</AddtlInf>
            </StsRsnInf>
        </OrgnlGrpInfAndSts>
    </CstmrPmtStsRpt>
</Document>

Summary

Idempotency in the Payments service of LHV Connect is effectively managed through the MsgId field in the PAIN.001 file. This ensures that payment requests are processed exactly once, even if they are submitted multiple times, thereby safeguarding against duplicate transactions and ensuring the reliability of the payment process.

PreviousPayment Return InitiationNextPayments Originating Overseas

Last updated 8 months ago

Was this helpful?

📖
💸