Partner API
The Microgenn Loyalty Partner API lets your POS or PMS software award points and redeem coupons for customers enrolled in any loyalty program powered by Microgenn โ even if you don't run Microgenn software yourself.
http://loyalty.microgenn.com/api/{tenant-slug}Replace
{tenant-slug} with the loyalty program slug given to you by Microgenn (e.g. spice-garden).
Authentication
Every request must include your API key in the X-API-Key header.
Contact the hotel admin to generate a Live key with the
read:customers and write:transactions scopes.
X-API-Key: mg_live_your_key_here
mg_test_...000000. Coupon validation works but nothing is consumed.mg_live_...Sandbox testing
Use a sandbox key (mg_test_...) during development.
The API behaves identically to production but:
- โ Customer lookup and bill posting return realistic responses
- โ Coupon validation works (checks expiry, status)
- โ No points are actually awarded or deducted
- โ Coupons are not consumed (status stays
active) - โ No SMS sent for OTP โ always returns
000000
Sandbox responses include "sandbox": true so you can tell them apart.
Integration flow
Typical cashier workflow at a partner hotel:
GET /pos/customer?mobile=XXX&create=true to fetch their points balance, tier, and available coupons.POST /pos/coupon/redeem with the coupon code to validate & mark it used.POST /pos/bill with the bill amount. Points are awarded automatically./pos/customer
Look up a customer by mobile number. Returns points balance, tier, and active coupons. Pass create=true to auto-enroll new customers.
read:customersQuery Parameters
| Param | Required | Description |
|---|---|---|
mobile | Yes | 10-digit mobile number |
create | No | Pass true to auto-create customer if not found |
name | No | Customer name (used only when creating) |
Request
curl -X GET "http://loyalty.microgenn.com/api/spice-garden/pos/customer?mobile=9876543210&create=true&name=Ravi" \ -H "X-API-Key: mg_live_your_key_here"
Response โ customer found
{
"found": true,
"customer": {
"customer_id": "uuid...",
"name": "Ravi Kumar",
"mobile": "9876543210",
"points_balance": 3400,
"segment": "regular"
},
"points_balance": 3400,
"redeemable_value": 34, // โน34 discount available
"redemption_rate": 100, // 100 pts = โน1
"tier": "Gold",
"priority_service": false,
"active_coupons": [
{
"coupon_id": "uuid...",
"code": "COUP-XY12",
"value": 200, // โน200 off
"source": "campaign",
"expiry_date": "2026-12-31"
}
]
}
Response โ not found (without create=true)
{ "found": false, "mobile": "9876543210" }
/pos/bill
Post a customer's bill. Points are calculated automatically based on the loyalty rules and the customer's tier multiplier.
write:transactionsRequest Body
| Field | Required | Description |
|---|---|---|
mobile | Yes* | Customer's mobile number (* or customer_id) |
customer_id | Yes* | Customer UUID (* or mobile) |
amount | Yes | Bill amount in โน (number) |
name | No | Customer name (used if auto-creating) |
external_ref | No | Your POS invoice/bill number (for reconciliation) |
items | No | Array of {category, name, amount} for category-based bonus points |
Request
curl -X POST "http://loyalty.microgenn.com/api/spice-garden/pos/bill" \ -H "X-API-Key: mg_live_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "mobile": "9876543210", "amount": 1500, "name": "Ravi Kumar", "external_ref": "INV-2026-0042" }'
Response
{
"transaction_id": "uuid...",
"customer_id": "uuid...",
"amount": 1500,
"points_earned": 150000, // 1500 ร 100 base rate
"points_redeemed": 0,
"new_balance": 153400,
"tier": "Gold",
"tier_upgraded": false,
"customer": { ... }
}
/pos/coupon/redeem
Validate a coupon code and mark it as used. Call this before posting the bill so the discount is applied first.
write:transactionsRequest Body
| Field | Required | Description |
|---|---|---|
code | Yes | The coupon code (e.g. COUP-XY12) |
Request
curl -X POST "http://loyalty.microgenn.com/api/spice-garden/pos/coupon/redeem" \ -H "X-API-Key: mg_live_your_key_here" \ -H "Content-Type: application/json" \ -d '{"code": "COUP-XY12"}'
Response โ valid
{
"valid": true,
"value": 200, // โน200 discount to apply at billing
"source": "campaign",
"coupon": { /* full coupon object */ }
}
Response โ invalid / expired
HTTP 400 { "error": "Coupon expired" }
HTTP 400 { "error": "Coupon is used" }
HTTP 404 { "error": "Coupon not found" }
Error codes
| HTTP | Meaning | Fix |
|---|---|---|
401 | Missing or invalid API key | Check your X-API-Key header |
403 | API key missing required scope | Ask admin to add read:customers / write:transactions scope to the key |
400 | Missing required field | Check request body โ mobile or amount likely missing |
404 | Customer / coupon not found | Use create=true to auto-create customers; verify coupon code |
500 | Server error | Contact Microgenn support |
Need help?
Contact senthil@microgenn.com to get your API key or for integration support.