Skip to main content
Every Admin API request must carry a valid API key. Keys are created in your Appstle dashboard and scoped to a single Shopify store. There is no OAuth flow — authentication is a single header on every request.

Creating an API key

Before you start, check two things:
  • The store’s plan includes API access. Any plan can open More → API Integrations and create a key, but requests with a key created in the app return 401 until the store’s Appstle Loyalty plan includes API access. It’s included in the Enterprise plan and available as an add-on on other plans: contact support@appstle.com to add it. Without it, the External APIs card on the API page shows an upgrade notice. Scoped partner tokens don’t need it (see Partner integrations).
  • You can open API Integrations. The store owner, staff with Full access in Shopify, and staff the owner has authorized can view and create keys. Anyone else sees the message “API keys can only be managed by the store owner or full-access staff.” The owner authorizes staff under More → Advanced Settings → Account Ownership Settings, by adding their user IDs to Specific User IDs or by checking Authorize All Staff Members.
Find your user ID in the app, not in Shopify’s address bar. The API page doesn’t show your user ID. To find it, open the app’s Customers page and hover over the greyed-out Export button. The tooltip reads “Your user ID 123456789012 isn’t allowed yet.” Send that number to the store owner, who adds it to Specific User IDs exactly as shown. Once they save, reload the app. The number in the address bar of a staff member’s page in Shopify admin can differ from the ID the app checks. If the owner adds that number instead, you stay locked out.
1

Open API Integrations

Log in to your Appstle admin panel and navigate to More → API Integrations. Your keys are in the API Keys section.
2

Create a new key

Click Create API key, enter a Key name that identifies the integration — for example, Klaviyo sync, Mobile app, or Internal dashboard — choose a Permission (see Key permissions), and click Create. Good names make it easy to audit and revoke keys later.
3

Copy the key immediately

The full key value is shown only once. Copy it and store it in your secrets manager or environment variable before leaving the page. If you navigate away without copying it, you must create a new key.
4

Store the key securely

Add the key to your application as an environment variable:
Never hard-code the key in source code or commit it to version control.
API keys grant access to your store’s loyalty data, and a Read & write key can change it. Treat keys like passwords. Never expose them in client-side JavaScript, browser extensions, or public repositories.

Key permissions

The Create API key dialog offers two permissions. Read & write is selected by default. Use Read only for reporting and one-way syncs, such as pulling points balances into a data warehouse. Use Read & write for integrations that change loyalty data, such as adding points or enrolling customers. A read-only key gets 403 Forbidden on any other method, before the request reaches the endpoint:
Each key in the API Keys list shows a Read only or Read & write badge. You can’t change a key’s permission after you create it: create a new key with the permission you need, move your integration to it, and revoke the old key. The key shown under Legacy API Key always has Read & write access. A scoped partner token has the permission set for the partner during onboarding (see Token properties), and a read-only token gets the same 403.

Sending the API key

Include your key in the X-API-Key header on every Admin API request.
You can also pass the key as the api_key query parameter, but use the header: URLs end up in logs. The query parameter form:
Create one API key per integration. If a single key is compromised or a tool is decommissioned, you can revoke it without disrupting your other integrations.

Key management

You can create up to 10 active API keys per store. Each key has:
  • A display name you choose at creation time
  • A Read only or Read & write permission
  • A last-used timestamp so you can identify stale keys
  • Individual revocation — revoking one key does not affect others
Every store also has one key the app created for it, shown on the Legacy API Key card under More → API Integrations. It keeps working until you revoke it with the Revoke button on that card. A revoked legacy key gets the same 401 as any wrong key, and Appstle doesn’t issue a replacement, so move your integration to an apst_ key before you revoke it. When a merchant uninstalls the app, Appstle deletes the store’s app data, including the legacy key and every apst_ key. Requests that send them get the same 401 as any wrong key. Reinstalling doesn’t bring them back: the app issues a new legacy key, and your integration needs a new apst_ key. A reinstall also starts the store on a new Appstle plan, so the new key gets 401 until that plan includes API access (see Creating an API key).

Rotating a key safely

1

Create the replacement key

Go to More → API Integrations and create a new key with the same or updated name.
2

Update your integration

Deploy the new key value to your application and verify it works.
3

Revoke the old key

Return to the dashboard and revoke the old key. Revocation is immediate.

Authentication errors

A request that fails authentication returns 401 Unauthorized with Content-Type: application/json:
The body is the same for every cause, so check these in order:
  • Missing key. Send the key in the X-API-Key header on every request.
  • Unknown key. Check the key for typos and stray whitespace. Each Appstle app issues its own keys, so a key from another Appstle app is unknown here. Uninstalling the app deletes every key, so after a reinstall, create a new key.
  • Revoked key. Create a new key and update your integration. A revoked legacy key gets the same response.
  • No API access on the plan. Contact support@appstle.com to add API access to the store’s plan. Scoped partner tokens don’t need it.
A Read only key that sends a write request gets 403 Forbidden instead (see Key permissions). Use a Read & write key. A 403 also means a shop value in the request doesn’t match the key’s store: drop the shop parameter, since your key already identifies the store.

Rate limits

A request over a limit returns 429 Too Many Requests. The limits are the per-minute rate limit, five PUT calls in progress at once for the store, and the store’s daily call allowance. Rate limits in the integration guide shows the response for each limit and how to retry it.

Partner integrations

If you are building an app that connects to multiple merchants’ stores, use the Partner Integration Framework instead of asking merchants to share API keys manually. The framework:
  • Provisions a scoped apst_ token per merchant through the connection handshake
  • Lets merchants approve, review, and revoke access from their own dashboard
  • Bypasses the paid API plan — merchants are never charged for partner API usage
  • Revokes tokens automatically when a merchant disconnects or uninstalls Appstle
Once a merchant approves the connection, send their scoped token as X-API-Key, exactly like a regular API key. See the Partner integration guide for the complete connection flow.

Storefront API authentication

The Storefront API doesn’t use API keys, and it isn’t Shopify’s Storefront GraphQL API. It serves the customer portal endpoints. Call it from the storefront while the customer is signed in, on the store’s own domain, by default under /apps/loyalty/cp/api/. Shopify’s App Proxy forwards each request to Appstle with the signed-in customer’s identity, so you don’t send a credential yourself. Accept referral offer is an exception: it also works for a shopper who isn’t signed in, because it identifies the friend by the email in the request. A request that isn’t a GET, HEAD or OPTIONS must also send X-Requested-With: XMLHttpRequest, or it gets 401. See the Storefront API reference in the sidebar for the endpoints.

Next steps

Quickstart

Get a customer’s points and VIP tier, then credit points to their account.

Admin API integration guide

Manage points, enrollment, referrals, rewards and store credits from your server.

Build your own frontend

Show a customer’s points, rewards and referrals in your own theme.

Partner integration

Connect your platform and receive scoped API tokens for merchants.