1. Webhooks
  2. Purchases

There are two types of purchase payloads that are sent:

  • Data Sharing - sent if the webhook consumer qualifies for data sharing
  • No Data Sharing - sent if the webhook consumer does not qualify for data sharing

No data sharing payloads are sent, for example, for mall merchants with locations that have not yet opted into data sharing.

Payload Description

id
string

The ID of the purchase record in Thanx

user
hash

User information

merchant
hash

Merchant information

location
hash

Location information

purchased_at
string

Time the purchase was made in ISO8601-format

amount
decimal

The purchase amount

order
hash

The order information, if this purchase reflects an online order

products
array(string)

The list of products the user bought

{
  "purchase": {
    "id": "92b7b0dac4",
    "user": {
      "id": "weori235",
      "email": "bob@bob.com"
    },
    "merchant": {
      "id": "9a1f0772c9ac",
      "name": "Pizza Shack"
    },
    "location": {
      "id": "e7183da044",
      "name": "Pizza Shack 12",
      "street": "123 Pizza Lane",
      "city": "Smalltown",
      "state": "CA",
      "zip": "12345",
      "time_zone": "America/New_York",
      "latitude": "37.76271750294678",
      "longitude": "-122.42438230349147"
    },
    "purchased_at": "2020-01-01T20:00:00Z",
    "amount": 9.99,
    "order": {
      "id": "RTF234S",
      "provider": "OLO"
    },
    "products": ["Snickers", "Twix"]
  }
}