node template app

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.

To implement Billing and Subscription APIs for your Shopify app:

  1. 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.
  2. 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.
  3. 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