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

    Voucher Purchase Simulation

    🎫 Simulating Voucher Purchase and Token Retrieval Using Dummy Products#

    This guide explains how to test the voucher flow using dummy products and the CSQ API's Prepaid Vouchers endpoints. It is designed for developers who want to safely simulate voucher purchases, token responses, and conditional queries without triggering real transactions or connecting to external providers.

    πŸ“¦ Dummy Products for Voucher Simulation#

    Product IDProduct NameBehavior Summary
    9991DummyPinReturns a PIN with full additionalData
    9994DummyVoucherADTrueRandomly returns extraInfo or hasAdditionalData = true, the latest requiring an additional query for retreiving the voucher code and information. Randomly, this additional query may return a 404 - not found result or a valid result.
    9995DummyVoucherADFalseAlways returns a simple PIN code and hasAdditionalData = true, which requires and additional query for retrievin the extra info.
    These dummy products help simulate different backend responses and conditional UI flows.

    πŸ” Voucher Simulation Flow#

    1.
    (Optional) Get Available Dummy Products
    2.
    Purchase Voucher
    3.
    Retrieve Token
    4.
    If hasAdditionalData = true: Query Additional Data

    πŸ”Ή Step 1: Get Available Dummy Products#

    Method
    GET /pre-paid/vouchers/products/{terminalId}/{operatorId}
    You can use operatorId = 9991, 9994, or 9995, althoug none of this products has a dynamic behaviour.
    Purpose
    Retrieves voucher definitions for the selected operator. This is typically used to populate a product list or validate which dummy product is enabled.
    βœ… No account or additional parameters are required β€” this endpoint is not tied to any user-specific input and operates independently of account context.

    πŸ”Έ Step 2: Simulate Voucher Purchase#

    Method
    POST /pre-paid/vouchers/purchase/{terminalId}/{operatorId}/{localReference}
    Payload Example
    {
      "amountToSendX100": 500,
      "localDateTime": "2025-07-08T10:00:00Z",
      "account": "600000000"
    }
    
    Dummy voucher Behavior Based on account Suffix
    Ends WithResponse Outcome
    000βœ… Purchase Success
    001❌ Error 971
    002❌ Error 990
    other❌ Error 991
    Tip: You can use real-looking phone numbers to drive specific results.
    ⚠️ Note:
    While dummy voucher products usually accept simplified payloads with just the account field, this isn’t guaranteed for real products. The actual structure and required fields can vary widely depending on the operator, country, or service type β€” including fields like receiverEmail, documentNumber, or dynamic product selections.
    βœ… To ensure correct integration, always follow the implementation guidance provided by the commercial and support teams, who will indicate the exact payload requirements for each product.

    πŸ”Έ Step 3: Retrieve Additional Data#

    Method
    Voucher Additional Data
    Purpose
    Fetches additional metadata linked to the voucher token received during purchase. This may include fields like expirationDate, instructions, or other product-specific attributes.
    ⚠️ Warning
    This endpoint should be called only if the purchase response includes the flag hasAdditionalData: true. It allows clients to fetch the full content or presentation details of the voucher after it has been issued.

    πŸ” Behavior in Dummy Products#

    operatorIdBehavior Summary
    9991Returns additionalData directly with token, so there is no need to use this additional data query. Therefore you should not use this query method.
    9994Requires this step if hasAdditionalData = true, so you must first check hasAdditionalDatavalue in the purchase response.
    9995Always requires this step to complete the flow .
    Example Response
    {
      "rc": 0,
      "items": [
        {
          "resultcode": 0,
          "resultmessage": "Voucher retrieved successfully",
          "redeemAccount": "james.may@example.com",
          "redeemInstructions": "Use this code at checkout on the partner site.",
          "redeemCode": "DUMMY-ABC-999",
          "expiration": "2025-12-31",
          "additionalData": {
            "provider": "DummyVouchers Ltd",
            "currency": "EUR",
            "productName": "Dummy Supermarket €10"
          }
        }
      ]
    }
    🧠 Use this step to populate confirmation screens or print-ready voucher details.

    🧠 Developer Notes#

    account suffix drives purchase outcome on dummy products.
    localReference must be consistent across steps
    Use the hasAdditionalData flag to simulate multi-step voucher flows
    Simulated errors help test retry, fallback, and UI behavior

    Modified atΒ 2025-07-08 13:50:15
    Previous
    Top-Up Simulation
    Next
    Supermarket Vouchers Purchase Simulation
    Built with