Go from zero to your first Memberships API response in minutes: create an API key, retrieve a customer’s membership contracts, and check active status.
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.
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.
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"
const res = await fetch( 'https://membership-admin.appstle.com/api/external/v2/membership-contracts' + '?shop=your-store.myshopify.com&customerId=12345', { headers: { 'X-API-Key': process.env.APPSTLE_API_KEY }, });const data = await res.json();console.log(data);
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.
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.
400 Bad Request
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.
Empty content array
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.
429 Too Many Requests
You have exceeded the rate limit for your store. Implement exponential backoff and retry after a short delay.