Met à jour un forfait. Utilisez cette méthode pour passer d'un forfait d'essai de 30 jours ou d'un abonnement modulable à un forfait annuel avec paiements mensuels ou annuels.
La procédure de mise à jour d'un forfait varie selon le forfait et les produits. Pour en savoir plus, consultez la description de la section Gérer les abonnements.
Requête HTTP
POST https://reseller.googleapis.com/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan
Il peut s'agir du nom de domaine principal du client ou de son identifiant unique. Si le nom de domaine d'un client change, vous ne pouvez plus utiliser l'ancien nom de domaine pour accéder au client, mais vous pouvez toujours utiliser son identifiant unique (tel que renvoyé par l'API). Nous vous recommandons de stocker l'identifiant unique dans vos systèmes, le cas échéant.
subscriptionId
string
Il s'agit d'une propriété obligatoire. subscriptionId est l'identifiant de l'abonnement, qui est unique pour chaque client. Étant donné qu'un subscriptionId change lorsqu'un abonnement est mis à jour, nous vous recommandons de ne pas utiliser cet ID comme clé pour les données persistantes. Vous pouvez trouver subscriptionId à l'aide de la méthode Récupérer tous les abonnements du revendeur.
Identifie la ressource en tant que demande de changement de forfait. Valeur : subscriptions#changePlanRequest
planName
string
La propriété planName est obligatoire. Il s'agit du nom du forfait de l'abonnement. Pour en savoir plus sur les forfaits de paiement Google, consultez la section Concepts de l'API.
Les valeurs possibles sont les suivantes:
ANNUAL_MONTHLY_PAY : forfait annuel avec paiements mensuels
ANNUAL_YEARLY_PAY : forfait annuel avec paiements annuels
Il s'agit d'une propriété obligatoire. La propriété "seats" correspond au nombre de licences utilisateur.
purchaseOrderId
string
Cette propriété est facultative. Ces informations sur le bon de commande (BC) sont destinées aux revendeurs pour suivre l'utilisation de leur entreprise. Si une valeur purchaseOrderId est indiquée, elle apparaît dans les réponses de l'API et sur la facture. Cette propriété accepte jusqu'à 80 caractères en texte brut.
dealCode
string
Code émis par Google (100 caractères maximum) pour bénéficier d'une remise sur les abonnements. Le code de réduction doit être inclus dans la requête changePlan pour bénéficier du tarif réduit. Cette propriété est facultative. Si un code promotionnel a déjà été ajouté à un abonnement, vous pouvez laisser cette propriété vide. Le tarif réduit existant s'appliquera toujours (si elle n'est pas vide, indiquez uniquement le code promotionnel déjà présent sur l'abonnement). Si aucun code promotionnel n'a jamais été ajouté à un abonnement et que cette propriété est laissée vide, le prix normal s'applique.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/25 (UTC)."],[],[],null,["# Method: subscriptions.changePlan\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [ChangePlanRequest](#ChangePlanRequest)\n - [JSON representation](#ChangePlanRequest.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nUpdates a subscription plan. Use this method to update a plan for a 30-day trial or a flexible plan subscription to an annual commitment plan with monthly or yearly payments.\n\nHow a plan is updated differs depending on the plan and the products. For more information, see the description in [manage subscriptions](https://developers.google.com/workspace/admin/reseller/v1/how-tos/manage_subscriptions#update_subscription_plan).\n\n### HTTP request\n\n`POST https://reseller.googleapis.com/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customerId` | `string` This can be either the customer's primary domain name or the customer's unique identifier. If the domain name for a customer changes, the old domain name cannot be used to access the customer, but the customer's unique identifier (as returned by the API) can always be used. We recommend storing the unique identifier in your systems where applicable. |\n| `subscriptionId` | `string` This is a required property. The `subscriptionId` is the subscription identifier and is unique for each customer. Since a `subscriptionId` changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the `subscriptionId` can be found using the [retrieve all reseller subscriptions](https://developers.google.com/workspace/admin/reseller/v1/how-tos/manage_subscriptions#get_all_subscriptions) method. |\n\n### Request body\n\nThe request body contains an instance of [ChangePlanRequest](/workspace/admin/reseller/reference/rest/v1/subscriptions/changePlan#ChangePlanRequest).\n\n### Response body\n\nIf successful, the response body contains an instance of [Subscription](/workspace/admin/reseller/reference/rest/v1/subscriptions#Subscription).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/apps.order`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nChangePlanRequest\n-----------------\n\nJSON template for the subscriptions.changePlan rpc request.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"planName\": string, \"seats\": { object (/workspace/admin/reseller/reference/rest/v1/subscriptions#Seats) }, \"purchaseOrderId\": string, \"dealCode\": string } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the resource as a subscription change plan request. Value: `subscriptions#changePlanRequest` |\n| `planName` | `string` The `planName` property is required. This is the name of the subscription's payment plan. For more information about the Google payment plans, see [API concepts](https://developers.google.com/workspace/admin/reseller/v1/how-tos/concepts.html). Possible values are: - `ANNUAL_MONTHLY_PAY` - The annual commitment plan with monthly payments **Caution:** `ANNUAL_MONTHLY_PAY` is returned as `ANNUAL` in all API responses. - `ANNUAL_YEARLY_PAY` - The annual commitment plan with yearly payments - `FLEXIBLE` - The flexible plan - `TRIAL` - The 30-day free trial plan \u003cbr /\u003e |\n| `seats` | `object (`[Seats](/workspace/admin/reseller/reference/rest/v1/subscriptions#Seats)`)` This is a required property. The seats property is the number of user seat licenses. |\n| `purchaseOrderId` | `string` This is an optional property. This purchase order (PO) information is for resellers to use for their company tracking usage. If a `purchaseOrderId` value is given it appears in the API responses and shows up in the invoice. The property accepts up to 80 plain text characters. |\n| `dealCode` | `string` Google-issued code (100 char max) for discounted pricing on subscription plans. Deal code must be included in `changePlan` request in order to receive discounted rate. This property is optional. If a deal code has already been added to a subscription, this property may be left empty and the existing discounted rate will still apply (if not empty, only provide the deal code that is already present on the subscription). If a deal code has never been added to a subscription and this property is left blank, regular pricing will apply. |"]]