I have developed a Shopify app on my local system and integrated a subscription plan. The app is built using the Node.js template, not Remix. I need guidance on implementing the Billing and Subscription APIs, understanding how app payments are managed, and setting up these APIs effectively. Additionally, I seek clarity on whether the APIs used are REST or another type.
Topic summary
A developer has built a Shopify app locally using the Node.js template (not Remix) and needs help implementing subscription plans. They’re seeking guidance on Billing and Subscription APIs, payment management, and API setup.
Key Implementation Details:
- Shopify’s billing uses GraphQL (not REST)
- Primary mutations include:
appSubscriptionCreatefor recurring subscriptionsappPurchaseOneTimeCreatefor one-time chargesappSubscriptionCancelfor cancellations
Setup Process:
- Create subscription plan and redirect merchants to
confirmationUrlfor approval - After approval, Shopify redirects to
returnUrlwhere subscription details should be activated and stored - Use webhooks (e.g.,
APP_SUBSCRIPTIONS_UPDATE) to monitor subscription changes
Important Notes:
- Use
test: trueduring development - Shopify handles payment processing and deducts fees before merchant payout
- Refer to GraphQL Admin API documentation for detailed implementation
To implement Billing and Subscription APIs for your Shopify app:
-
Use GraphQL for Billing:
- Shopify’s billing APIs use GraphQL (not REST). Key mutations:
- appSubscriptionCreate: Create recurring subscription plans.
- appPurchaseOneTimeCreate: For one-time charges.
- appSubscriptionCancel: Cancel subscriptions.
- Shopify’s billing APIs use GraphQL (not REST). Key mutations:
-
Steps to Set Up:
- Use appSubscriptionCreate to define the plan. Redirect merchants to the returned confirmationUrl for approval.
- After approval, Shopify redirects to your returnUrl. Activate and store the subscription details.
- Use webhooks (e.g., APP_SUBSCRIPTIONS_UPDATE) to track subscription changes.
-
Key Notes:
- Always use test: true during development.
- Shopify manages payments, deducting their fee before payout.
- Reference the GraphQL Admin API Docs for detailed queries.
Let me know if you need further clarification!
1 Like