CSQ Docs
    CSQ Docs
    CSQ API Doc
    • CSQ API Doc
    • Dummy Product Usage Guide
    • Prepaid
    • Vouchers
    • Get Dynamic Vouchers
      GET
    • Vouchers Purchase
      POST
    • Voucher Additional Data
      GET
    • Get Resolved Vouchers
      GET

      Vouchers Purchase

      POST
      /pre-paid/vouchers/purchase/{terminalId}/{operatorId}/{localReference}

      🎟️ 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#

      ParameterTypeDescription
      terminalIdstringID of the terminal performing the purchase
      operatorIdstringID of the voucher operator or provider
      localReferencestringUnique reference for this transaction (idempotent)

      πŸ“€ Request Body#

      Might include:

      πŸ“¦ Request Body Parameters#

      FieldTypeRequiredDescription
      amountToSendX100integer <int32>βœ… Yes†Amount to be sent, in cents (e.g. 5000 = 50.00). Mutually exclusive with destinationAmountX100.
      destinationAmountX100integer <int32>βœ… Yes†Amount the recipient should receive, in cents. Mutually exclusive with amountToSendX100.
      localDateTimestring <date-time>βœ… YesTimestamp of the transaction in ISO 8601 format. Use: {{ $date.isoTimestamp }}
      accountstring⚠️ DependsFinal customer identifier (e.g. MSISDN or meter number). Required if indicated in operator parameters.
      dynamicProductIdstring⚠️ DependsOnly used when purchasing dynamic vouchers. Required when Get Products response includes this field.
      receiverEmailstring❌ NoOptional email where the voucher should be sent.
      documentNumberstring❌ NoOptional national ID, tax ID, etc., depending on operator requirements.
      receiverMessagestring❌ NoMessage attached to the voucher, if supported by the provider.
      documentTypestring❌ NoType 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.
      If hasAdditionalData: true, you must call Voucher Additional Data
      For voucher flows involving delayed delivery (e.g., raffles), use Get Finished Vouchers to check the final status.

      Request

      Path Params

      Header Params

      Body Params application/json

      Example
      {
          "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

      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/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

      🟒200OK
      application/json
      Body

      Example
      {
          "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
      Previous
      Get Dynamic Vouchers
      Next
      Voucher Additional Data
      Built with