This guide covers the Storefront API surface (
/cp/api/...), which is designed for customer-facing storefront code.
If you are building a server-side integration, see the Integration guide instead — it covers the Admin API (/api/external/v2/..., authenticated with X-API-Key).When to build your own vs. use the widget
The Appstle subscription widget (appstle-subscription.js) is injected automatically on your storefront and handles selling-plan rendering, cart integration, and the customer portal out of the box. Build your own frontend when you need:
- A product page UI that doesn’t match what the widget renders (custom layout, framework-specific components, headless storefronts)
- A customer portal embedded in your own account page design rather than the default portal
- Programmatic control over subscription flows (e.g. a React/Vue app that manages state itself)
Architecture overview
Appstle’s Storefront APIs are served through Shopify’s App Proxy. When a request hits your shop’s domain at the proxy path, Shopify forwards it to Appstle’s backend with authentication parameters attached./apps/subscriptions. Merchants can customize this in their Shopify admin, but apps/subscriptions is the standard default.
Authentication
The Storefront API does not use API keys. Authentication depends on the context:
A few portal endpoints work without a logged-in customer (portal settings, custom CSS, magic link emails). Everything else — viewing contracts, skipping orders, updating addresses — requires the customer to be authenticated through a Shopify session.
Product page: rendering selling plans
On product pages, you typically don’t need the Storefront API at all. Shopify’s native Liquid and Product JSON already include the selling plan data that Appstle configures.Getting selling plan data from Shopify Liquid
Every Shopify product with subscription selling plans exposes them in theselling_plan_groups array:
Getting selling plan data from Shopify Product JSON
For headless or JavaScript-driven storefronts, fetch the product JSON directly:Getting selling plan data from the Appstle Storefront API
For richer subscription data (beyond what Shopify’s native objects provide), use the Appstle endpoint:variantIds for variant-specific data:
For product pages visited by unauthenticated customers, prefer Shopify’s native Liquid objects or Product JSON.
The
/cp/api/data/ endpoints go through the App Proxy and may require a customer session depending on the shop’s configuration.Adding a subscription to cart
Adding a subscription item to the Shopify cart uses Shopify’s standard Cart API — you include theselling_plan ID alongside the variant ID.
Using the Cart AJAX API
Using a form
If you prefer a traditional form submission:Customer portal: managing subscriptions
Once a customer is logged in, you can call the Storefront API through the App Proxy to build a custom subscription management UI. All of these endpoints are under:Identifying the logged-in customer
401 if no customer is logged in.
Listing a customer’s subscriptions
Get the full subscription profile (active, paused, and cancelled contracts):Viewing upcoming and past orders
Upcoming orders for a contract:Updating subscription status
Pause, resume, or cancel a subscription:pauseReason, pauseFeedback, pauseDurationCycle.
Skipping and unskipping orders
Managing line items
Add a product:Discounts
Apply a discount code:Updating shipping address
application/json):
Changing billing date
Changing frequency
Switch to a compatible selling plan frequency:Portal settings and styling
To load the merchant’s portal configuration (labels, features, display settings):For the full list of Storefront API endpoints with request/response schemas, see the
Storefront API group in the sidebar.
Using JavaScript widget events
Even when building a custom UI, the Appstle widget script (appstle-subscription.js) is still loaded on your storefront. It dispatches events on both document and window that you can use to coordinate your custom components with Appstle’s cart and portal logic.
Key events for custom frontends
For the full event reference, see JavaScript hooks.
Listening to events in your custom UI
Widget initialization event
Theappstle:subscription-widget:loaded event fires when the widget script has fully initialized. Its detail includes a reference to the widget API:
End-to-end example: custom product page subscription UI
This example shows how to render selling plans, let the customer select one, and add a subscription to cart — all without using the default widget UI.This example uses Shopify’s native product data and Cart API. It works independently of the Appstle widget.
If the widget is also loaded on the page, it will fire
AddToCartIntent and SellingPlanSelected events that your other components can listen to.Further reading
Webhooks
Receive real-time events when subscriptions change.
JavaScript hooks
Complete list of widget events you can listen to.
Authentication
Admin API keys, partner keys, and storefront auth details.
Integration guide
Server-side Admin API integration for backend developers.