CSQ Docs
    CSQ Docs
    CSQ API Doc
    • CSQ API Doc
    • Dummy Product Usage Guide
    • Prepaid
    • Recharge
    • Get Parameters
      GET
    • Get Products
      GET
    • Purchase
      POST

      Purchase

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

      Key Considerations for Purchase Request Fields#

      When making a purchase request, it's important to determine which fields are required based on the product type and operator configuration. This is done by calling the Get Parameters method before performing the actual purchase.
      šŸ¤” Although the majority of prepaid products are mobile top-ups—making it seem like this step could be skipped—this isn't always the case. Therefore, we recommend being aware of this possibility and acting accordingly.
      šŸ’” Using the Get Parameters method ensures success and prevents future development needs in case of changes from providers by making your implementation resilient to changes.

      šŸ” How to Determine Required Fields#

      Before making a purchase, you should call the Get Parameters endpoint:
      Endpoint:
      GET /pre-paid/recharge/parameters/{terminalId}/{operatorId}
      This method will return a list of parameters required for the given operator and terminal. The response indicates whether the product is dynamic (dynamic: true) and provides the list of required fields in the parameters array.

      šŸ“Œ Field Guidelines#

      dynamicProductId#

      Use only if the product is dynamic, as indicated by the dynamic: true flag in the Get Parameters response.
      A product is dynamic if its details are obtained through the Get Products method.
      If the product is not dynamic, leave this field empty or exclude it from the request.

      receiverEmail and documentNumber#

      These fields are conditionally required, depending on the operator and product type.
      They will appear in the parameters list from the Get Parameters response when required.
      Always refer to this response to determine if receiverEmail or documentNumber must be included.

      šŸš€ Related Workflows#

      Standard Recharge Workflow (Non-Dynamic Products)#

      1.
      Purchase
      Recharge Purchase

      Dynamic Workflow (For Dynamic Products)#

      1.
      Get Products
      Get Products
      2.
      Purchase
      Recharge Purchase

      Make sure to always use the Get Parameters endpoint to verify which fields to send in your purchase request. This ensures compliance with operator-specific configurations and avoids unnecessary errors.

      Request

      Path Params
      terminalId
      integerĀ <int32>
      required
      operatorId
      integerĀ <int32>
      required
      localReference
      integerĀ <int32>
      required
      Header Params
      U
      stringĀ 
      required
      Default:
      {{U}}
      SH
      stringĀ 
      required
      Default:
      {{SH}}
      ST
      stringĀ 
      required
      Default:
      {{ST}}
      Body Params application/json
      amountToSendX100
      integerĀ <int32>Ā |Ā nullĀ 
      required
      (Required if used) Cannot be used together with destinationAmountX100.
      destinationAmountX100
      integerĀ <int32>Ā |Ā nullĀ 
      required
      (Required if used) Cannot be used together with amountToSendX100.
      localDateTime
      stringĀ <date-time>
      required
      account
      stringĀ 
      required
      dynamicProductId
      stringĀ Ā |Ā nullĀ 
      optional
      Only for dynamic workflow
      receiverEmail
      stringĀ Ā |Ā nullĀ 
      optional
      documentNumber
      stringĀ Ā |Ā nullĀ 
      optional
      Example
      {
          "amountToSendX100": 0,
          "destinationAmountX100": 0,
          "localDateTime": "2019-08-24T14:15:22Z",
          "account": "string",
          "dynamicProductId": "string",
          "receiverEmail": "string",
          "documentNumber": "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/pre-paid/recharge/purchase///' \
      --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"
      }'

      Responses

      🟢200OK
      application/json
      Body
      rc
      integerĀ <int32>
      optional
      items
      arrayĀ [object {6}]Ā 
      optional
      finalstatus
      integerĀ <int32>
      optional
      resultcode
      stringĀ 
      optional
      resultmessage
      stringĀ 
      optional
      supplierreference
      stringĀ 
      optional
      destinationcurrency
      stringĀ 
      optional
      destinationamount
      numberĀ 
      optional
      Example
      {
          "rc": 0,
          "items": [
              {
                  "finalstatus": 0,
                  "resultcode": "10",
                  "resultmessage": "OK",
                  "supplierreference": "1234567890",
                  "destinationcurrency": "DOP",
                  "destinationamount": 1
              }
          ]
      }
      Modified atĀ 2025-07-15 08:53:00
      Previous
      Get Products
      Built with