QR redemption sessions
Validate a scanned MyNearStores QR code at the register and redeem it exactly once.
When a terminal scans a shopper's MyNearStores QR code, it opens a session. The session lets the register confirm the scan is fresh and makes sure it is redeemed only once.
scan ──► active ──(validate ok)──► mark used ──► used
└──(30 minutes pass)──► expired1. Open a session on scan
curl "$MNS_API/qr-session/scan?store_id=12&terminal_id=31&qr_id=QR-8F2A91"201 Created:
{
"success": true,
"data": {
"id": 501,
"storeId": 12,
"terminalId": 31,
"qrId": "QR-8F2A91",
"sessionId": "6f1c3a52-6a8e-4c39-9a0b-2b9c8e7d1f44",
"status": "active",
"expiresAt": "2026-10-18T10:30:00.000Z"
}
}Keep data.sessionId. Sessions expire 30 minutes after the scan.
2. Validate before applying the offer
curl "$MNS_API/qr-session/validate/6f1c3a52-6a8e-4c39-9a0b-2b9c8e7d1f44"The response is always 200. Check valid:
{ "success": true, "valid": true, "data": { "sessionId": "6f1c3a52-…", "status": "active" } }{ "success": false, "valid": false, "reason": "Session expired" }reason | What to do |
|---|---|
Session not found | Rescan the code. |
Session already used | The offer was already redeemed. Do not apply it again. |
Session expired | Rescan the code to open a new session. |
3. Mark the session used
Once the offer is applied to the sale:
curl -X PATCH "$MNS_API/qr-session/6f1c3a52-6a8e-4c39-9a0b-2b9c8e7d1f44/use"{ "success": true, "message": "Session marked as used" }Always validate first
Marking a session used does not check whether it is still valid. Call validate, apply the offer, then mark it used.
Scan history
GET /qr-session/history?store_id=12&terminal_id=31&qr_id=QR-8F2A91 returns every session opened for that code on that terminal.