Run in Apidog
ποΈ Purchase Voucher# Initiates the purchase of a digital voucher from a given provider or operator. This is the core method used in both standard and dynamic voucher flows. π Description# This endpoint allows clients to execute the purchase of a predefined or dynamically selected voucher. The voucher code may be returned immediately in the response, or become available later through the Voucher Additional Data endpoint. π₯ Path Parameters# Parameter Type Description terminalId
string ID of the terminal performing the purchase operatorId
string ID of the voucher operator or provider localReference
string Unique reference for this transaction (idempotent)
π€ Request Body# π¦ Request Body Parameters# Field Type Required Description amountToSendX100
integer <int32>
β
Yesβ Amount to be sent, in cents (e.g. 5000 = 50.00). Mutually exclusive with destinationAmountX100
. destinationAmountX100
integer <int32>
β
Yesβ Amount the recipient should receive, in cents. Mutually exclusive with amountToSendX100
. localDateTime
string <date-time>
β
Yes Timestamp of the transaction in ISO 8601 format. Use: {{ $date.isoTimestamp }}
account
string β οΈ Depends Final customer identifier (e.g. MSISDN or meter number). Required if indicated in operator parameters. dynamicProductId
string β οΈ Depends Only used when purchasing dynamic vouchers. Required when Get Products
response includes this field. receiverEmail
string β No Optional email where the voucher should be sent. documentNumber
string β No Optional national ID, tax ID, etc., depending on operator requirements. receiverMessage
string β No Message attached to the voucher, if supported by the provider. documentType
string β No Type of document provided in documentNumber
(e.g., DNI, Passport).
β
Success Response# voucherCode
: The issued voucher (if available immediately)
hasAdditionalData
: true
if additional content must be retrieved (e.g., QR, PDF, barcode)
Other metadata: brand, description, expiration date, etc.
π§ Notes# This is the main entry point for voucher issuance.
For voucher flows involving delayed delivery (e.g., raffles), use Get Finished Vouchers to check the final status. Request Body Params application/json
{
"amountToSendX100" : 0 ,
"destinationAmountX100" : 0 ,
"localDateTime" : "2019-08-24T14:15:22Z" ,
"account" : "string" ,
"dynamicProductId" : "string" ,
"receiverEmail" : "string" ,
"documentNumber" : "string" ,
"receiverMessage" : "string" ,
"documentType" : "PASSPORT"
}
Request Code Samples
curl --location --request POST 'https://evsb.csqworld.com/pre-paid/vouchers/purchase///123456789' \
--header 'U;' \
--header 'SH;' \
--header 'ST;' \
--header 'Content-Type: application/json' \
--data-raw '{
"amountToSendX100": 0,
"destinationAmountX100": 0,
"localDateTime": "2019-08-24T14:15:22Z",
"account": "string",
"dynamicProductId": "string",
"receiverEmail": "string",
"documentNumber": "string",
"receiverMessage": "string",
"documentType": "PASSPORT"
}'
Responses application/json Generate Code
{
"rc" : 0 ,
"items" : [
{
"finalstatus" : 0 ,
"resultcode" : "string" ,
"resultmessage" : "string" ,
"supplierreference" : "string" ,
"suppliertoken" : "string" ,
"extraInfo" : {
"resultcode" : 0 ,
"resultmessage" : "string" ,
"redeemAccount" : "string" ,
"redeemInstructions" : "string" ,
"redeemCode" : "string" ,
"expiration" : "string" ,
"additionalData" : { }
} ,
"hasAdditionalData" : true ,
"destinationcurrency" : "string" ,
"destinationamount" : 0
}
]
}
Modified atΒ 2025-07-28 20:17:08