---
title: "Shopify Subscriptions API & Selling Plans Tutorial (2026)"
description: "Learn how Shopify SellingPlanGroup, SubscriptionContract, and SubscriptionBillingAttempt work—plus when to build custom vs. flat-fee native subscriptions."
url: "https://chargezen.com/blog/shopify-subscriptions-api-tutorial"
lang: "en"
updated: "2026-11-29"
---

Canonical URL: https://chargezen.com/blog/shopify-subscriptions-api-tutorial

# Shopify Subscriptions API and Selling Plans: Complete Setup Tutorial

Ryan Cooper

Subscriptions Solutions Lead, Chargezen

Nov 29, 2026 · 2 min read

The Shopify Subscriptions API lets apps and Shopify Plus engineering teams manage recurring billing natively inside Shopify Checkout using three core GraphQL objects: **SellingPlanGroup**, **SubscriptionContract**, and **SubscriptionBillingAttempt**. Instead of routing shoppers to an off-site checkout, every recurring order runs through Shopify Payments, Shop Pay, and standard Shopify Discounts.

If you do not want to build and maintain your own webhook workers, dunning scheduler, and customer portal on top of the API, **ChargeZen Subscriptions** runs directly on these native Shopify contracts for **$199/month ($1,990/year)** with **0% transaction fees**, bundling **ChargeZen Concierge** (AI agents) and **CheckoutOS**.

## Core Shopify Subscriptions API Primitives

| GraphQL Object | Responsibility | Key Mutations / Webhooks |
| --- | --- | --- |
| SellingPlanGroup | Defines billing intervals, delivery cadence, and subscribe-and-save discounts on products | sellingPlanGroupCreate, sellingPlanGroupAddProducts |
| SubscriptionContract | Stores one customer's active recurring agreement, line items, and payment method token | subscriptionContractUpdate, subscription\_contracts/create |
| SubscriptionBillingAttempt | Triggers an off-session renewal charge and creates a Shopify Order on success | subscriptionBillingAttemptCreate, subscription\_billing\_attempts/failure |
| CustomerPaymentMethod | Holds the vaulted Shopify Payments / Stripe / PayPal token for renewals | customerPaymentMethodSendUpdateEmail |

## Step-by-Step Implementation Checklist

*   **Request the required OAuth scopes** : Your app needs `read_own_subscription_contracts`, `write_own_subscription_contracts`, `read_customer_payment_methods`, and `read_products`.
*   **Create a \`SellingPlanGroup\`** : Attach billing policy (`RECURRING` or `PREPAID`), delivery interval (`WEEK`, `MONTH`), and pricing policy (percentage or fixed discount) to product or variant IDs.
*   **Render the selling plan selector on the storefront** : Pass the chosen `selling_plan` ID in the standard Shopify `/cart/add.js` payload so Shopify Checkout displays the recurring terms automatically.
*   **Subscribe to contract webhooks** : Listen to `subscription_contracts/create` and `subscription_contracts/update` to persist `nextBillingDate` and schedule your billing worker.
*   **Run idempotent billing attempts** : Pass a deterministic `idempotencyKey` (contract ID + billing cycle date) to `subscriptionBillingAttemptCreate` so retries never double-charge a subscriber.
*   **Handle failures with smart dunning** : On `subscription_billing_attempts/failure`, inspect `errorCode` (soft decline vs. expired card), schedule spaced retries, and send a passwordless card-update link.

## Build Custom vs. Use a Flat-Fee Native Platform

Building directly on the Shopify Subscriptions API works when you have dedicated backend engineers and custom ERP requirements. Most Shopify Advanced and Plus brands underestimate the ongoing cost of maintaining passwordless portals, cancel-flow save offers, cohort analytics, and dunning retries.

Using a percentage-fee app like Recharge Scale ($499/month + 1.25% + $0.20/order = $55,488/year at 5,000 orders/month and $50 AOV) solves the build cost but taxes every renewal. **ChargeZen Subscriptions** gives you native Shopify contracts, API access, smart dunning, cancel flows, plus **Concierge AI** and **CheckoutOS** for a flat **$199/month ($1,990/year)** with **0% commission**. See [/compare/recharge](https://chargezen.com/compare/recharge) and [/compare/recurly](https://chargezen.com/compare/recurly).

## Frequently Asked Questions

## Does Shopify require Shopify Payments for the Subscriptions API?

Shopify supports Shopify Payments, PayPal Express, Authorize.net, and Stripe (for eligible merchants) for native Subscription Contracts.

## Can we migrate existing Recharge or Skio contracts onto native Shopify contracts?

Yes. ChargeZen includes free white-glove migration that imports active subscribers and vaulted payment tokens onto native Shopify contracts without forcing customers to re-enter cards.

Written by

## Ryan Cooper

Subscriptions Solutions Lead, Chargezen

Ryan leads subscriptions solutions at Chargezen, and writes about the systems and strategies behind modern subscription businesses. His writing explores recurring billing, subscription lifecycle management, payment recovery, pricing optimization, and the role of AI in revenue operations. He focuses on the practical challenges businesses face as they scale recurring revenue, from reducing involuntary churn and managing complex billing workflows to building more efficient systems for monetization.

[ryan@chargezen.com](mailto:ryan@chargezen.com)

## Related Articles

[

Subscriptions · 2 min read

### How to Set Up Failed Payment Recovery and Smart Dunning on Shopify

Cut involuntary Shopify subscription churn with spaced smart dunning (days 1, 3, 7, 12), passwordless card-update links, and auto-pause recovery.



](https://chargezen.com/blog/shopify-failed-payment-recovery-dunning)[

Subscriptions · 2 min read

### Why Customers Cancel Subscriptions and How to Prevent Churn on Shopify

See the top 5 Shopify subscription cancellation reasons and exact 1-click save offers (skip, swap, pause, discount) that save 15% to 35% of cancelers.



](https://chargezen.com/blog/shopify-subscription-cancellation-reasons)[

Subscriptions · 2 min read

### How to Beat Subscription Fatigue on Shopify (Practical Retention Playbook)

Reduce Shopify subscription fatigue with 3-day pre-renewal reminders, flexible skip/swap portals, milestone perks, and unified rewards + live chat.



](https://chargezen.com/blog/beat-subscription-fatigue-shopify)

## Ready to Grow Your Subscription Revenue?

Join leading brands using Chargezen to reduce churn, increase revenue, and automate operations.

[Get Started](https://admin.chargezen.com/signup)
