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
| Request | Purpose |
|---|---|
POST External/v1/Loyalty/Customers | Register a customer in the program |
GET External/v1/Loyalty/Customer | Get the customer balance and tier |
POST External/v1/Loyalty/Quote | Calculate the cart: how much can be redeemed and how much will be earned |
POST External/v1/Loyalty/Holds | Hold bonuses for 30 minutes before payment |
POST External/v1/Loyalty/Purchases | Record a purchase: redeem and award bonuses |
POST External/v1/Loyalty/Refunds | Return bonuses when an order is refunded |
Promo codes
| Request | Purpose |
|---|---|
POST External/v1/Promocodes/Validate | Check a code for an order and calculate the discount |
POST External/v1/Promocodes/Apply | Apply a code to an order |
POST External/v1/Promocodes/Release | Release a code when an order is canceled |
Referral programs
| Request | Purpose |
|---|---|
POST External/v1/Referral/Participants | Register a participant and get a code |
GET External/v1/Referral/Participant | Get participant data and balance |
POST External/v1/Referral/Conversions | Count a purchase made with a referral code |
POST External/v1/Referral/Conversions/Cancel | Cancel a conversion on a refund |
POST External/v1/Referral/Withdrawals | Create 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 linkmarketing.lettering.completedA mailing finished and delivery statistics are readymarketing.unsubscribe.recordedA contact unsubscribed from mailings in a channelmarketing.website.downA company website stopped respondingmarketing.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 programsFull 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.