Skip to main content

Documentation Index

Fetch the complete documentation index at: https://appstleinc-aeca3e0a.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through the three steps you need to make your first successful Appstle Memberships API call: get an API key, retrieve membership contracts, and verify a customer’s membership status.

Before you begin

You need an active Appstle Memberships installation on your Shopify store. If you haven’t installed the app yet, start in the Shopify App Store before continuing.

Step 1 — Create an API key

1

Open API Key Management

In your Appstle admin panel, go to Settings → API Key Management.
2

Create a key

Click Create New Key. Give it a name like Quickstart Test so you can identify it later.
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:
apst_AbCdEfGhIjKlMnOpQrStUvWxYz123456789012
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 — Retrieve membership contracts

Use your new key to fetch all membership contracts for a customer. Replace your-store.myshopify.com with your store’s Shopify domain and 12345 with a real Shopify customer ID.
curl -X GET \
  "https://membership-admin.appstle.com/api/external/v2/membership-contracts?shop=your-store.myshopify.com&customerId=12345" \
  -H "X-API-Key: apst_your-api-key-here"
A successful response looks like this:
{
  "content": [
    {
      "id": 1001,
      "status": "ACTIVE",
      "membershipPlanName": "Gold Member",
      "nextBillingDate": "2026-03-01",
      "billingCycleType": "MONTHLY",
      "startDate": "2026-01-01",
      "endDate": null
    }
  ],
  "totalElements": 1
}
The content array contains each membership contract for the customer. totalElements tells you how many contracts exist in total (useful for pagination).
If content is an empty array, the customer either has no memberships or no active ones. Try with a customer ID that you know has an active membership in your store.

Step 3 — Check member status

To quickly verify whether a customer is an active member — for example, before granting access to gated content — call the membership status endpoint:
curl -X GET \
  "https://membership-admin.appstle.com/api/external/v2/membership-status?shop=your-store.myshopify.com&customerId=12345" \
  -H "X-API-Key: apst_your-api-key-here"
In your integration, check the contract status field from the contracts endpoint:
const isActiveMember = data.content.some(contract => contract.status === 'ACTIVE');

if (isActiveMember) {
  // Grant access to gated content
} else {
  // Redirect to membership plan selection page
}

Troubleshooting

Your API key is invalid, missing, or was revoked. Double-check the X-API-Key header value. Make sure there is no extra whitespace and that the key belongs to the correct store.
A required query parameter is missing or malformed. Confirm that shop is your full .myshopify.com domain and that customerId is a numeric Shopify customer ID.
The customer exists but has no memberships. Use a different customer ID, or log in to your Appstle dashboard and confirm which customers have active contracts.
You have exceeded the rate limit for your store. Implement exponential backoff and retry after a short delay.

Next steps

Integration Guide

Full patterns for CRMs, email platforms, access control, and analytics integrations.

Webhooks

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