Update the maximum charge for a subscription
For public apps, use Shopify App Pricing. The Billing API is still supported for existing apps and outlier pricing models Shopify App Pricing doesn't cover.
For public apps, use Shopify App Pricing. The Billing API is still supported for existing apps and outlier pricing models Shopify App Pricing doesn't cover.
Update the maximum amount that merchants can be charged for their subscription. You should do this if you change your pricing model.
If you try to create a usage record for a usage pricing plan with an amount that's less than the new usage record, then the request fails. You need to increase the cappedAmount, and then obtain merchant approval before you can create more usage records.
If you try to create a usage record for a usage pricing plan with an amount that's less than the new usage record, then the request fails. You need to increase the cappedAmount, and then obtain merchant approval before you can create more usage records.
Anchor to RequirementsRequirements
- Your app can make authenticated requests to the GraphQL Admin API.
Anchor to Step 1: Retrieve charge dataStep 1: Retrieve charge data
Make a request to the AppSubscription object's lineItems for the following data from the usage line item:
-
idThe
AppSubscriptionLineItemID. You pass this ID to the mutation in the next step. -
cappedAmount, from the line item'splan.pricingDetails(AppUsagePricing)The
cappedAmountis the maximum that a merchant is billed for during the 30-day billing cycle. ThecurrencyCodemust be one of the supported currencies. -
balanceUsed, from the line item'splan.pricingDetailsThe following query is an example:
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
JSON response
Anchor to Step 2: Update the capped amountStep 2: Update the capped amount
Update the capped amount by passing the usage line item's AppSubscriptionLineItem ID as the id argument, along with the new cappedAmount, to the appSubscriptionLineItemUpdate mutation.
The following mutation is an example: