Add a base plan
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 += "®ionsVersion.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?
Hi @YonatanSasoony,
Please could you try out a similar request in the 'Try this API' interface on this page and check whether the issue still exists? This will determine if it is an API issue or client library issue.
In addition, for updateMask, can you try using basePlans instead of Subscription.basePlans as shown here?
https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions#Subscription
@YonatanSasoony did you get it to work? Struggling with patch as well. Same issues as #2025
Subscription.basePlans => base_plans ๋ก ๋ฃ์ด์ผ 200์ผ๋ก ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์ ์ ์์ต๋๋ค. ๋ค๋ง, ๊ทธ๋ง์ ๋ BasePlan ์ถ๊ฐ๊ฐ ์๋๊ณ , ์์ ์ฌํญ์ ๋๋ค. productId๊ฐ ์์๊ฒฝ์ฐ์๋ ์ ๊ท ๊ตฌ๋ ์ด ์์ฑ๋๋ ๊ตฌ์กฐ์ธ๊ฒ๊ฐ๋ค์.