CSQ Docs
    CSQ Docs
    CSQ API Doc
    • CSQ API Doc
    • Dummy Product Usage Guide
    • Postpaid
    • Billpayment
    • Get Parameters
      GET
    • Get Invoices
      POST
    • Payment
      POST

      Get Invoices

      POST
      /post-paid/bill-payment/get-invoices/{terminalId}/{operatorId}
      postpaid-bill-payment-controller

      🧾 Get Pending Invoices – Invoice Lookup#

      This method allows clients to retrieve pending invoices or outstanding balances for a specific postpaid product. It is the second step in the invoice payment workflow and must be executed using the dynamic fields obtained from the Get Parameters method.

      🔍 Description#

      Once the required fields are known (via Step 1), this endpoint is used to:
      Validate the customer’s account or reference
      Retrieve the list of pending invoices or total debt
      Obtain dynamic values such as transaction_code, which are required for payment
      The response also includes the payment type, which determines how the client can proceed (e.g., full payment only, partial invoice selection, or open wallet-style payment).

      📥 Request#

      The request body must be an array of key-value pairs, where each key corresponds to a field name returned in the query array from Step 1.

      Example Request#

      [
        { "key": "card_code", "value": "1234567890" },
        { "key": "installments_to_pay", "value": "2" }
      ]

      📤 Response#

      The response includes key information needed to prepare the payment request:
      additionalData: Dynamic fields required for the payment step (e.g., transaction_code)
      type: Payment behavior (TOTAL, DISCRETE, or OPEN)
      pendingInvoices: Number of invoices found
      amountToSendX100, destinationAmountX100, serviceFeeX100, totalAmountX100: Amounts in cents

      Example Response#

      {
        "rc": 0,
        "message": "Pending invoices retrieved successfully",
        "additionalData": [
          {
            "key": "transaction_code",
            "value": "TXN-INV-20250703-A1"
          }
        ],
        "pendingInvoices": 2,
        "amountToSendX100": 12500,
        "destinationAmountX100": 12500,
        "serviceFeeX100": 0,
        "totalAmountX100": 12500,
        "destinationCurrency": "EUR",
        "items": [
          {
            "amountToSendX100": 6500,
            "destinationAmountX100": 6500,
            "serviceFeeX100": 0,
            "totalAmountX100": 6500,
            "destinationCurrency": "EUR",
            "date": "2025-06-01",
            "expirationDate": "2025-07-01",
            "invoiceReference": "INV-10004567",
            "isElegible": true
          },
          {
            "amountToSendX100": 6000,
            "destinationAmountX100": 6000,
            "serviceFeeX100": 0,
            "totalAmountX100": 6000,
            "destinationCurrency": "EUR",
            "date": "2025-06-15",
            "expirationDate": "2025-07-15",
            "invoiceReference": "INV-10004568",
            "isElegible": true
          }
        ],
        "paymentType": "TOTAL"
      }
      

      💡 Payment Type Reference#

      TypeDescription
      TOTALOnly full payment of the total debt is allowed
      DISCRETEAllows selection of individual invoices to pay
      OPENFlexible input: pay less, exact, or more than the amount owed (wallet mode)

      🧠 Usage Notes#

      This method must be called after retrieving the required fields via Get Parameters.
      The transaction_code included in additionalData is mandatory for the next step (Execute Payment).
      All monetary amounts are expressed in cents (e.g., 5000 = €50.00).
      The type field defines the payment strategy the client must respect during Step 3.
      📎 Continue to Step 3 – Execute Payment

      Request

      Path Params
      terminalId
      integer <int32>
      required
      operatorId
      integer <int32>
      required
      Header Params
      U
      string 
      required
      Default:
      {{U}}
      SH
      string 
      required
      Default:
      {{SH}}
      ST
      string 
      required
      Default:
      {{ST}}
      Body Params application/json
      array of:
      key
      string 
      optional
      value
      string 
      optional
      Example
      [
          {
              "key": "string",
              "value": "string"
          }
      ]

      Request samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://evsb.csqworld.com/post-paid/bill-payment/get-invoices//' \
      --header 'U;' \
      --header 'SH;' \
      --header 'ST;' \
      --header 'Content-Type: application/json' \
      --data-raw '[
          {
              "key": "string",
              "value": "string"
          }
      ]'

      Responses

      🟢200OK
      application/json
      OK
      Body
      rc
      integer <int32>
      optional
      message
      string 
      optional
      additionalData
      array[object (AdditionalDataDto) {2}] 
      optional
      key
      string 
      optional
      value
      string 
      optional
      pendingInvoices
      integer <int32>
      optional
      amountToSendX100
      integer <int32>
      optional
      destinationAmountX100
      integer <int32>
      optional
      serviceFeeX100
      integer <int32>
      optional
      totalAmountX100
      integer <int32>
      optional
      destinationCurrency
      string 
      optional
      items
      array[object (BillPaymentQuery) {9}] 
      optional
      amountToSendX100
      integer <int32>
      optional
      destinationAmountX100
      integer <int32>
      optional
      serviceFeeX100
      integer <int32>
      optional
      totalAmountX100
      integer <int32>
      optional
      destinationCurrency
      string 
      optional
      date
      string 
      optional
      expirationDate
      string 
      optional
      invoiceReference
      string 
      optional
      isElegible
      boolean 
      optional
      paymentType
      enum<string> 
      optional
      Allowed values:
      TOTALDISCRETEOPEN
      Example
      {
          "rc": 0,
          "message": "string",
          "additionalData": [
              {
                  "key": "string",
                  "value": "string"
              }
          ],
          "pendingInvoices": 0,
          "amountToSendX100": 0,
          "destinationAmountX100": 0,
          "serviceFeeX100": 0,
          "totalAmountX100": 0,
          "destinationCurrency": "string",
          "items": [
              {
                  "amountToSendX100": 0,
                  "destinationAmountX100": 0,
                  "serviceFeeX100": 0,
                  "totalAmountX100": 0,
                  "destinationCurrency": "string",
                  "date": "string",
                  "expirationDate": "string",
                  "invoiceReference": "string",
                  "isElegible": true
              }
          ],
          "paymentType": "TOTAL"
      }
      Modified at 2025-07-03 19:59:23
      Previous
      Get Parameters
      Next
      Payment
      Built with