Billingobject
Contains function used to bill merchants for your app with the Billing API.
This object is returned on authenticated Admin requests.
Managed App Pricing is now available. Define your app’s pricing plans directly in the Shopify Partner Dashboard, without needing to use the Billing API.
Anchor to billingbilling
Provides utilities that apps can use to request billing for the app using the Admin API.
Cancels an ongoing subscription, given its ID.
Checks if the shop has an active payment for any plan defined in the billing
config option.
Creates a usage record for an app subscription.
Requests payment for the plan.
Checks if the shop has an active payment for any plan defined in the billing
config option.
Updates the capped amount for a usage billing plan.
Anchor to examplesExamples
Anchor to example-cancelcancel
Anchor to example-cancelling-a-subscriptionCancelling a subscription
Use the billing.cancel
function to cancel an active subscription with the id returned from billing.require
.
Cancelling a subscription
Anchor to example-check-what-billing-plans-a-merchant-is-subscribed-toCheck what billing plans a merchant is subscribed to
Use billing.check if you want to determine which plans are in use. Unlike require
, check
does notthrow an error if no active billing plans are present.
Anchor to example-check-for-payments-without-filteringCheck for payments without filtering
Use billing.check to see if any payments exist for the store, regardless of whether it's a test ormatches one or more plans.
Check what billing plans a merchant is subscribed to
Anchor to example-createusagerecordcreateUsageRecord
Anchor to example-creating-a-usage-recordCreating a usage record
Create a usage record for the active usage billing plan
Creating a usage record
Anchor to example-requestrequest
Anchor to example-using-a-custom-return-urlUsing a custom return URL
Change where the merchant is returned to after approving the purchase using the option.
Anchor to example-overriding-plan-settingsOverriding plan settings
Customize the plan for a merchant when requesting billing. Any fields from the plan can be overridden, as long as the billing interval for line items matches the config.
Using a custom return URL
Anchor to example-requirerequire
Anchor to example-requesting-billing-right-awayRequesting billing right away
Call billing.request
in the callback to immediately redirect to the Shopify page to request payment.
Anchor to example-redirect-to-a-plan-selection-pageRedirect to a plan selection page
When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.
Requesting billing right away
Anchor to example-updateusagecappedamountupdateUsageCappedAmount
Anchor to example-updating-the-capped-amount-for-a-usage-billing-planUpdating the capped amount for a usage billing plan
Update the capped amount for the usage billing plan specified by .