Skip to main content
This guide takes you from a new API key to your first Memberships Admin API calls: you list the store’s membership contracts, then check whether a customer is an active member.

Before you begin

  • Appstle Memberships is installed on your Shopify store.
  • The store’s Appstle plan includes API access. Without it, every request in this guide returns 401.
  • You can open API Access in the app: you’re the store owner, staff with Full access, or staff the owner has authorized.
Creating an API key explains both requirements.

Step 1 — Create an API key

1

Open API Access

In your Appstle admin panel, go to More → General Settings → API Access.
2

Create a key

Click Create API key. Name it Quickstart Test, choose Read only under Permission (this guide only reads data), and click Create.
3

Copy the key

Your key is shown only once. Copy it now — you cannot retrieve the full value again after leaving this screen.Your key will look like this:
Never use your API key in client-side code or commit it to a public repository. Store it in an environment variable and read it at runtime.

Step 2 — List membership contracts

Use your new key to list the store’s membership contracts. The key identifies the store, so you don’t pass a shop domain.
A successful response is a JSON array of contracts, trimmed here to one contract and a few fields. The total number of matching contracts is in the x-total-count response header:
Each contract has more fields than shown, such as cancelledOn, pausedOn and contractAmount. See the API reference for all of them. Page through the list with page (starting at 0) and size (default 20).
A store with no matching contracts returns an empty array ([]) and x-total-count: 0. Create a test membership in your store first if you see this on a new store.

Step 3 — Check whether a customer is an active member

To check a customer before you grant access to gated content, filter the same endpoint by the customer’s email address and status=ACTIVE:
customerName matches any part of a name or email, so a search for taylor@example.com also returns mtaylor@example.com. Treat the customer as an active member only if a returned contract’s customerEmail equals the address you searched for, ignoring case. If one does, grant access to the gated content. If none does, send the customer to your membership plans.

Troubleshooting

The detail field in the response says which check failed: the key is missing, unknown or revoked, or the store’s plan doesn’t include API access. A key from another Appstle app is unknown here too. Authentication errors lists each message and its fix.
A Read only key gets 403 on every write request and on the few GET endpoints listed under Key permissions. Create a key with the Read & Write permission. Both calls in this guide work with either 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.
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.
No contract matches your filters. Remove status and customerName to list every contract, or create a test membership in your store.
The store went over the per-minute rate limit, or more than five PUT calls were in progress at once. The response has no Retry-After header, so retry with exponential backoff, never immediately. Rate limits shows the response for each case.

Next steps

Integration guide

Check active members, list plans, and pause, resume or cancel a membership.

Authentication

Key permissions, partner tokens and every authentication error.

Membership contract list

Every filter and response field of the endpoint you just called.

Webhooks

Receive real-time events when memberships are created, cancelled, or renewed.