Skip to content

REST API overview.

The session-token REST API for custom frontends and integrations.

Nov 16, 2026
On this page

The Reward Loyalty REST API is the session-token API: a client signs in as an admin, partner, staff member, or member, receives a Bearer token, and calls endpoints as that user. Use it for custom frontends, mobile apps, and third-party integrations. The Agent API is its machine-to-machine counterpart: long-lived keys instead of login sessions, built for POS systems, AI agents, and automation.

💡 Looking for the Agent API? If you need machine-to-machine access for POS systems, AI agents, or automation tools, see the Agent API documentation. The Agent API uses long-lived API keys instead of login tokens and targets automated systems.

API notice

ℹ️ Reward Loyalty works as a standalone platform with a complete web interface for all users. The API exists as a supplementary resource for developers who want to build custom integrations. Check the available endpoints before planning your integration.

What this means for you:

  • Standalone-first. All platform features are accessible through the web interface without any API integration.
  • Developer foundation. The API provides working endpoints that experienced developers can extend and customize for their specific needs.
  • Product support. We help investigate supplied API endpoints that are not working as expected, including relevant settings or documented setup steps during your active support period. Designing, building, or debugging a custom integration, reviewing code, and creating new endpoints fall outside product support. For custom development, contact NowSquare about a separate paid agreement. See what support includes.
  • Review before purchasing. Check the interactive API documentation to verify available endpoints meet your requirements. The Agent API documentation is also available for machine-to-machine integrations.

Interactive documentation

REST API (this API)

Full API documentation with request/response examples is available at:

https://your-domain.com/api/documentation

Browse the live REST API docs →

The REST API Swagger page with its title and first endpoint groups.

This Swagger UI interface lets you:

  • Browse all available endpoints
  • View request/response schemas
  • Test endpoints from the browser (with authentication)

Agent API

The Agent API has its own dedicated OpenAPI specification:

URL What It Provides
/api/agent/docs Interactive Swagger UI for the Agent API
/api/agent/docs.json Raw OpenAPI 3.0 JSON spec, importable by Postman, automation platforms, and code generators
/api/agent/v1/tools?format=openai Authenticated tool discovery. Returns tool definitions scoped to the key's role and permissions

Base URL

All API requests use your installation's domain:

https://your-domain.com/api/{locale}/v1

The {locale} parameter sets the response language for messages and validation errors (e.g., en-us, de-de). An unknown or inactive locale falls back to the installation default.

Authentication

Most endpoints require Bearer token authentication via Laravel Sanctum:

Authorization: Bearer your-api-token

Obtaining tokens

Obtain a token by calling the login endpoint for each user type:

User Type Login Endpoint Token Scope
Admin POST /api/{locale}/v1/admin/login Platform management
Partner POST /api/{locale}/v1/partner/login Business operations
Staff POST /api/{locale}/v1/staff/login Point-of-sale operations
Member POST /api/{locale}/v1/member/login Customer-facing

Available endpoints

Admin endpoints

  • Authentication: login, logout, profile
  • Partner Management: list, get, create, update, delete
  • Partner Permissions: get, update (for SaaS billing)
  • Partner Usage: get usage vs limits

Partner endpoints

  • Authentication: login, logout, profile, update
  • Clubs: list, get, create, update, delete, including each club's location choice
  • Business locations: list, get, create, update, delete. See Business locations
  • Loyalty cards: list, get, create, update, delete
  • Stamp cards: list, get, create, update, delete
  • Staff Members: list, get, create, update, delete
  • Members: list, get (read-only, limited to members who have interacted with your business)
  • Vouchers: list, get, create, update, delete
  • Prepaid Passes: list, get, create, update, delete
  • Rewards: list, get, create, update, delete
  • Transactions: add purchases, add points, deduct points
  • Apple Wallet: read and update item settings for loyalty cards, stamp cards, vouchers, and prepaid products
  • Shopify Integration: get status, update settings, pause, resume, disconnect

Partner calls that create or change programs follow the partner's plan, the same as the dashboard. A program the plan leaves out answers 403. Creating a loyalty card, stamp card, voucher, reward, or staff member past the plan's limit answers 422. Members register themselves or join through a transaction, so the API never creates, edits, or deletes them.

Staff endpoints

  • Authentication: login, logout, profile
  • Member Lookup: find by member ID, 12-digit unique identifier or member number. Email addresses, anonymous member codes and phone numbers are not lookup keys. See Staff endpoint rules
  • Loyalty Operations: add purchase, redeem reward
  • Stamp Operations: add stamps, redeem stamp reward
  • Voucher Operations: validate code, redeem voucher
  • Pass Operations: list a member's passes, sell, use, undo

Member endpoints

  • Authentication: register, login, logout, profile
  • Anonymous Sessions (public, no token): init a device-bound guest, read the session, switch devices with the short guest code. The server issues every device_uuid. Before cutoff, including the notice phase, init can use a submitted device_uuid to find an active guest without an email or recovery protection. session/link-email answers 404: guests add an email in their account. After the guest code cutoff, init answers 400 with requires_login: true and the other session endpoints answer 404
  • Loyalty cards: list all, followed, transacted, balance
  • Stamp cards: list enrolled, history, enroll (add to My Cards), unenroll (remove). History lists every stamp event of the card, newest first, up to 100; notes and staff_name are always null
  • Vouchers: list saved, save (add to My Cards), unsave (remove)
  • Prepaid Passes: list held passes, pass detail (read-only)

Email consent on member create and update. Members carry two email preferences: accepts_loyalty_emails (loyalty updates, defaults to true) and accepts_emails (offers and news, marketing). Passing accepts_emails: true asserts that you hold valid marketing consent from the member. On create, omitting it means false; on update, omitting it leaves the stored preference unchanged. The operator remains responsible for the consent rules in their jurisdiction.

Member profile fields

POST /api/{locale}/v1/member/register accepts these optional fields next to the existing ones. Its response stays the same.

Field Accepts
phone The member's mobile number in E.164 form, such as +5215512345678
phone_country Two-letter country of the number, such as MX. Required with phone, because a dial code such as +1 belongs to several countries
birthday YYYY-MM-DD, before today. Used for birthday rewards
gender male, female, or prefer_not_to_say

The API checks that the dial code belongs to phone_country and that the number has at most 15 digits. Two members can share a phone number. Store a phone number only with the member's agreement. Reward Loyalty does not send text or WhatsApp messages and has no messaging-consent setting, so keep your messaging consent in your own system.

These endpoints return the profile fields and email choices next to the fields they already return:

Endpoint Token Added fields
GET /api/{locale}/v1/member The member's own birthday, gender, phone, phone_country, consents
GET /api/{locale}/v1/partner/members and /partner/members/{id} Partner birthday, gender, phone, phone_country, consents

GET /api/{locale}/v1/member does not return device_uuid or device_code.

gender is male, female, prefer_not_to_say, or null when not set. phone_country is null when there is no phone. consents holds loyalty_emails and marketing_emails, each with state (subscribed or not_subscribed), updated_at, and source. The Agent API Get profile reference describes each value.

Staff endpoint rules

These rules apply to every staff endpoint under /api/{locale}/v1/staff.

Staff, club and business must stay active

Each request checks that the staff member, their club and their business are active and not deleted, and that the club belongs to the staff member's business. If any check fails, the API deletes the token the request used and answers:

HTTP/1.1 401 Unauthorized

{"message": "Unauthenticated."}

Deactivating or deleting the staff member, moving them to another club, or deactivating or deleting their club or business also deletes their tokens at once. A deleted token never works again, even after the account is active again. Sign in through POST /staff/login for a new token.

Member identifiers

Every staff endpoint that names a member, in the path ({identifier}) or in member_id, accepts exactly these values:

Identifier Format
Member ID The member's id, a UUID
Unique identifier The issued 12-digit unique_identifier, with or without its dashes, for example 336-888-662-829
Member number The member's member_number, exactly as stored

The API refuses an email address, an anonymous member's short device code (for example R4K7), a value that matches more than one member, and an inactive or deleted member. A refused value gets the endpoint's not-found answer: 404 on lookups and earning endpoints, valid: false on voucher validation.

A member whose unique_identifier is not the 12-digit issued form cannot be found by it. Use the member's id for those members.

Lookups need a relationship with the club

GET /staff/member/{identifier} and GET /staff/passes/member/{identifier} answer 404 for a member who has no history with the staff member's club. For the passes lookup, holding a pass of that club also counts.

For a first-time customer, call the earning endpoint first, for example POST /staff/stamp-cards/{stampCardId}/stamps with the member's identifier. Earning needs no earlier relationship. The lookups find the member afterwards.

Refused stamp earns

A stamp earn that the card's rules refuse at the moment of earning, for example the daily stamp limit or a card that is no longer available, answers 201 with stamps_added: 0, current_stamps: 0 and card_completed: false. The API records no stamp, and the message field reads "No stamps were added". Read stamps_added before you show a success message.

Database errors

When the database fails, times out on a lock or reports a deadlock, every staff endpoint answers 503 with a neutral message and a Retry-After header: 1 second for lock waits and deadlocks, 5 seconds otherwise.

HTTP/1.1 503 Service Unavailable
Retry-After: 1

{"message": "An error occurred. Please try again."}

Before you repeat a write, check whether the first one took effect. A business rule refusal answers 422 with its message.

Check an existing staff integration

Before you update an installation that a staff integration calls, check the integration against these points:

  1. Look up and address members by id, the 12-digit unique_identifier or member_number. Replace any lookup by email or device code.
  2. If your integration stores a unique_identifier that is not the 12-digit issued form, store and send the member's id instead.
  3. Treat 401 from any staff endpoint as a signed-out token: delete it and sign in again. Do not retry with the same token.
  4. For a first-time customer, earn first and look the member up afterwards.
  5. Read stamps_added on every stamp earn. A 201 with stamps_added: 0 added nothing.
  6. Handle 503 with Retry-After, and check the result before you repeat a write.

Sales that change while they wait

When a referral or a voucher bonus changes during a sale or voucher redemption, Reward Loyalty retries it once on its own. If it still can't complete, it records nothing and answers 503 with Retry-After: 1 and the neutral message An error occurred. Please try again. Send the identical request again. When the card currency changes during a sale, Reward Loyalty does not retry. It records nothing and gives this answer at once. Four endpoints can answer this way:

  • Staff REST POST /staff/cards/{cardId}/purchase
  • Staff REST POST /staff/vouchers/{voucherId}/redeem
  • Partner REST POST /partner/cards/{cardUID}/{memberUID}/transactions/purchases
  • Partner REST POST /partner/cards/{cardUID}/{memberUID}/transactions/points

The Agent API answers 503 TRANSACTION_FAILED with a backoff retry strategy for Agent API purchases without source_reference and for voucher calls. A purchase sent with source_reference answers 503 PURCHASE_RETRYABLE_FAILURE instead.

Card and staff ownership

Partner REST .../transactions/purchases and .../transactions/points only write to a card your business owns. The staffId you send must belong to your business and work in the card's club. When the card is not yours, the API answers 404 with Card not found. When the staff member doesn't match, it answers 404 with Staff member not found or not authorized for this card. In both cases nothing is recorded.

Receipt photos

Partner REST .../transactions/purchases and .../transactions/points accept an optional image file (JPEG, PNG, GIF or WebP, up to 50 MB). The response is the same with or without a photo and does not include it.

If photo storage is not reachable when the request arrives, the API saves no purchase and answers with a server error. Send the request again. If the purchase is saved but adding the photo fails, the purchase stays and the system tries the photo again later. The photo then appears after a later try succeeds. A purchase that is not saved keeps no photo. The system stores the photo also when the customer is deactivated.

Monetary prepaid passes

Pass endpoints default to pass_format=1. That format keeps the visit-pass response shape and omits monetary passes from lists. Reading an owned monetary pass directly returns 409 MONETARY_PASS_FORMAT_REQUIRED. Add ?pass_format=2 to read typed visit and money records. Unsupported or empty format values return 422.

Format 2 includes balance_type, is_unlimited, and a money object for monetary passes. Use the discriminator: a null visit count does not mean a monetary pass is unlimited. Monetary amounts are JSON integers in the currency's minor unit. For EUR, 3750 means €37.50; JPY uses whole yen. Never send a decimal amount or a numeric string.

Partner and staff clients can record an external sale, spend a balance, or reverse one complete spend:

Action Partner path Staff path
Record sale POST /partner/prepaid-passes/{id}/sell POST /staff/passes/sell
Spend POST /partner/member-passes/{id}/spend POST /staff/passes/{id}/spend
Reverse spend POST /partner/member-passes/{id}/transactions/{transactionId}/reverse POST /staff/passes/{id}/transactions/{transactionId}/reverse

These paths follow the /api/{locale}/v1 base URL. Send pass_format=2 in the query and a UUID in the Idempotency-Key header. After a timeout, retry the same key with the same body. The server checks the current token and authority again. A changed body with the same key returns 409 IDEMPOTENCY_CONFLICT; 410 RECORD_REMOVED means the earlier operation was consumed and its result was removed. Do not issue another sale or spend to recover that response.

Member endpoints only read balances and safe history. Refunds and financial-record corrections belong to Partner/admin web oversight. Reward Loyalty records external payment and refund outcomes; it does not collect or send money. See monetary pass setup and the interactive specification for exact request fields.

Business locations

A business owns its locations, and each club uses all of them or one. Owners manage the same list in Business settings. These endpoints need a partner token for the business owner role. Other partner roles get 403.

Method Path Result
GET /partner/business-locations List every location in saved order
GET /partner/business-locations/{location_id} Read one location
POST /partner/business-locations Create a location
PUT /partner/business-locations/{location_id} Change the fields you send
DELETE /partner/business-locations/{location_id} Delete a location

These paths follow the /api/{locale}/v1 base URL. The business comes from the token. location_id is a UUID, and an ID from another business returns 404.

REST and the Agent API share the same fields, limits and rules. The Agent reference lists the fields, weekly hours, order and primary rules and resource fields. The main rules:

  • Create needs only name. A PUT changes only the fields you send, and null or an empty string clears an optional field.
  • Send a JSON body with JSON booleans and integers. Unknown fields return 422.
  • position, is_primary and show_on_business_page set the list order, the primary and business page visibility. The primary must stay on the business page.
  • Send the revision you read as expected_revision to refuse a change when the locations changed in between.
  • The limit is 20 locations per business. Locations above the limit stay readable and editable.
  • A location that a club uses cannot be deleted. When other locations exist, select another primary before you delete the primary.

Create returns 201 with data. Read and update return 200 with data, and delete returns 200 with message. A list returns data, pagination and revision. page defaults to 1, per_page defaults to 25 and stays within 1 to 100, and total counts every location the business owns.

Status Meaning
403 The token's account does not have the business owner role
404 The location does not exist or belongs to another business
409 expected_revision no longer matches. Read the list again
422 An invalid field, the location limit, a primary rule or a club that uses the location, with field errors. A protected business returns code: RESOURCE_PROTECTED

Club endpoints carry each club's choice in business_location_id. GET /partner/clubs and GET /partner/clubs/{clubId} return it. On POST and PUT, send a location UUID for one location or null for All locations. A new club without the field uses All locations, and an update without it keeps the current choice. If a club that used the business address in an earlier version was set to the primary location when the installation was upgraded, it follows the primary unless it is protected: its business_location_id changes when another location becomes primary, until a PUT sends the field. An ID from another business returns 404 and saves nothing. Changing the choice on a protected club returns 422 with code: RESOURCE_PROTECTED.

REST has no replay key or approval step. Deletion runs at once. After a timeout, list the locations before you repeat a create. The Agent API adds retry keys and MCP approval.

Response format

All responses are JSON:

{
  "data": {
    // Response data
  }
}

Error responses include details:

{
  "message": "Error description",
  "errors": {
    "field": ["Validation error"]
  }
}

Rate limiting

The platform rate-limits API requests to prevent abuse. If you exceed limits, the server returns HTTP 429.

Extending the API

As a source code license holder, you can extend the API:

  1. Create controllers in app/Http/Controllers/Api/
  2. Add routes in routes/api.php
  3. Add OpenAPI annotations for documentation
  4. Run php artisan l5-swagger:generate to update docs

For guidance, refer to Laravel's official documentation and the existing API controllers as examples.

What's not included

The following features may require custom development:

  • Tier management endpoints
  • Referral code endpoints
  • Email campaign management
  • Analytics/reporting endpoints
  • Webhook management

These features are available through the web interface and you can expose them via API by extending the existing controllers.