Skip to main content

Core Integration

Background

AIQ's Core integration with your POS includes:

  • Ability to get transaction history

  • Ability to get and update contacts

  • Ability to get inventory levels, cost/ margin

There are 2 ways to complete this integration (see further instructions below):

  • Option 1: Provide AIQ with REST API endpoints

  • Option 2: Send our endpoints data using our public REST API endpoints

Option 1: Provide AIQ with REST API endpoints to:

  • Get transactions & shopper records by time range

  • It is preferred to make sure that we have inventory stock, margin, and cost within those calls in order to calculate advanced analytics + facilitate automated recommendations of products to shoppers and staff

After we integrate those features all POS systems have the premium option to integrate our loyalty wallet and redemptions of discounts directly within the POS native UI. You can see an example of these endpoints in action both within Dutchie & LeafLogix (videos on page):

Option 2: Send our endpoints data using the endpoints below

If needed, our team is also well versed in pulling the required data in from other sources (Database tables, flat files such as CSV's, daily OneDrive drops, etc.)

Bulk Endpoints (Recommended for High Volume)

For partners sending large volumes of data, AIQ supports bulk ingestion endpoints for both personas and transactions. These endpoints improve efficiency and reduce API call overhead.

Bulk Personas (Create / Update)

Use this endpoint to create or update multiple personas in a single request:

Endpoint: POST /api/v1.1/createUpdateMembers/:uid

Notes:

  • Accepts an array of persona objects (same structure as createUpdateMember)

  • Subject to the same processing behavior (can take up to 24 hours depending on ingestion volume)

  • Recommended for initial migrations or large syncs

Bulk Transactions (Create / Update)

Use this endpoint to submit multiple transactions in a single request:

Endpoint:
​POST /api/v1.1/createUpdateSales/:uid

Notes:

  • Accepts an array of transaction objects (same structure as createUpdateSale)

  • Each transaction should still map to a pos_user for proper persona attribution

  • Ideal for backfills or high-frequency transaction systems

When to Use Bulk vs Single Endpoints

Use Case

Recommendation

Real-time transaction posting

Single endpoints (createUpdateSale)

Real-time persona creation

Single endpoint (createUpdateMember)

Historical backfills

Bulk endpoints

Large batch syncs (daily/hourly)

Bulk endpoints

Add + update POS transactions

Use this endpoint to post transactions that are occuring on your service to AIQ. We will handle accruing points for loyalty programs, analyzing, updating inventory, etc. We leverage pos_user to map to a full contact ("Persona") we should attribute the sale to.

curl -X POST   https://lab.alpineiq.com/api/v1.1/createUpdateSale/:uid -H 'content-type: application/json' -H 'x-apikey: YOUR_API_KEY' -d '{
"visit": {
"pos_id": "120-receipt-id-120", // Receipt ID of the sale being submitted
"pos_user": "1239uOiejaiofje", // Primary key of the persona attached to the transaction
"sendNotification": 0,
"transaction_date": "2014-04-20 04:03:53 +0000", // Date transaction occurred
"transaction_total": 28.0, // Transaction total amount
"location": "Muffins Miami", //Name of your store. Map this to a friendly name for analysis at Configure AIQ -> Retail Stores once you submit some sales.
"visit_details_attributes": [ // The quantity within this object should be a negative value if it is a refund.
{
"sku": "AUR932k",
"price": 40.0,
"quantity": 1.0,
"category": "PRE-ROLL",
"brand": "Tweed",
"name": "12g White Widow rollup",
"discount": 12.0,
"size": "12g",
"strain": "Blueberry OG",
"grade": "A",
"species": "hybrid",
}
]
}' --compresse

Submit personas attached to transactions

Use this endpoint so that AIQ can "attach" order details to the shopper that made the transaction. This allows for deep analysis and segmentation on shopper preferences. AIQ can also fire off new opt-in requests to join loyalty or member club programs. The response will include the contactID and the srcID which you can store to use when submitting sales and redeeming discounts.

If an invalid phone number is submitted, AIQ will process it as a blank value.

Use this v1.1 endpoint. Submissions to this endpoint are subject to your capture process which can take up to 24 hours to process.

curl -X POST   https://lab.alpineiq.com/api/v1.1/createUpdateMember/:uid -H 'content-type: application/json' -H 'x-apikey: YOUR_API_KEY' -d '{
"member": {
"pos_user": "1239uOiejaiofje",
"pos_type": "Online",
"email": "[email protected]",
"first_name": "Drake",
"last_name": "Ross",
"address1": "4461 Prosper dr",
"address2": "Apt 2217",
"city": "Dallas",
"state": "TX",
"zip": "76008",
"birthday": "05/16/1985",
"phone_number": "##########",
"gender": "F",
"loyalty": false, // do not set this to true unless the customer expects to receive an SMS to double optin to loyalty. Duplicates will be ignored.
}
}' --compressed

Update Personas

To update an existing persona in AIQ, you will need to submit a POST request to /api/v2/loyaltyContact/override/:uid/:contactID. This endpoint will allow you to update fields for an existing persona. This endpoint will only update fields provided. For fields you do not want to update, simply omit them from the payload. For every available field, see our swagger.

Example: A shopper requests to change their phone number and/or email

  1. Change the shopper's record in the POS.

  2. Pull the shopper's contactID using this endpoint using their old phone number or email.

  3. Submit the shoppers new email/phone to the override endpoint (See example below)

curl --location 'https://lab.alpineiq.com/api/v2/loyaltyContact/override/:uid/:contactID' \
--header 'Content-Type: application/json' \
--header 'x-apikey: YOUR_API_KEY' \
--data-raw '{
"email": "[email protected]",
"mobilePhone": "3125555555"
}'

If an invalid phone number is submitted, AIQ will process it as a blank value.

Create and Update Inventory

To update inventory sent POST requests with an array of items. Max items per call is 100 with SKU/product ID as required params.

curl -X POST   https://lab.alpineiq.com/api/v1.1/createUpdateInventory/:uid -H 'content-type: application/json' -H 'x-apikey: YOUR_API_KEY' -d '[
{
"sku": "100050",
"productId": "MU-CH-PR-100050",
"category": "Muffins Pre-Rolls",
"parentCate": "Pre-Rolls",
"name": "Chemdawg 2g",
"brand": "Muffins",
"variant": "string",
"barcode": "string",
"url": "https://google.com",
"imageUrl": "string",
"description": "string",
"supplierNa": "string",
"currency": "string",
"customAttr": [
{
"parent": "string",
"key": "string",
"value": "string"
},
{
"parent": "string",
"key": "string",
"value": "string"
}
],
"supplierId": "int",
"totalTax": "15.50",
"dateUpdated": "1660073955",
"MSRP": "12.56",
"quantity": "5",
"thc": "12.0",
"cbd": "1.0",
"dateAdded": "1660073953",
"salesPrice": "30.00",
"inStock": true,
"isSaleable": true,
"isArchived": false
}
]' --compressed

// Returns
{
"code": 200,
"success" : true,
"data": [] // no data returned for this endpoint
}
Did this answer your question?