For the complete documentation index, see llms.txt. This page is also available as Markdown.

Loyalty for developers

Read a store's loyalty program, members and orders over the Shopwaive REST API. Adding points from your own systems or from Shopify Flow is switched off

Shopwaive API keys and scopes

Create a key under Settings > Developers > Shopwaive API keys in Shopwaive, and choose what it may do when you make it. A key belongs to one store and works only for that store. It can call a loyalty route only when it holds the route's scope, and a key made before scopes existed holds none.

Scope
What it allows

members:read

Read members and their points.

reports:read

Read loyalty reports, such as the program and its tiers.

points:write

Add or remove points. Switched off: see below.

activities:write

Record ways to earn, such as a review. Switched off.

members:write

Change a member's tier or birthday. Switched off.

events:manage

Manage loyalty webhooks. Switched off.

Send the key in the X-Shopwaive-Access-Token header, as for every Shopwaive API request. The loyalty routes also take it in the X-Shopwaive-Api-Key header, or as Authorization: Bearer followed by the key. The same reads are on api.shopwaive.com.

REST API: loyalty reads

The reads are at https://app.shopwaive.com.

Request
What it returns
Scope

GET /api/loyalty/program

The program Shopwaive runs at the store.

members:read or reports:read

GET /api/loyalty/tiers

The tier table of the program version Shopwaive runs.

members:read or reports:read

GET /api/loyalty/members/{customer}

One member: their standing and their balance.

members:read

GET /api/loyalty/members/{customer}/activity

The member's balance history, newest first.

members:read

GET /api/loyalty/orders/{order}

One order's loyalty record: the points it added, and any points taken back.

members:read

{customer} and {order} are Shopify ids. Each key can make 20 read requests a second, with short bursts up to 40. A request over the limit is answered with the time to wait before the next one.

Adding or removing points: switched off

Adding or removing points from your own systems is switched off, over the REST API or from Shopify Flow:

  • A request to POST /api/loyalty/points is refused, and nothing changes.

  • Shopify Flow lists Shopwaive's loyalty actions, such as Adjust loyalty balance. A workflow step that uses one stops with a message saying so, and nothing changes.

  • Shopify Flow also lists Shopwaive's loyalty triggers. A workflow built on one does not start.

Your loyalty program pays points on orders by itself, with no workflow. To deposit to a balance from Shopify Flow today, use the Increment balance action: see Shopify Flow. Its deposits are not part of your loyalty program, so Shopwaive does not take them back on a refund.

Customer account and checkout extensions

Shopwaive's own customer account blocks read the signed-in customer's figures from two routes, with the Shopify session token of the extension (shopify.sessionToken.get()) as Authorization: Bearer:

  • GET /api/loyalty/storefront/member: the customer's own standing.

  • GET /api/loyalty/storefront/orders/{order}: the points of one of the customer's own orders.

A session token names its store and its customer, so a customer only ever reads their own figures.

Last updated