Lightspeed webhook receiver
Called by Lightspeed (registered automatically on connect), or by a Lightspeed business
rule. Accepts raw JSON or a form-encoded payload=<json> body. When
X-Lightspeed-Signature is present it must be the hex HMAC-SHA256 of the raw body.
The store is found from domain_prefix (also read from domainPrefix, store,
storeId, retailer.domain_prefix or sale.domain_prefix). Events are stored, then
processed in the background: sale.created, sale.updated,
sale.ready_for_payment, sale.line_items.added and sale.customer.changed save the
sale and issue a receipt link; inventory.created and inventory.updated save the
inventory change; other events are stored only.
A receipt is added to a MyNearStores member's account when the member ID is in the
Lightspeed customer's customer_code, or in a top-level mns_member_id or
reference_id.
X-Lightspeed-Signature?string- body
Lightspeed's event body. Only the fields MyNearStores reads are listed.
event_type?stringdomain_prefix?stringretailer?customer?sale?mns_member_id?stringAlternative to customer.customer_code for business-rule webhooks.
reference_id?string[key: string]?anyReceived. Unknown stores are acknowledged with a warning and not stored.
application/json- response
received*unknownwebhook_event_id*integerdomain_prefix*stringcurl -X POST "https://example.com/lightspeed/webhook" \ -H "Content-Type: application/json" \ -d '{}'{ "received": true, "webhook_event_id": 0, "domain_prefix": "string"}