Skip to main content
Every Admin API request must include a valid API key in the request header. Keys are created and managed directly in your Appstle dashboard, scoped to a single Shopify store, and can be revoked individually without affecting your other integrations.

Creating an API key

Before you start, check two things:
  • The store’s plan includes API access. Any plan can open More → General Settings → API Access and create a key, but requests with a key created in the app return 401 until the store’s Appstle plan includes API access. Without it, the API Access page shows an upgrade notice: click Chat with us in that notice to add API access. Scoped partner tokens don’t need it (see Partner integrations).
  • You can open API Access. The store owner, staff with Full access in Shopify, and staff the owner has authorized can view and create keys. Anyone else sees a message with their user ID instead of the key list. The owner authorizes staff under More → General Settings → Shop Settings → Account Ownership Settings, by adding their user IDs to Allow Export To Escalated User IDs or by checking Authorize All Staff Members. Use the ID exactly as that message shows it. If it differs from the number in the address bar of the staff member’s page in Shopify admin, only the ID in the message works.
1

Open API Access

Log in to your Appstle admin panel and navigate to More → General Settings → API Access.
2

Create a new key

Click Create API key, enter a Key name that identifies the integration — for example, Klaviyo Integration, Mobile App, or Zapier Workflow — choose a Permission (see Key permissions), and click Create.
3

Copy the key immediately

Your new key is displayed only once. Copy it now and store it in a secure location such as an environment variable or a secrets manager. You cannot retrieve the full key value again after leaving this screen.
4

Use the key in your requests

Pass the key in the X-API-Key header of every Admin API request.
Never expose your API key in client-side JavaScript, browser applications, or public source code repositories. API keys must only be used in server-side code.

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 members into a data warehouse. Use Read & Write for integrations that change memberships, such as updating a contract. A read-only key gets 403 Forbidden on any other method:
It gets the same 403 on these GET endpoints, because they send email, issue customer portal links and tokens, or return a customer’s payment tokens:
  • /api/external/v2/customer-portal-token
  • /api/external/v2/manage-subscription-link/{customerId}
  • /api/external/v2/subscription-contracts-email-magic-link
  • /api/external/v2/customer-payments/token/{customerId}
Each key in the API Access 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 has Read & Write access until the merchant revokes it. A scoped partner token has the permission set for the partner during onboarding (see Token properties).

Sending the API key

Include your key in the X-API-Key request header:

Deprecated query parameter

The api_key query parameter still works, but it’s deprecated because URLs end up in logs. Use the X-API-Key header in new integrations. The deprecated form:

Key format

Keys you create in the app start with apst_:
Every store also has one key the app created for it, shown under Legacy API Key. It authenticates the same way, with the X-API-Key header. The app shows only its last four characters, so if your integration doesn’t already use it, create an apst_ key instead. When you revoke the legacy key, it stops working immediately, and requests that send it get the Invalid API key. response described under Authentication errors. You can’t undo the revoke, and the app doesn’t issue a replacement, so move your integration to an apst_ key first. When a merchant uninstalls the app, Appstle deletes the store’s app data, including the legacy key and every apst_ key. A deleted apst_ key gets the unknown-key response and the deleted legacy key gets Invalid API key., both described under Authentication errors. 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).

Key management

You can create up to 10 active API keys per store. Managing keys from the dashboard gives you fine-grained control over which integrations can access your membership data.
Create a separate API key for each integration. This way you can revoke access for a single integration without disrupting others — for example, if a third-party tool is compromised or decommissioned.

Storing keys securely

Store your API key as an environment variable and read it at runtime. Never hardcode it in your source files.

Authentication errors

A request that fails authentication returns 401 Unauthorized with Content-Type: application/problem+json. This is the body for a key that doesn’t exist:
The detail field tells you which check failed:
  • Missing key. detail is API key can not be blank. Send the key in the X-API-Key header on every request.
  • Unknown key. detail is Invalid API key. This key was not recognized. Verify it matches the active key shown under API Access settings. 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. detail is This API key has been revoked. Generate a new key under API Access settings. Create a new key and update your integration.
  • No API access on the plan. detail is You do not have permission to access the External API. Please contact the Appstle Membership Support team. Click Chat with us in the upgrade notice on the API Access page to add API access to the store’s plan. Scoped partner tokens don’t need it.
  • Unknown or revoked legacy key. detail is Invalid API key. The key doesn’t start with apst_ and isn’t the store’s active legacy key. Create an apst_ key.
A Read only key that sends a write request, or calls one of the GET endpoints listed under Key permissions, gets 403 Forbidden instead: use a Read & Write key. If the detail is Shop does not match the authenticated session, a shop value in the request isn’t the key’s store: drop the shop parameter, since your key already identifies the store.

Partner integrations

If you are building a product that integrates with Appstle Memberships on behalf of multiple merchants (a CRM, helpdesk, email platform, or automation tool), use the Partner Integration Framework. Merchants connect your app with one click — no manual key exchange — and Appstle issues your app a scoped apst_... token for each approved store. Send the merchant’s scoped token as X-API-Key, exactly like a regular API key. Tokens are revoked automatically when a merchant disconnects or uninstalls Appstle. To get onboarded, email support@appstle.com with your company name, product description, base URL, and contact email.
Scoped partner tokens work whether or not the store’s plan includes API access, so merchants can use an approved partner integration on any plan. Direct API access without a partner connection requires a plan that includes API access.

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/memberships/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. A call without a signed-in customer gets 401, except on the few GET endpoints that work without one, such as portal settings. A request sent straight to membership-admin.appstle.com has no App Proxy signature and gets 401 too. See the Storefront API reference in the sidebar for the endpoints.