Upgrade and Downgrade Flows

Payments Reseller Subscription API reuses Create/Provision APIs to upgrade/downgrade an existing subscription. The choice of which API to use depends on how you manage the user sign up.

Google Managed User Signup

  • partners.subscriptions.provision API can upgrade, downgrade a subscription regardless of its entitlement status. If an existing subscription is already activated by a Google user, the newly provisioned subscription will carry over their google account for the new plan.

You may need to additionally consider some common error scenarios when you use oauth consent:

User revoked oauth permission after initial consent, and requested upgrade.

This will affect partners who use oauth refresh tokens. See token expiration for detailed scenarios when a refresh token might no longer work.

  • If the partner must complete the transaction in their own system first before calling Google Reseller APIs, a final fix would require the user to grant oauth permission. Partner can consider encouraging the user to provide consent again. If the above step fails after a certain period of time. Partner could:
    • reverse the transaction of upgrade/downgrade in their system.
    • or cancel the initial subscription with Google, and call Provision to create the new subscription without specifying upgrade_downgrade_details.
  • Partners could also avoid inconsistencies between their system and Google by always starting upgrade/downgrade with Reseller API first. And only update the partner's own system after the Create() API is successful.

User mismatch On Create

This means the user switched to a different gmail than the previous subscription. Create API returns error code ERROR_CODE_SUBSCRIPTION_USER_MISMATCH. Partner should navigate the user to restart the oauth consent flow with their previously entitled gmail account.

If the partner uses oauth refresh tokens, this would not be possible. New access token will always be the same user who initially granted permission.

User mismatch On Provision

The end user may have initiated entitle(), and Google successfully granted entitlement. However, the response failed to reach back to the partner. Then the partner's system may register the subscription as not activated. If the partner calls Provision again, they could get ERROR_CODE_SUBSCRIPTION_USER_MISMATCH. In this case, the partner should use Create() instead.

If a refresh token is available from previous user consent, it can be reused for Create.