Airship Developers
HomeAcademy
  • Welcome
  • Rest API
    • Overview
    • Authentication
    • API Reference
    • Accreditation
  • Basics
    • Contacts
      • Write a contact
      • Append feedback
      • Append purchase history
      • Append booking data
      • Append WiFi data
      • Append Stay data
      • Append Loyalty data
      • Append ticket data
      • Append other PoPs
    • Bookings
      • Booking Search by reference
      • Booking Search by data_element
      • Booking Update
    • Search Contact
      • Search PoPs by contact
      • Search contact by Email, Mobile, Name
      • Search contact by voucher
    • Vouchers
      • Redeem voucher code
      • Check voucher code
      • Create Unique Code Group
    • Anonymous purchase data
      • Add anonymous purchase data
    • Units
    • Postman collection
  • SOAP API (legacy)
    • Overview
Powered by GitBook
On this page
  • Overview
  • Storing purchase history
  1. Basics
  2. Contacts

Append purchase history

Store transactional purchase history as you send contact data to us

Overview

Airship can store full purchase history for contact records.

This is useful to measure customer value and target recent or lapsed visitors based on their purchase history.

Storing purchase history

To store purchase history, simply append a purchases object to your contact as you send it to us.

Field
Notes

provider_id

This is the partners ID to help identify the source of a purchase. If you need one creating, please contact support@airship.co.uk, we'll get one added and provide you an ID

order_type_id

The order type relating to how the purchase was made;

1 = Unknown

2 = Pay at table

3 = Click and Collect

4 = Dine in

5 = Delivery

6 = Online Shop

7 = Other

"account_id": 3,
"email: "johnsmith@gmail.com",
//...etc...

"purchases": [
    {
      "transaction_reference": "77FF-24FF-234F-77FF",
      "unit_id": 8775,
      "created_at": "2021-06-01 00:00:00",
      "provider_id": 1,
      "order_type_id": 4,
      "items": [
        {
          "description": "Negroni",
          "sku": "abc_8913", // string SKU for this product
          "quantity": 1, // qty of this item
          "value": 7 // total value (quantity x item value) in decimal
        },
        {
          "description": "Garlic Bread",
          "sku": "5621",
          "quantity": 2,
          "value": 8.40
        }
      ]
    }
]
PreviousAppend feedbackNextAppend booking data

Last updated 2 years ago