CSQ Docs
    CSQ Docs
    CSQ API Doc
    • CSQ API Doc
    • Dummy Product Usage Guide
    • Back to home
    • Location-based Products
    • Get Labels
      GET
    • Get Countries
      GET
    • Get Categories
      GET
    • Get States
      GET
    • Get Municipalities
      GET
    • Get Deliver Locations
      GET
    • Get Products
      GET
    • Create Cart
      POST
    • Purchase
      POST
    • Get Orders
      GET
    • Get Order Status
      GET

      Purchase

      POST
      /physical-products/purchase/{terminalId}/{operatorId}/{localReference}
      This endpoint processes the payment for a previously created cart, completing the transaction. It is the final step in the location-based product flow.

      🔍 Description#

      Use this method to:
      Execute payment for the selected product previously added to the cart.
      Finalize the transaction and receive confirmation
      Retrieve supplier references and status codes
      📌 The cart must be valid and not expired. Only carts created via the corresponding Create Cart method are accepted.

      📥 Request Details#

      Method: POST
      Authentication: Required
      Path Parameters:
      terminalId (integer): ID of the requesting terminal
      operatorID (integer): ID of the operator provided in the Get Products response.
      localReference (integer): unique identifier for this transaction.
      Body Parameters:
      FieldTypeDescription
      amountToSendX100integerAmount to send, expressed in cents
      localDateTimestringTimestamp of the payment request in ISO 8601 format
      cartIdstringUnique identifier of the cart being paid

      Example Request#

      {
        "amountToSendX100": 5000,
        "localDateTime": "2025-07-07T14:05:00Z",
        "cartId": "123456"
      }

      📤 Response#

      Returns transaction confirmation results:
      FieldTypeDescription
      rcintegerGlobal result code (e.g., 0 for success)
      itemsarrayList containing transaction result objects
      items[].finalstatusintegerStatus code of the individual transaction (e.g., 0 = success)
      items[].resultcodestringInternal result code from the supplier
      items[].resultmessagestringHuman-readable confirmation message
      items[].supplierreferencestringExternal reference provided by the supplier
      items[].suppliertokenstringToken or unique ID from the supplier
      items[].destinationcurrencystringCurrency used in the transaction (e.g., EUR)
      items[].destinationamountintegerAmount delivered in the destination currency (in cents)

      Example Response#

      {
        "rc": 0,
        "items": [
          {
            "finalstatus": 0,
            "resultcode": "0",
            "resultmessage": "Payment successful",
            "supplierreference": "CSQ-REF-20250707-0001",
            "suppliertoken": "TXN-20250707-ABC123",
            "destinationcurrency": "EUR",
            "destinationamount": 5000
          }
        ]
      }

      🧠 Usage Notes#

      This method must be called after cart creation and before cart expiration.
      The amountToSendX100 must match the value used during cart creation.
      Use supplierreference and suppliertoken for reconciliation or support tracking.

      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>
      optional
      localDateTime
      string <date-time>
      optional
      cartId
      string 
      optional
      Example
      {
          "amountToSendX100": 0,
          "localDateTime": "2019-08-24T14:15:22Z",
          "cartId": "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/physical-products/purchase///' \
      --header 'U;' \
      --header 'SH;' \
      --header 'ST;' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "amountToSendX100": 0,
          "localDateTime": "2019-08-24T14:15:22Z",
          "cartId": "string"
      }'

      Responses

      🟢200OK
      application/json
      OK
      Body
      rc
      integer <int32>
      optional
      items
      array[object (SaleReceipt) {7}] 
      optional
      finalstatus
      integer <int32>
      optional
      resultcode
      string 
      optional
      resultmessage
      string 
      optional
      supplierreference
      string 
      optional
      suppliertoken
      string 
      optional
      destinationcurrency
      string 
      optional
      destinationamount
      number 
      optional
      Example
      {
          "rc": 0,
          "items": [
              {
                  "finalstatus": 0,
                  "resultcode": "string",
                  "resultmessage": "string",
                  "supplierreference": "string",
                  "suppliertoken": "string",
                  "destinationcurrency": "string",
                  "destinationamount": 0
              }
          ]
      }
      Modified at 2025-07-07 11:35:11
      Previous
      Create Cart
      Next
      Get Orders
      Built with