API recipes: common integrations
Worked examples: sync your catalog to a website, show live stock, look up loyalty, add sign-ups as customers, export sales and take B2B orders.
1. Keep a website catalog in sync
Key scopes: catalog.read (+ stock.read for stock). Default store: the store whose prices the website shows.
- First load: page through
GET /items?per_page=200and save every item byid. - Every 15 minutes:
GET /items?updated_since=<time of your last sync>&include_inactive=true— update changed items and hide ones withis_active: false. - Show
image_url,price_cents / 100and the department.
curl "https://api.leisurenexus.app/v1/items?updated_since=2026-10-17T13:00:00Z&include_inactive=true&per_page=200" \
-H "Authorization: Bearer lnk_…"
2. Show "in stock" on product pages
GET /stock?item_id[]=<id>&item_id[]=<id> for up to 200 items at once. Cache the answer for a few minutes; use in_stock for the badge and on_hand for "only 3 left".
3. Loyalty lookup in your app
Scope customers.read. When a customer signs in to your app with their phone number:
curl "https://api.leisurenexus.app/v1/customers?phone=5125550199" -H "Authorization: Bearer lnk_…"
Show points_balance. The same phone number works as their loyalty number at the register.
4. Website sign-ups become customers
Scope customers.write. When someone signs up:
GET /customers?email=<their email>— if found,PATCHit.- Otherwise
POST /customerswith first name, last name, email and phone. - A
422withfields.phoneorfields.emailmeans another customer already has it — look that one up instead.
5. Daily sales export to a data warehouse
Scope orders.read. Every night:
curl "https://api.leisurenexus.app/v1/orders?since=2026-10-16T05:00:00Z&until=2026-10-17T05:00:00Z&per_page=200&sort=completed&dir=asc" \
-H "Authorization: Bearer lnk_…"
Page until page = pages. Store type (sale or refund) and status (completed or voided) so totals match LeisureNexus reports: count completed sales, subtract refunds, skip voided. Use each store's time zone from GET /locations to choose the day's start and end.
For real-time dashboards, subscribe to order.completed and order.voided webhooks instead of polling.
6. A B2B ordering portal
Scopes catalog.read and orders.write. Needs the Wholesale profile.
- Show items from
GET /items. - Map each portal account to its LeisureNexus business customer id.
POST /sales-orderswithcustomer_id, theircustomer_poand the lines (byskuoritem_id).- Show the returned order
numberandtotal_cents. The order arrives as a draft for your team to confirm. - Subscribe to
sales_order.invoicedto email the customer when it's invoiced.
Testing
Create a separate key for testing, point webhooks at a test URL, and use Send test to check your signature code before going live.
Still stuck? Email support@leisurenexus.com or send us a message — we're happy to help.