CSQ Docs
    CSQ Docs
    Dummy Product Usage Guide
    • CSQ API Doc
    • Dummy Product Usage Guide
    • Overview on Dummy Products
    • Top-Up Simulation
    • Voucher Purchase Simulation
    • Supermarket Vouchers Purchase Simulation
    • Bill Payment Simulation
    • Location-based products simulation

    Bill Payment Simulation

    ๐Ÿงพ Simulating Bill Payment with Dummy Products (OperatorId: 9992 & 9989)#

    This guide explains how to simulate bill payment flows using dummy products in the CSQ API. These products allow developers to test invoice queries, payment logic, and error handling โ€” without contacting real providers or executing actual transactions.

    ๐Ÿ“ฆ Dummy Products for Bill Payment#

    Product IDProduct NameBehavior Summary
    9992DummyBillsFull flow: invoice query + payment simulation
    9989DummyBills2Simplified flow: direct payment without invoice query

    ๐Ÿ” Simulation Flow#

    Product 9992 (Full Flow)#

    1.
    Get Parameters
    2.
    Query Pending Invoices
    3.
    Execute Payment

    Product 9989 (Simplified Flow)#

    1.
    Get Parameters
    2.
    Execute Payment (no invoice query)

    ๐Ÿ”น Step 1: Get Parameters#

    Method
    GET /bill-payment/parameters/{terminalId}/{operatorId}
    Use operatorId = 9992 or 9989
    Response Example
    {
      "rc": 0,
      "message": "OK",
      "front": [
        {
          "name": "account",
          "label": "Contract or Account Number",
          "type": "INPUT",
          "list": [],
          "minLength": 6,
          "maxLength": 12
        }
      ],
      "query": [
        "account"
      ],
      "pay": [
        "account"
      ]
    }
    โœ… The required field is account, which determines both the invoice type and the simulated payment result.

    ๐Ÿ”ธ Step 2: Query Pending Invoices (Only for 9992)#

    Method
    POST /bill-payment/invoices/{terminalId}/{operatorId}
    Payload Example
    [
      {
        "key": "account",
        "value": "123002"
      }
    ]
    

    ๐Ÿงช Siumlated Behavior Based on Last 3 Digits of account#

    Ends WithPayment TypeCustomer NameTransaction Code
    000OPENJames MayABC123XYZ2
    001DISCRETEJeremy ClarkABC123XYZ
    002TOTALRichard HammondABC123XYZ3
    OtherNo invoicesโ€”โ€”
    This step simulates invoice discovery and returns metadata in additionalData.

    ๐Ÿงช Example of Siumlated Behavior Based on Last 3 Digits of account#

    {
      "rc": 0,
      "message": "OK",
      "additionalData": [
        {
          "key": "customerName",
          "value": "Richard Hammond"
        },
        {
          "key": "transactionCode",
          "value": "ABC123XYZ3"
        }
      ],
      "pendingInvoices": 1,
      "amountToSendX100": 7000,
      "destinationAmountX100": 7000,
      "serviceFeeX100": 0,
      "totalAmountX100": 7000,
      "destinationCurrency": "EUR",
      "items": [
        {
          "amountToSendX100": 7000,
          "destinationAmountX100": 7000,
          "serviceFeeX100": 0,
          "totalAmountX100": 7000,
          "destinationCurrency": "EUR",
          "date": "2025-07-08",
          "expirationDate": "2025-08-08",
          "invoiceReference": "INV-XYZ-0003",
          "isElegible": true
        }
      ],
      "paymentType": "TOTAL"
    }

    ๐Ÿ“„ Explanation of isElegible and paymentType in Invoice Query Response#

    When simulating bill payments using dummy product 9992, the invoice query response provides two key fields that influence the logic of the payment flow: isElegible and paymentType. Here's what they mean and how to handle them in your integration:

    ๐ŸŸข isElegible#

    Location: Inside each element of the items[] array
    Type: boolean

    โœ… If isElegible: true#

    The invoice is valid and can be paid.
    Should be considered for payment submission in /bill-payment/payment.
    The UI may allow the user to confirm or proceed with this invoice.

    โŒ If isElegible: false#

    The invoice is not payable.
    Reasons may include expiration, invalid data, or provider restrictions (simulated).
    It should be displayed as unavailable and excluded from final payment.
    Example:
    "isElegible": true
    โ†’ Invoice is selectable and may be paid.

    ๐Ÿงพ paymentType#

    Location: Top-level field of the response
    Type: string

    Purpose#

    Defines the payment strategy required for the listed invoices. It determines how the frontend and backend should structure the payment flow.
    ValueMeaning
    "OPEN"Amount is flexible. Payment can be partial or undefined.
    "DISCRETE"Specific invoices must be selected individually and paid separately.
    "TOTAL"The entire balance must be paid in a single transaction.
    Example:
    "paymentType": "TOTAL"
    โ†’ The frontend should prompt payment of the full amount listed in amountToSendX100. Invoice deselection or partial payment is not allowed.

    ๐Ÿ’ก Integration Tip#

    Make sure your UI and validation logic interpret isElegible correctly:
    Disable checkbox or payment action if false.
    Display invoice metadata from additionalData for clarity.
    Adapt behavior based on paymentType:
    For OPEN, allow user to enter amount.
    For DISCRETE, show individual invoices.
    For TOTAL, display single pay button for full amount.
    Let me know if you want full examples for each paymentType or how to simulate multiple invoices within items[] ๐Ÿงพโœจ

    ๐Ÿ”ธ Step 3: Execute Payment#

    Method
    POST /bill-payment/payment/{terminalId}/{operatorId}/{localReference}
    Payload Example
    {
      "amountToSendX100": 7000,
      "localDateTime": "2025-07-08T10:00:00Z",
      "beneficiaryPhoneNumber": "+34600000000",
      "additionalData": [
        {
          "key": "account",
          "value": "123002"
        }
      ]
    }
    

    โœ… Payload Tips#

    This payload is designed for a bill payment simulation using dummy product 9992, where the paymentType determined during the invoice query was "TOTAL".

    ๐Ÿ” Key Behaviors#

    ๐Ÿ’ณ The full amount must be paid in a single transaction. No partial or selective payment is allowed.
    โœ… You should not include invoiceNumbers, since individual item selection is disabled.
    ๐Ÿ”’ The additionalData array contains the "account" as a key-value pair, which is required to identify the payment context:
    [
      {
        "key": "account",
        "value": "123002"
      }
    ]
    ๐Ÿ’ถ amountToSendX100 = 7000 โ†’ this simulates a payment of โ‚ฌ70.00
    โฐ localDateTime marks the timestamp of the simulated payment request:
    "localDateTime": "2025-07-08T10:00:00Z"

    This configuration ensures your system handles TOTAL-type payments correctly โ€” by enforcing full payment logic and suppressing invoice item selection. Let me know if you'd like example responses for approved or

    ๐Ÿ” Behavior Based on First Digit of account#

    Starts WithSimulated ResultDescription
    1โœ… ApprovedPayment accepted
    2โŒ DENIED_FROM_PROVIDERSimulated rejection
    3โš  TIMEOUT_OR_COMMUNICATIONSimulated network error
    Otherโ— SYSTEM_ERRORGeneric failure
    Example:
    account = "234567" โ†’ starts with 2 โ†’ triggers DENIED_FROM_PROVIDER

    ๐Ÿงช Test Scenarios Summary#

    Product IDAccount ValueInvoice TypePayment Result
    9992123000OPENApproved (starts with 1)
    9992456001DISCRETERejected (starts with 2)
    9992789002TOTALTimeout (starts with 3)
    9989345678โ€”Timeout (starts with 3)

    ๐Ÿง  Developer Notes#

    Always use Get Parameters to detect required fields dynamically.
    For 9992, invoice query is mandatory before payment.
    For 9989, payment can be executed directly.
    Use account suffix to simulate invoice type, and prefix to simulate payment result.
    Log and handle resultcode, resultmessage, and finalstatus in responses.

    Modified atย 2025-07-08 13:28:05
    Previous
    Supermarket Vouchers Purchase Simulation
    Next
    Location-based products simulation
    Built with