Lightspeed Retail
Connect Lightspeed Retail (X-Series) to a terminal and issue digital receipts to MyNearStores members.
Each terminal can be linked to one Lightspeed Retail (X-Series) store, identified by its domain prefix (the yourstore in yourstore.retail.lightspeed.app). Once linked, Lightspeed sends sale and inventory events to MyNearStores in real time.
Connect
Open the authorize URL in a popup, the same way as Square:
window.open(
`${MNS_API}/lightspeed/oauth/authorize?bu_id=${buId}&terminal_id=${terminalId}`,
'lightspeed-connect',
'width=600,height=700',
)
window.addEventListener('message', (event) => {
if (event.data?.type === 'LIGHTSPEED_OAUTH_SUCCESS') {
// { type, domain_prefix, bu_id, terminal_id }
} else if (event.data?.type === 'LIGHTSPEED_OAUTH_ERROR') {
// { type, error }
}
})After the merchant approves, MyNearStores stores the token and registers its webhook with Lightspeed automatically. There is nothing to configure in Lightspeed.
MyNearStores requests these Lightspeed scopes: sales:read, sales:write, products:read, products:write, inventory:read, inventory:write, customers:read, customers:write.
Check the connection
curl "$MNS_API/lightspeed/oauth/status/1/31"{
"connected": true,
"domain_prefix": "yourstore",
"bu_id": 1,
"terminal_id": 31,
"expires_at": "2026-10-25T10:00:00.000Z",
"is_expired": false,
"scopes": ["sales:read", "sales:write"],
"created_at": "2026-10-18T10:00:00.000Z",
"updated_at": "2026-10-18T10:00:00.000Z"
}When no terminal is linked the response is { "connected": false, "message": "No active OAuth token" }.
Events from Lightspeed
| Event | What MyNearStores does |
|---|---|
sale.created, sale.updated, sale.ready_for_payment, sale.line_items.added, sale.customer.changed | Saves the sale (one record per sale, updated by later events) and issues a receipt link |
inventory.created, inventory.updated | Saves the inventory change |
| Anything else | Stored and acknowledged, not processed |
Events are acknowledged immediately and processed in the background. Signed webhooks (X-Lightspeed-Signature, HMAC-SHA256 of the raw body) are verified; a bad signature is rejected with 401.
Link sales to MyNearStores members
A sale gets a digital receipt in the shopper's MyNearStores account when MyNearStores can tell who the shopper is. Put the shopper's MyNearStores member ID in the Lightspeed customer's Customer Code field.
No member ID, no receipt in the app
The sale is still saved and still gets a receipt link, but it is not added to a member's account. If you send events from a Lightspeed business rule, you can instead include mns_member_id (or reference_id) at the top level of the payload.
Disconnect
curl -X DELETE "$MNS_API/lightspeed/oauth/token/1/31"{ "success": true, "message": "OAuth token revoked and deleted", "bu_id": 1, "terminal_id": 31 }Returns 404 when the terminal has no Lightspeed connection.