Skip to main content
This guide walks you through the three steps needed to make your first successful API call: creating an API key, sending an authenticated request, and reading the response. By the end you will have verified that your credentials work and seen what subscription data looks like.
You need an active Appstle Subscriptions installation on a Shopify store to follow this guide. If you do not have one yet, install the app from the Shopify App Store first.

Step 1 — Get your API key

1

Navigate to API Access

Log in to your Appstle admin panel and go to More → API Access.
2

Create a key

Click Create API key. Give it a name like Quickstart Test so you can identify it later, then click Create key.
3

Copy the key

The key is shown only once. Copy it now — you cannot retrieve it again. It will look like apst_abc123....
Keep this key secret. Do not commit it to source control or include it in client-side code. For production use, store it in an environment variable or a secrets manager.

Step 2 — Make your first request

The simplest useful call lists the subscription contract IDs of one customer. Replace YOUR_API_KEY with your key and CUSTOMER_ID with a numeric Shopify customer ID from your store.
curl

Step 3 — Check the response

A successful response returns an HTTP 200 with a JSON array of Shopify subscription contract IDs for that customer:
The array holds every contract ID the customer has, active or not. An empty array means the customer has no subscriptions. If you get an error instead, see Troubleshooting.

Step 4 — Retrieve full subscription details

Now that you have a contract ID, filter the contract list by it. The response is an array, so use the entry whose subscriptionContractId equals your ID:
curl
Each entry includes the subscription’s status, nextBillingDate and contractAmount, the customer’s customerName and customerEmail, and its products in contractDetailsJSON, a JSON array encoded as a string. For line IDs and discounts, read the raw Shopify contract with GET /subscription-contracts/contract-external/{contractId}.

Troubleshooting

The X-API-Key header is missing, the key is wrong or revoked, or the store’s plan doesn’t include API access. A key from another Appstle app is wrong here too. The 401 body is the same for every cause, so check the header name and value, create a new key if the old one was revoked, and confirm the store’s plan includes API access. Authentication errors lists each cause 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 customer ID in the path isn’t a number. An email address or a gid://shopify/Customer/1234567 ID returns 400. Use the number at the end of the customer’s page address in Shopify admin, or the last part of its gid:// ID, such as 1234567. If the body’s status is 500, the call failed on the server: see HTTP status codes.
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.
The customer has no subscriptions, or the ID doesn’t belong to any customer in the store: both return [], not an error. Check the number against the customer’s page in Shopify admin.
The store went over a rate limit. Wait at least the number of seconds in the Retry-After header, then retry, and back off further if the 429 comes back. Rate limits lists the limits and what counts toward each.

Next steps

Integration guide

Full walkthrough of subscription management, product operations, discounts, shipping, and more.

Webhooks

Receive real-time notifications when subscriptions change.

Shopify Flow

Automate subscription workflows without writing backend code.