API

Through the API, your website, POS and CRM work with loyalty programs, promo codes and referral programs, and product events reach your systems through webhooks.

API keys

A manager issues the key under “Integrations” on the “API keys” tab. A request passes the key and the company in headers, and every call is written to the log.

API_KEY: <key> · CompanyId: <company id>
  • Key term of 1, 6 or 12 months, paid in A3.ID
  • The key is shown once when issued
  • Reissue if the key is compromised
  • A log of every request made with the key
  • Errors in the “CODE: message” format for clear handling

Main requests

Paths from the API root and examples in curl, JavaScript and PHP with the program and company ids filled in are available in the app under “Integration”.

Loyalty programs

RequestPurpose
POST External/v1/Loyalty/CustomersRegister a customer in the program
GET External/v1/Loyalty/CustomerGet the customer balance and tier
POST External/v1/Loyalty/QuoteCalculate the cart: how much can be redeemed and how much will be earned
POST External/v1/Loyalty/HoldsHold bonuses for 30 minutes before payment
POST External/v1/Loyalty/PurchasesRecord a purchase: redeem and award bonuses
POST External/v1/Loyalty/RefundsReturn bonuses when an order is refunded

Promo codes

RequestPurpose
POST External/v1/Promocodes/ValidateCheck a code for an order and calculate the discount
POST External/v1/Promocodes/ApplyApply a code to an order
POST External/v1/Promocodes/ReleaseRelease a code when an order is canceled

Referral programs

RequestPurpose
POST External/v1/Referral/ParticipantsRegister a participant and get a code
GET External/v1/Referral/ParticipantGet participant data and balance
POST External/v1/Referral/ConversionsCount a purchase made with a referral code
POST External/v1/Referral/Conversions/CancelCancel a conversion on a refund
POST External/v1/Referral/WithdrawalsCreate a payout request

Webhooks

A3.Marketing sends events to your system address, so your CRM, warehouse or analytics learn about them right away rather than on a schedule.

  • marketing.lead.createdA lead appeared, including one from a mailing tracking link
  • marketing.lettering.completedA mailing finished and delivery statistics are ready
  • marketing.unsubscribe.recordedA contact unsubscribed from mailings in a channel
  • marketing.website.downA company website stopped responding
  • marketing.seo.report.readyAn autoparse SEO report was saved

Website script

A small script remembers the code from a ?ref= link for 90 days. At checkout the website takes the saved code and sends a conversion, even if the buyer came back a week later.

Referral programs

Full documentation

All methods, parameters and error codes are described in the interactive API documentation. Guides to working in the app are in the A3.Solutions wiki.

Shall we connect loyalty to your POS?

Tell us which POS, website and CRM you use. We will suggest the requests you need and test the connection together with your developer.