Skip to main content

Loyalty: Ecommerce Integration

One of the most common integrations with AIQ loyalty is for ecommerce providers or in-house teams looking to build on top of Dutchie Ecommerce, WordPress, Shopify, Jane Roots, or others.

Updated over 2 weeks ago

This integration helps you:

  • Stop staff or bad actors from misusing loyalty points (e.g., remembering phone numbers to redeem discounts later or stealing cash without applying a discount)

  • Let staff safely redeem discounts directly in your ecommerce or POS system

  • Support native redemption for AIQ-powered global loyalty programs shared with your customers

  • Instantly sign up new loyalty members and show welcome gifts after PIN verification

  • Send us abandoned carts so we can run revenue recovery campaigns


Authentication

Create an integrations page in your app to let customers input their AIQ auth credentials.

POS native flow

[Ecommerce providers can ignore this section, see flow below]

  1. Customer starts a transaction with staff in store

  2. Staff member clicks on a native button "Redeem discounts for customer"

  3. You call our endpoint when the button is pressed to verify the customer is there with their phone in hand (ownership). Endpoint = /verify/wallet sending the {"phone": "##########" }

  4. The customer provides the pin code sent to their phone. Staff puts it into a UI popup "Customer pin code: <input field>"

  5. When the staff member places the pin code into the POS, you then you hit: Endpoint = /view/wallet sending the {"phone": "##########", "code": "1234" }

  6. AIQ will then respond with a wallet object containing all available discounts for this customer as well as PUT url's to call. These PUT URLs should be hit when the staff member clicks a "Redeem this discount" + the customer has completely finished checking out. Do NOT call the PUT URL's until checkout has been completed.

  7. Please make sure to append the transaction ID to the end of the PUT url for native POS redemptions. DO NOT send it if you are an ecommerce integration.

Enterprise support advice

Many public entities rely on proper reporting of loyalty points values at the transaction level. AIQ clients often require that the pointsDeduction in our discount object below be reflected on the transaction within the POS. Eventually passing it down to transactional reports for public entity auditors.


Ecommerce native flow

AIQ supports two integration redemption model options:

Model A: Immediate Redemption (Recommended)

Flow:

  1. Integrator calls /api/v2/wallet

  2. Customer selects reward

  3. Integrator calls redemptionURL

  4. Points are immediately deducted

Pros:

  • Real-time balance accuracy

  • Cleaner reconciliation

Model B: Informational Selection (POS-Driven Redemption)

Flow:

  1. Integrator calls /api/v2/wallet

  2. Customer selects reward

  3. Integrator passes selection to POS (discount ID or order note)

  4. POS applies reward at transaction time

  5. POS calls AIQ redemption endpoint

In this model:

  • AIQ wallet balance is NOT modified until POS completes sale.

  • If order is cancelled, no refund call is required.

  • Integrator does NOT call redemption endpoint.

This model is acceptable but requires:

  • Clear retailer onboarding expectations

  • POS must complete redemption

Ecommerce Checkout Flow

  1. Customer arrives at ecommerce checkout page

  2. User enters in their phone number or email - or you already have it as a stored customer: Endpoint = /verify/wallet sending the {"phone": "##########", "email": "[email protected]" }

  3. AIQ responds with either:

    • Success: User is sent a text with a special code “Your code to unlock rewards is: 1234”

    • Error: They aren't signed up for this loyalty program yet "No customer exists with phone number error”

    • 🔶 Note 🔶 If no customer exists or they aren’t in the loyalty program yet, We highly recommend allowing customers to signup:

  4. Error: Allow user to optionally create a loyalty account by showing the following consent text:

    • “I consent to signup for the {{brand name}} rewards program where I will receive marketing communications. By doing so, I understand that I am allowing {{brand name}} and it's technology provider(s) to retain my personal contact details/ engagement history for use in personalized marketing. Opt out at any time by replying "STOP" to messages. Standard message and calling rates may apply.”

      • Canada: Replace "Rewards program" with "club program"

    • Once created, you can either decide to run them through the verification process, or you can now directly retrieve their wallet and skip 2FA since this is a new user using:

  5. Success: If customer exists after either route

    • Wait for customer to receive 4 digit verification code. Allow customer to resend the verification code (in which you hit the same endpoint “Send Wallet Verification Request” again to refresh their code)

    • Once code is inputted, hit "Retrieve wallet with verification code" with phone and code, and a wallet will be returned


Request a PIN code be sent to the customer's phone

Use this endpoint during the cart-building phase to verify ownership of discounts before redeeming: /post_api_v2_verify_contact_wallet

Notes:

  • For API integrations, partners may optionally implement the PIN verification flow, but it is not required for redemption or wallet access.

  • The customer-facing PIN setting ("Enable customer redemption PIN codes.") is not enforced at the API level.


Obtain the wallet for a customer with pin code

Get a wallet object with all discounts for a customer so that they or the staff member can redeem or apply to cart: /post_api_v2_view_contact_wallet


Create new loyalty customer

Use this endpoint when a user wishes to opt-in to loyalty as a new customer:


Send AIQ Abandoned Carts

One of the most popular marketing campaigns is to use abandoned cart data to recapture lost revenue. As an ecommerce provider, you simply send us each abandoned cart and we take care of automating the rest.

AIQ will space out order reminders to avoid message overload, showcase cart items across our network of pages and listings, and use email, SMS, and push notifications to re-engage customers.

There are 2 pieces to Abandon Cart emails:

  1. The POS send us the abandon cart using this endpoint: /api/v2/cart

  2. AIQ does the work to enable Dynamic Content in Campaigns. If step 1 is complete and your customers are now asking for dynamic content, please reach out to us.

Did this answer your question?