Skip to content

Add a base plan  #1892

Open
Open
@YonatanSasoony

Description

@YonatanSasoony

Hey!

What is the best way to add a BasePlan to an existing subscription?

According to google_play_api.monetization.subscriptions.BasePlans there is not an update method.

I've tried to use google_play_api.monetization.subscriptions.patch() to update the BasePlans list:

   subscription = (
        google_play_api.monetization()
        .subscriptions()
        .get(
            packageName=package_name,
            productId=product_id,
        )
        .execute()
    )
    base_plans = subscription["basePlans"]
    base_plans.append(new_base_plan_details)
    subscription["basePlans"] = base_plans
    create_base_plan_request = (
        google_play_api.monetization()
        .subscriptions()
        .patch(
            packageName=package_name,
            productId=product_id,
            body=subscription,
        )
    )
  create_base_plan_request.uri += "&regionsVersion.version=2022/01"
  create_base_plan_request.uri += "&updateMask=Subscription.basePlans"
  create_base_plan_request.execute()

And got 400 Error: Request contains an invalid argument.
Any idea what is wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs more infoThis issue needs more information from the customer to proceed.type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions