Skip to main content
Skip table of contents

Message Structure

Messages are written in JSON, they contain 3 sections:

Figure 8: PharmX Message Components

Figure 9: Who uses What Part of the Message

To direct messages at their intended audience, one must construct the message header with the correct destination details. Think of the message header as analogous to sending physical mail, and encoding the correct address and sender information on the envelope.

The second part is the payload or message body, which contains the information that the recipient requires. In the physical mail analogy, think of this as the document contained within the envelop.

The messages are statically validated by PharmX for completeness and reasonableness.

A typical (fairly length sample)
CODE
{
  "MessageId": "B0AF5655-C5A1-4713-8963-44362C0DEA33",
  "MessageType": "RetailTransaction",
  "InitiatingBusinessUnit": {
    "ID": "112.1",
    "Name": "SampleStore"
  },
  "OriginatingBusinessUnit": {
    "ID": "112",
    "Name": "SampleStore"
  },
  "DestinationBusinessUnit": {
    "ID": "113"
  },
  "NotifiedBusinessUnits": [
    {
      "ID": "113",
      "Name": "HeadOffice"
    }
  ],
  "RetailTransaction": {
    "CancelFlag": "false",
    "WorkstationID": "POS5",
    "BusinessUnit": {
      "ID": "120",
      "Name": "eStore"
    },
    "TillID": "22",
    "SequenceNumber": "4294967295",
    "BusinessDayDate": "2001-08-13",
    "BeginDateTime": "2001-08-13T09:03:00",
    "EndDateTime": "2001-08-13T09:05:00",
    "OperatorID": "John",
    "CurrencyCode": "USD",
    "ManagerApproval": "false",
    "ReceiptDateTime": "2001-08-13T09:04:32",
    "LineItem": [
      {
        "VoidFlag": "false",
        "SequenceNumber": "1",
        "BeginDateTime": "2001-09-16T09:04:00",
        "EndDateTime": "2001-09-16T09:04:03",
        "Sale": {
          "ItemType": "Stock",
          "ItemID": "CA7865",
          "AlternativeItemIDs": [
            {
              "Type": "UPI",
              "ID": "ABCD123"
            },
            {
              "Type": "UPC",
              "ID": "221341234"
            },
            {
              "Type": "HOID",
              "ID": "ZXY123"
            }
          ],
          "MerchandiseHierarchy": [
            {
              "Level": "Department",
              "Value": "Confectionary"
            },
            {
              "Level": "SubDepartment",
              "Value": "Chocolates"
            }
          ],
          "ItemNotOnFileFlag": "false",
          "Description": "4oz Dark Chocolate",
          "TaxIncludedInPriceFlag": "false",
          "UnitCostPrice": "1.23",
          "UnitListPrice": "1.79",
          "RegularSalesUnitPrice": "1.63",
          "InventoryValuePrice": "1.23",
          "ActualSalesUnitPrice": "1.63",
          "ExtendedAmount": "4.89",
          "DiscountAmount": "0.00",
          "ExtendedDiscountAmount": "4.89",
          "Quantity": "3"
        }
      },
      {
        "Tender": {
          "TenderType": "Cash",
          "TypeCode": "Sale",
          "Amount": "0.83",
          "TenderChange": {
            "Amount": "0.00"
          }
        },
        "SequenceNumber": "2"
      },
      {
        "Tender": {
          "TenderType": "CreditDebit",
          "TypeCode": "Sale",
          "Amount": "4.00",
          "CreditDebit": {
            "CardType": "Credit"
          }
        },
        "SequenceNumber": "3"
      }
    ],
    "Total": {
      "TotalType": "TransactionGrossAmount",
      "Amount": "4.89"
    }
  }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.