Skip to main content

Manual Pricing with the Billing API

Contains function used to bill merchants for your app with the Billing API.

This object is returned on authenticated Admin requests.

Choose a pricing method

For a new public app, use Shopify App Pricing to configure plans in your Partner Dashboard instead of this page's billing configuration and billing.request examples. Manual Pricing remains for existing Billing API integrations, one-time purchases, and pricing models that Shopify App Pricing doesn't support.

Provides utilities that apps can use to request billing for the app using the Admin API.

Anchor to cancel
cancel
(options: ) => Promise<AppSubscription>
required

Cancels an ongoing subscription, given its ID.

Anchor to request
request
(options: <Config>) => Promise<never>
required

Requests payment for the plan.

Anchor to require
require
(options: <Config>) => Promise<BillingCheckResponseObject>
required

Checks if the shop has an active payment for any plan defined in the billing config option.

Examples
import { LoaderArgs } from "@remix-run/node";
import { authenticate, MONTHLY_PLAN } from "../shopify.server";

export const loader = async ({ request }: LoaderArgs) => {
const { billing } = await authenticate.admin(request);
const billingCheck = await billing.require({
plans: [MONTHLY_PLAN],
onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),
});

const subscription = billingCheck.appSubscriptions[0];
const cancelledSubscription = await billing.cancel({
subscriptionId: subscription.id,
isTest: true,
prorate: true,
});

// App logic
};


Was this page helpful?