Endpoints:
Description: Returns all personas / contact ID’s within your account.
Endpoint: (GET) /piis/:uid?{params}
Params:
Example Request: GET /piis/420?start=80&limit=20
Response body:
{
"data": {
"results": [
{
"contactID": "560863a606982016ede3e68a0515afa2",
"srcID": "f5b65153-4578-4fc2-824e-89b0425aacf2",
"firstName": "Elon",
"lastName": "Musk",
"mobilePhone": "8881110000",
"platform": "cova",
"favoriteStoreID": null,
"inserted": 1594598213,
"optinTime": 1594598213,
"optoutTime": null,
"optreqTime": 1594598113,
"hasRequested": null
},
...
],
"start": 80,
"total": 18909,
"limit": 20,
"size": 20
},
}
Field | Type | Description | |
---|---|---|---|
contactID | string | The Alpine IQ unique identifier for the contactID | |
srcID | string | Unique ID the data source (Treez, S3, etc.) has for this contactID | |
firstName | string | First name of contactID | |
lastName | string | Last name of contactID | |
mobilePhone | string | The mobile phone number | |
homePhone | string | The home phone number | |
platform | string | The source where Alpine gathered this contact (Treez, Cova, Flat file, Loyalty, etc) | |
favoriteStoreID | INT | The Alpine IQ store ID the contact has set as their favorite | |
inserted | Epoch | When the contact data was inserted into the Alpine IQ big query database (Compliance) | |
optinTime | Epoch | When the contactID opted in | |
optoutTime | Epoch | When the contactID opted out | |
optreqTime | Epoch | When the contactID was sent an an SMS member club optin request | |
hasRequested | Bool | Whether or not the contactID has been sent a request to optin to SMS but has yet to respond (Pending optin request) |
Description: Creates a new loyalty or member club persona. Adding this user will instantly text the phone number for the contact and request a confirmation for optin to loyalty/ club SMS.
Endpoint: (POST) /loyaltyContact/:uid
{ firstName: '', lastName: '', mobilePhone: '', email: '', address: '', favoriteStore: '', favoriteStoreID: 1, }
firstName | string | First name of customer | |
lastName | string | Last name of customer | |
mobilePhone | string | Phone for customer (SMS will be sent here) | |
string | Email for customer | ||
address | string | Address of customer (can be full address or just zip code) | |
favoriteStore | string | Leave as empty string or pass the store name if known. | |
favoriteStoreID | int | Should map to an existing store ID based on store locations from: https://docs.alpineiq.com/rest-api-home/store-locations-api/#getAllPersonas |
Description: Returns a little bit more info about a single contact.
Endpoint: (GET) /piis/:uid/:contactID
Response body:
{
"data": {
"contactID": "89f2716dbc6326163946cbd14079edf0",
"srcID": "10666",
"firstName": "Luci",
"lastName": "Ball",
"email": "nick@something.com",
"homePhone": "1112223333",
"mobilePhone": "8889992222",
"platform": "treez",
"favoriteStoreID": null,
"signedUp": 1594072778,
"firstSeen": 1546072778,
"wallet": "https://lab.alpineiq.com/linkToWalletForPersona",
"addr": {
"city": "Santa Clarita",
"country": "US",
"zipCode": "81612",
"state": "CA",
"street": "15011 StarVenture Dr",
"lat": 23.94903,
"long": -120.393
},
"actions": [
{
"label": "text_received",
"timestamp": 1595347658,
"platform": "sms campaign",
"cmpID": "1052",
"discID": null
},
{
"label": "text_received",
"timestamp": 1595364266,
"platform": "sms campaign",
"cmpID": "1221",
"discID": null
}
],
"inserted": 1596509600,
"loyalty": true,
"loyaltySignupTS": 1595295167,
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15",
"ip": "53.494.938.93",
"ageGate": true,
"optinTime": 1594598113,
"optoutTime": 1594598113,
"optreqTime": 1594598113,
"hasRequested": true,
"gender": "U",
"lastSeen": 1594598113
},
}
Field | Type | Description | |
---|---|---|---|
contactID | string | The Alpine IQ unique identifier for the contactID | |
srcID | string | Unique ID the data source (Treez, S3, etc.) has for this contactID | |
firstName | string | First name of contactID | |
lastName | string | Last name of contactID | |
string | The contacts email | ||
mobilePhone | string | Mobile phone number | |
homePhone | string | Home phone number | |
platform | string | The source where Alpine gathered this contact (Treez, Cova, Flat file, Loyalty, etc) | |
favoriteStoreID | string | The Alpine IQ store ID the contact has set as their favorite | |
signedUp | epoch | Time they signed up with your brand. This can pre-date Alpine services | |
firstSeen | epoch | The first time Alpine saw this user | |
lastSeen | epoch | The last time when Alpine saw an interaction from this user | |
addr | obj | Address for the contact. Lat + Long are appended/ updated by Alpine IQ if a new address is found. | |
ip | string | The IP for this contact. | |
actions | obj | Any campaigns or actions from 3rd party platforms we are tracking (I.E: When mailchimp sends an email or when Alpine sends an SMS) | |
inserted | Epoch | When the contact data was inserted into the Alpine IQ big query database (Compliance) | |
loyalty | bool | Whether or not they are still part of your member club | |
loyaltySignupTS | Epoch | Time they signed up for loyalty program/ member club | |
ageGate | bool | Whether or not this contact has passed an age gate of anykind | |
optinTime | Epoch | When the contactID opted in | |
optoutTime | Epoch | When the contactID opted out | |
optreqTime | Epoch | When the contactID was sent an an SMS member club optin request | |
hasRequested | Bool | Whether or not the contactID has been sent a request to optin to SMS but has yet to respond (Pending optin request) | |
gender | string | U = unknown otherwise you will get M or F for gender. |
Description: Returns all orders made by a contactID.
Endpoint: (GET) /contact/orders/:uid/:contactID
Response body:
{
"data": [
{
"sku": "4JDQSBG5",
"productId": "3a550156-46cf-4271-b547-22aa1d4189f8",
"category": "Sativa Pre-Roll",
"parentCategory": "Pre-rolls",
"name": "Tantalus Labs - Sky Pilot - Hybrid - PreRoll - 3 x 0.5g",
"quantity": 1,
"timestamp": 1592015580,
"totalCost": 13.48,
"totalPrice": 22.79,
"customAttributes": null
},
{
"sku": "4JDQSBG5",
"productId": "3a550156-46cf-4a91-93ae-d36ef5049445",
"category": "510 catridges",
"parentCategory": "Vapes",
"name": "Kolab - Project Kolab - Vape Cartridge - Indica - 0.5g",
"quantity": 1,
"timestamp": 1592015580,
"totalCost": 32.94,
"totalPrice": 52.21,
"customAttributes": null
}
],
"code": 200,
"success": true
}
Field | Type | Description | |
---|---|---|---|
sku | string | SKU for this product | |
productId | string | Product ID provided by POS system in most cases. | |
category | string | Category of the product | |
parentCategory | string | Parent category for the product | |
name | string | Name of product | |
quantity | INT | Quantity purchased | |
timestamp | epoch | Timestamp of order | |
totalCost | float | Cost to retailer | |
totalPrice | float | Total checkout price | |
customAttributes | obj | Custom attributes for this product set by the POS in most cases |
Description: Returns most likely products a contact will be interested in ranked in order.
Endpoint: (GET) /contact/rankings/:uid/:contactID
Response body:
{
"data": [
{
"SKU": "DZJURKZT",
"ProductName": "Canaca - Blend 14% - Blend - Pre-Roll - 3 x 0.5g",
"Brand": "",
"Category": "3. Pre-Roll"
},
{
"SKU": "0Q62Y5GJ",
"ProductName": "Twd. - Sativa - Preroll - 1x1g",
"Brand": "",
"Category": "3. Pre-Roll"
},
]
}
Field | Type | Description | |
---|---|---|---|
SKU | string | SKU for this product | |
ProductName | string | Alpine ID for this product | |
Category | string | Category of the product | |
Brand | string | Brand name |