Voucher Purchase Simulation
π« Simulating Voucher Purchase and Token Retrieval Using Dummy Products
π¦ Dummy Products for Voucher Simulation
Product ID | Product Name | Behavior Summary |
---|---|---|
9991 | DummyPin | Returns a PIN with full additionalData |
9994 | DummyVoucherADTrue | Randomly 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. |
9995 | DummyVoucherADFalse | Always returns a simple PIN code and hasAdditionalData = true , which requires and additional query for retrievin the extra info. |
π Voucher Simulation Flow
1.
2.
3.
4.
hasAdditionalData = true
: Query Additional DataπΉ Step 1: Get Available Dummy Products
GET /pre-paid/vouchers/products/{terminalId}/{operatorId}
operatorId = 9991
, 9994
, or 9995
, althoug none of this products has a dynamic behaviour.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
POST /pre-paid/vouchers/purchase/{terminalId}/{operatorId}/{localReference}
{
"amountToSendX100": 500,
"localDateTime": "2025-07-08T10:00:00Z",
"account": "600000000"
}
account
SuffixEnds With | Response 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.
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.πΈ Step 3: Retrieve Additional Data
Voucher Additional Data
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 flaghasAdditionalData: true
. It allows clients to fetch the full content or presentation details of the voucher after it has been issued.
π Behavior in Dummy Products
operatorId | Behavior Summary |
---|---|
9991 | Returns additionalData directly with token, so there is no need to use this additional data query. Therefore you should not use this query method. |
9994 | Requires this step if hasAdditionalData = true , so you must first check hasAdditionalData value in the purchase response. |
9995 | Always requires this step to complete the flow . |
{
"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 stepshasAdditionalData
flag to simulate multi-step voucher flows
Modified atΒ 2025-07-08 13:50:15