Skip to main content

Post transaction data upon tender in real-time to CMC

To send real-time post-tender (post-purchase) transaction data to CMC, 2 endpoints need to be called in sequence:
  1. StartInteraction endpoint, get the sessionId from there
  2. Call SendTransaction endpoint with the received sessionId
post_transaction_SD.svg

StartInteraction

POST /Pos//startInteraction

Input request

{
  "terminalId": "string",
  "posLocationId": "string"
}

Input parameters

Field nameDescription
terminalIdID of the terminal on which the transaction was made*
posLocationIdID of the location where the transaction was made
*This Terminal ID must be added to a CFS Terminal in ClearLine

Response

{
  "data": {
    "terminalId": "string",
    "posLocationId": "string",
    "sessionId": "string",
    "posStatus": "Accepted"
  }
}

Response parameters

Field nameDescription
dataData block
terminalIdID of the terminal on which the transaction was made
posLocationIdID of the location where the transaction was made
sessionIdSession Id, call SendTransaction endpoint with the received sessionId
posStatusOnly “Accepted” POS can send a transaction (POS must be registered with CMC in order to use this endpoint)

SendTransaction

POST /Pos//transaction

Input request

{
  "sessionId": "string",
  "customer": {
    "id": "string",
    "firstName": "string",
    "lastName": "string",
    "birthDate": "2024-04-11T12:30:55.582Z",
    "contacts": [
      {
        "email": "string",
        "phone": "string"
      }
    ]
  },
  "salesPerson": {
    "id": "string",
    "firstName": "string",
    "lastName": "string"
  },
  "purchaseName": "string",
  "purchaseId": "string",
  "purchaseQuantity": 0,
  "purchasePrice": "string",
  "transactionId": "string",
  "transactionType": "Undefined",
  "transactionAmount": 0,
  "transactionDate": "2024-04-11T12:30:55.582Z",
  "terminalId": "string",
  "posLocationId": "string",
  "products": [
    {
      "productId": "string",
      "productName": "string",
      "manufacturer": "string",
      "productCategory": "string",
      "quantity": 0
    }
  ],
  "loyalty": {
    "cardNumber": "string"
  }
}

Input parameters

Field nameDescription
sessionIdSession ID form startInteraction endpoint
customer:Customer data block
IdCustomer id in third party system (POS)
firstNameCustomer first name
lastNameCustomer Last name
birthDateCustomer birthdate
contactsCustomer contacts data block
emailCustomer email
phoneCustomer phone
salesPersonSales person data block
IdSales person id in third party system (POS)
firstNameSales person first name
lastNameSales person Last name
purchaseNamedeprecated
purchaseIddeprecated
purchaseQuantitydeprecated
purchasePricedeprecated
transactionIdTransaction ID received from third party system (POS)
transactionTypeTransaction type (from third party system)
transactionAmountAmount of transaction
transactionDateTransaction date
terminalIdID of the terminal on which the transaction was made
posLocationIdID of the location where the transaction was made
productsProducts data block
productIdProduct ID from third party system (POS)
productNameProduct Name
manufacturerProduct manufacturer
productCategoryProduct category from
quantityNumber of products in the transaction (number of product identifiers)
cardNumberLoyalty card number

Response

{
  "data": {
    "id": "string",
    "qrCodeWidget": {
      "shortLinkUrl": "string",
      "qrCodeLinkUrl": "string",
      "qrCodeHtmlLinkUrl": "string",
      "notificationMessageId": "string",
      "profile": {
        "id": "string",
        "firstName": "string",
        "lastName": "string",
        "customerEmail": "string",
        "customerPhone": "string",
        "salesPerson": "string",
        "purchaseName": "string",
        "purchaseId": "string",
        "purchaseCategory": "string",
        "purchasePrice": "string",
        "gender": "string"
      }
    },
    "cfsTemplate": {
      "accountTemplateId": 0,
      "cfsCarouselUrl": "string"
    },
    "posStatus": "Accepted"
  }
}

Response parameters

Field nameDescription
dataData block
idInternal Transaction Id
qrCodeWidgetQR code widget data block (QR code is available if the POS Rule was triggered for this transaction)**
shortLinkUrlShort link url for QR code generation
qrCodeLinkUrlLink to the generated QR code image
qrCodeHtmlLinkUrlLink to the generated QR code in HTML format
qrCodePreviewLinkUrlLink to the generated QR code for Preview
notificationMessageIdRepresent an ID to identify the message sent via email or SMS channels
profileCustomer profile data block, Represent recipient profile
IdInternal Customer profile Id
firstNameCustomer first name
lastNameCustomer Last name
customerEmailCustomer email
customerPhoneCustomer phone
salesPersonSales person name
purchaseNamedeprecated
purchaseIddeprecated
purchaseCategorydeprecated
purchasePricedeprecated
genderCustomer gender
sessionIdSession ID with which the transaction was created
cfsTemplateCFS Template data block (CFS Template is available if the POS Rule was triggered for this transaction)**
accountTemplateIdId of Account level Template for CFS
cfsCarouselUrlUrl for Customer Facing screen (CFS)
posStatusPos Status, possible values: Accepted, Disabled
**If the POS Rule was triggered for this transaction, the response to the transaction POST may contain either a QR code or a CFS Template.

Response example

{
    "data": {
        "id": "661e83aa055b1e0001df1ace",
        "qrCodeWidget": {
            "shortLinkUrl": "[https://shorttest.clearline.me/0619-Zj1Eh?sessionId=ad90306d-dec4-4ded-986e-0b774b8eb9b5](https://shorttest.clearline.me/0619-Zj1Eh?sessionId=ad90306d-dec4-4ded-986e-0b774b8eb9b5)  ",
            "qrCodeLinkUrl": "[https://webtest.clearline.me:443/qrcode/Png?sizeType=Undefined&templateName=NORMAL&data=https%3A%2F%2Fshorttest.clearline.me%2F0619-Zj1Eh%3FsessionId%3Dad90306d-dec4-4ded-986e-0b774b8eb9b5&backgroundColor=%23F6F6FC&primaryText=Connect+with+our+smart+page+%26+see+all+our+marketing+offers+and+promotions+on+one+page.<br>+Scan+the+QR+Code+to+start.&secondaryText=SCAN+ME&hasFrame=True&primaryColor=%23190DB5&secondaryColor=%23740883&primaryTextColor=%23190DB5&secondaryTextColor=%23740883&logo=https%3A%2F%2Fstorage.googleapis.com%2Fclearline-test-images%2Fbrands%2F227%2Fe0150f94-b426-49e3-8df5-299781125b1d.png&width=300&height=300&hasPrintId=False&printId=0&hash=gujWO6EnV8Sqdd7bGuNlKu%2BXSihNt9eT1NNkx74Q2gY0twJjR711OFICI%2Ft0ubTZDXzTJTC%2BzXM294fJ0IcAC7n03fifFsbNnnovtVLInqHATkrV7W1IjnCPCC2S1Knat3UaCbpzaTAHY5ChQIWHm5MccQvLFOvOuugOwQWb1HaarrfErN14twmLtHmwr8Geh4ZBwL31HGHJDA18Vd5Dxr5VGLWTdS2ZEHl1cKp%2FzlN%2F%2FQID%2FtfdxDs0x%2F%2BqxQuvyXhdbDy%2BSnArk77svelUpvx%2F4zO%2FKklDjOeNwyY6d92lLkqNMeK7XiBBw1gIni9cIy2LPNq%2B4KLByr4bw8%2FzGw%3D%3D](https://webtest.clearline.me/qrcode/Png?sizeType=Undefined&templateName=NORMAL&data=https://shorttest.clearline.me/0619-Zj1Eh?sessionId=ad90306d-dec4-4ded-986e-0b774b8eb9b5&backgroundColor=#F6F6FC&primaryText=Connect+with+our+smart+page+&+see+all+our+marketing+offers+and+promotions+on+one+page.<br>+Scan+the+QR+Code+to+start.&secondaryText=SCAN+ME&hasFrame=True&primaryColor=#190DB5&secondaryColor=#740883&primaryTextColor=#190DB5&secondaryTextColor=#740883&logo=https://storage.googleapis.com/clearline-test-images/brands/227/e0150f94-b426-49e3-8df5-299781125b1d.png&width=300&height=300&hasPrintId=False&printId=0&hash=gujWO6EnV8Sqdd7bGuNlKu+XSihNt9eT1NNkx74Q2gY0twJjR711OFICI/t0ubTZDXzTJTC+zXM294fJ0IcAC7n03fifFsbNnnovtVLInqHATkrV7W1IjnCPCC2S1Knat3UaCbpzaTAHY5ChQIWHm5MccQvLFOvOuugOwQWb1HaarrfErN14twmLtHmwr8Geh4ZBwL31HGHJDA18Vd5Dxr5VGLWTdS2ZEHl1cKp/zlN//QID/tfdxDs0x/+qxQuvyXhdbDy+SnArk77svelUpvx/4zO/KklDjOeNwyY6d92lLkqNMeK7XiBBw1gIni9cIy2LPNq+4KLByr4bw8/zGw==)",
            "qrCodeHtmlLinkUrl": "[https://webtest.clearline.me:443/qrcode/Html?sizeType=Undefined&templateName=NORMAL&data=https%3A%2F%2Fshorttest.clearline.me%2F0619-Zj1Eh%3FsessionId%3Dad90306d-dec4-4ded-986e-0b774b8eb9b5&backgroundColor=%23F6F6FC&primaryText=Connect+with+our+smart+page+%26+see+all+our+marketing+offers+and+promotions+on+one+page.<br>+Scan+the+QR+Code+to+start.&secondaryText=SCAN+ME&hasFrame=True&primaryColor=%23190DB5&secondaryColor=%23740883&primaryTextColor=%23190DB5&secondaryTextColor=%23740883&logo=https%3A%2F%2Fstorage.googleapis.com%2Fclearline-test-images%2Fbrands%2F227%2Fe0150f94-b426-49e3-8df5-299781125b1d.png&width=300&height=300&hasPrintId=False&printId=0&hash=gujWO6EnV8Sqdd7bGuNlKu%2BXSihNt9eT1NNkx74Q2gY0twJjR711OFICI%2Ft0ubTZDXzTJTC%2BzXM294fJ0IcAC7n03fifFsbNnnovtVLInqHATkrV7W1IjnCPCC2S1Knat3UaCbpzaTAHY5ChQIWHm5MccQvLFOvOuugOwQWb1HaarrfErN14twmLtHmwr8Geh4ZBwL31HGHJDA18Vd5Dxr5VGLWTdS2ZEHl1cKp%2FzlN%2F%2FQID%2FtfdxDs0x%2F%2BqxQuvyXhdbDy%2BSnArk77svelUpvx%2F4zO%2FKklDjOeNwyY6d92lLkqNMeK7XiBBw1gIni9cIy2LPNq%2B4KLByr4bw8%2FzGw%3D%3D](https://webtest.clearline.me/qrcode/Html?sizeType=Undefined&templateName=NORMAL&data=https://shorttest.clearline.me/0619-Zj1Eh?sessionId=ad90306d-dec4-4ded-986e-0b774b8eb9b5&backgroundColor=#F6F6FC&primaryText=Connect+with+our+smart+page+&+see+all+our+marketing+offers+and+promotions+on+one+page.<br>+Scan+the+QR+Code+to+start.&secondaryText=SCAN+ME&hasFrame=True&primaryColor=#190DB5&secondaryColor=#740883&primaryTextColor=#190DB5&secondaryTextColor=#740883&logo=https://storage.googleapis.com/clearline-test-images/brands/227/e0150f94-b426-49e3-8df5-299781125b1d.png&width=300&height=300&hasPrintId=False&printId=0&hash=gujWO6EnV8Sqdd7bGuNlKu+XSihNt9eT1NNkx74Q2gY0twJjR711OFICI/t0ubTZDXzTJTC+zXM294fJ0IcAC7n03fifFsbNnnovtVLInqHATkrV7W1IjnCPCC2S1Knat3UaCbpzaTAHY5ChQIWHm5MccQvLFOvOuugOwQWb1HaarrfErN14twmLtHmwr8Geh4ZBwL31HGHJDA18Vd5Dxr5VGLWTdS2ZEHl1cKp/zlN//QID/tfdxDs0x/+qxQuvyXhdbDy+SnArk77svelUpvx/4zO/KklDjOeNwyY6d92lLkqNMeK7XiBBw1gIni9cIy2LPNq+4KLByr4bw8/zGw==)",
            "qrCodePreviewLinkUrl": null,
            "notificationMessageId": null,
            "profile": {
                "id": "643692fe562d480001b5a750",
                "firstName": "Philip",
                "lastName": "Moriss",
                "customerEmail": "[mailto:emmail@data.com](mailto:emmail@data.com)",
                "customerPhone": "+13800522333",
                "salesPerson": null,
                "purchaseName": null,
                "purchaseId": null,
                "purchaseCategory": null,
                "purchasePrice": null,
                "gender": "False"
            },
            "sessionId": null
        },
        "cfsTemplate": {
            "accountTemplateId": 0,
            "cfsCarouselUrl": null
        },
        "posStatus": "Accepted"
    }
}