Skip to main content
This guide walks you through the three steps needed to make your first Appstle Loyalty API calls: getting a key, reading a customer’s loyalty data, and adding points. By the end you will have a working integration you can build on.

Prerequisites

  • An Appstle Loyalty plan that includes API access (see Authentication)
  • Access to the Appstle admin panel
  • A Shopify customer ID to test with (find one in your Shopify admin under Customers)

Step 1 — Get your API key

1

Open API Integrations

In your Appstle admin panel, go to More → API Integrations.
2

Create a key

In the API Keys section, click Create API key. Give it a name like Quickstart test, keep the Read & write permission, then click Create.
3

Copy the key

Copy the displayed key immediately. It is only shown once. Store it as an environment variable:
Never put your API key in client-side code. All requests must be made from a server you control.

Step 2 — Retrieve customer loyalty data

Call GET /api/external/customer-loyalty with a Shopify customer ID in the customerId parameter. Your API key identifies the store. Replace 12345 with a real customer ID from your store.
curl
A successful response looks like this:
If you get a 400 with Customer not found using this customerID, the customer isn’t enrolled in the loyalty program yet. Enroll the customer first.

Step 3 — Add points to the customer

Call POST /api/external/add-points to credit points. Include a note so the transaction is clearly labeled in the customer’s history.
curl
Call GET /api/external/customer-loyalty again and you will see availablePoints increased by 100.

Troubleshooting

The X-API-Key header is missing, the key is unknown or revoked, or the store’s plan doesn’t include API access. A key from another Appstle app is unknown here too. The 401 body is the same for every cause, so check the header name and value, create a new key if the old one was revoked, and confirm the store’s plan includes API access. Authentication errors lists each cause and its fix.
A Read only key gets 403 on every write request, such as add-points in Step 3. Create a key with the Read & write permission. A 403 whose detail is Shop does not match the authenticated session means a shop value in the request isn’t the key’s store: drop the shop parameter, since your key already identifies the store. Authentication errors has the details.
A 400 whose title is Customer not found using this customerID means the customer isn’t enrolled in the loyalty program, or the ID doesn’t belong to any customer in the store. Check the ID in Shopify admin, enroll the customer, then call the endpoint again. A customerId that isn’t a number, such as an email address or a gid:// ID, also returns 400. Use the number at the end of the customer’s page address in Shopify admin, or the last part of its gid:// ID, such as 1234567.
The path or the method doesn’t match an endpoint. A GET to a path that has no GET endpoint returns 404, and a POST, PUT or DELETE to a path that doesn’t take that method returns 405. Check the path and the method against the API reference.
The request went over a rate limit. If the response has a Retry-After header, the store has used its daily call allowance: wait that many seconds, until 00:00 UTC, before you call again. Otherwise, retry with exponential backoff. Rate limits shows the response for each of the three limits.

Next steps

Integration guide

Every endpoint: point management, customer enrollment, rewards, store credits, and program configuration.

Webhooks

Receive real-time notifications for points earned, VIP tier changes, and referral completions.

Shopify Flow

Trigger loyalty actions from any Shopify Flow workflow without writing API code.