次の方法で共有


中断したサブスクリプションを再アクティブ化する

適用対象: パートナー センター | 21Vianet が運営するパートナー センター | Microsoft Cloud for US Government のパートナー センター

以前に未払いのために中断されたサブスクリプションを再アクティブ化 します

パートナー センターでは、最初 に顧客を選択することで、この操作を実行できます。 次に、名前を変更する対象のサブスクリプションを選択します。 完了するには、[アクティブ] ボタンを選択し、[送信] を選択します。

前提条件

  • パートナー センターの認証に関するページで説明している資格情報。 このシナリオでは、スタンドアロン アプリとアプリ + ユーザーの両方の資格情報を使った認証がサポートされています。

  • 顧客 ID です (customer-tenant-id)。 顧客の ID がわからない場合は、パートナー センター[顧客] ワークスペースを選び、顧客一覧から顧客を選び、[アカウント] を選んで調べることができます。 お客様のアカウント ページで、[顧客のアカウント情報] セクションの Microsoft ID を探します。 Microsoft ID は、顧客 ID (customer-tenant-id) と同じです。

  • サブスクリプション ID。

C#

顧客のサブスクリプションを再アクティブ化するには、最初 にサブスクリプションを取得してから、サブスクリプションStatus プロパティを変更します。 状態コードの詳細については、[SubscriptionStatus 列挙型/dotnet/api/microsoft.store.partnercenter.models.subscriptions.subscriptionstatus) を参照してください。 変更が行われたら、IPartner.Customers コレクションを使用し、ById() メソッドを呼び出します。 次に、Subscriptions プロパティを呼び出し、次に ById() メソッドを呼び出します。 次に、Patch() メソッドを呼び出して終了します。

// IPartner partnerOperations;
// var selectedCustomer as Customer;
// var selectedSubscription as Subscription;

updatedSubscription = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ById(selectedSubscription.Id).Patch(
   new Subscription()
   {
      Status = SubscriptionStatus.Active
   });

サンプル: コンソール テスト アプリプロジェクト: FeatureSamplesApplication。 クラス: UpdateSubscription

REST 要求

要求の構文

認証方法 要求 URI
PATCH {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription} HTTP/1.1

URI パラメーター

次の表に、サブスクリプションを再アクティブ化するために必要なクエリ パラメーターを示します。

名前 タイプ 必須 説明
customer-tenant-id guid 顧客に対応する GUID。
id-for-subscription guid サブスクリプションに対応する GUID。

要求ヘッダー

詳細については、「パートナー センター REST ヘッダー」を参照してください。

要求本文

要求本文には完全な Subscription リソースが必要です。 Status プロパティが更新されていることを確認します。

要求の例

PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<id-for-subscription> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: ec8f62e5-1d92-47e9-8d5d-1924af105f2c
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive

{
    "Id": "83ef9d05-4169-4ef9-9657-0e86b1eab1de",
    "FriendlyName": "nickname",
    "Quantity": 2,
    "UnitType": "none",
    "ParentSubscriptionId": null,
    "CreationDate": "2015-11-25T06:41:12Z",
    "EffectiveStartDate": "2015-11-24T08:00:00Z",
    "CommitmentEndDate": "2016-12-12T08:00:00Z",
    "Status": "active",
    "AutoRenewEnabled": false,
    "BillingType": "none",
    "PartnerId": null,
    "ContractType": "subscription",
    "OrderId": "6183db3d-6318-4e52-877e-25806e4971be",
    "Attributes": {
        "Etag": "<etag>",
        "ObjectType": "Subscription"
    }
}

新しいコマースの要求例

PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<id-for-subscription> HTTP/1.1 
Authorization: Bearer <token> 
Accept: application/json 
MS-RequestId: 35163960-06c5-4677-9200-7e3b0cc1bb6e 
MS-CorrelationId: bffa7f30-344e-48f8-be88-f591927dd655 
Content-Type: application/json 
Content-Length: 1029 
Expect: 100-continue 
Connection: Keep-Alive 
 
{ 
    "id": "0ee4f7f6-b583-403e-81bb-9facbc96ef54", 
    "offerId": "CFQ7TTC0LH18:0001:CFQ7TTC0P0WS", 
    "offerName": "Microsoft 365 Business Basic", 
    "friendlyName": "Microsoft 365 Business Basic", 
    "productType": { 
        "id": "OnlineServicesNCE", 
        "displayName": "OnlineServicesNCE" 
    }, 
    "quantity": 2, 
    "unitType": "Licenses", 
    "hasPurchasableAddons": false, 
    "creationDate": "2024-06-05T19:26:38.3667635Z", 
    "effectiveStartDate": "2024-06-05T00:00:00Z", 
    "commitmentEndDate": "2024-07-04T00:00:00Z", 
    "commitmentEndDateTime": "2024-07-04T23:59:59Z", 
    "cancellationAllowedUntilDate": "2024-06-12T19:27:03.440527Z", 
    "billingCycleEndDate": "2024-07-04T00:00:00Z", 
    "billingCycleEndDateTime": "2024-07-04T23:59:59Z", 
    "status": "active", // original value is "suspended” 
    "autoRenewEnabled": false,  
    "isTrial": false, 
    "billingType": "license", 
    "billingCycle": "monthly", 
    "termDuration": "P1M", 
    "renewalTermDuration": "", 
    "isMicrosoftProduct": true, 
    "partnerId": "", 
    "attentionNeeded": false, 
    "actionTaken": false, 
    "contractType": "subscription", 
    "links": { 
        "product": { 
            "uri": "/products/CFQ7TTC0LH18?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "sku": { 
            "uri": "/products/CFQ7TTC0LH18/skus/0001?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "availability": { 
            "uri": "/products/CFQ7TTC0LH18/skus/0001/availabilities/CFQ7TTC0P0WS?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "self": { 
            "uri": "/customers/a2ce50db-e1d9-4b3b-aa75-6de2bfcdd752/subscriptions/0ee4f7f6-b583-403e-81bb-9facbc96ef54", 
            "method": "GET", 
            "headers": [] 
        } 
    }, 
    "publisherName": "Microsoft Corporation", 
    "orderId": "79d9f5e2f43a", 
    "attributes": { 
        "objectType": "Subscription" 
    } 
} 

REST 応答

成功した場合、このメソッドは応答本文で更新された サブスクリプション リソース プロパティを返します。

応答の成功とエラーのコード

各応答には、成功または失敗を示す HTTP ステータス コードと、追加のデバッグ情報が付属しています。 このコード、エラーの種類、追加のパラメーターを読み取るには、ネットワーク トレース ツールを使用します。 完全な一覧については、エラー コードに関するページを参照してください。

応答の例

PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<subscriptionID> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-Contract-Version: v1
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: ec8f62e5-1d92-47e9-8d5d-1924af105f2c
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive

{
    "Id": "83ef9d05-4169-4ef9-9657-0e86b1eab1de",
    "FriendlyName": "nickname",
    "Quantity": 2,
    "UnitType": "none",
    "ParentSubscriptionId": null,
    "CreationDate": "2015-11-25T06:41:12Z",
    "EffectiveStartDate": "2015-11-24T08:00:00Z",
    "CommitmentEndDate": "2016-12-12T08:00:00Z",
    "Status": "active",
    "AutoRenewEnabled": false,
    "BillingType": "none",
    "PartnerId": null,
    "ContractType": "subscription",
    "Links": {
        "Offer": {
            "Uri": "/v1/offers/0CCA44D6-68E9-4762-94EE-31ECE98783B9",
            "Method": "GET",
            "Headers": []
        },
        "Entitlement": {
            "Uri": "/entitlements?key=<key>",
            "Method": "GET",
            "Headers": []
        },
        "Self": {
            "Uri": "/subscriptions?key=<key>",
            "Method": "GET",
            "Headers": []
        }
    },
    "OrderId": "6183db3d-6318-4e52-877e-25806e4971be",
    "Attributes": {
        "Etag": "<etag>",
        "ObjectType": "Subscription"
    }
}

新しいコマースの応答の例

PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<id-for-subscription> HTTP/1.1 
Authorization: Bearer <token> 
Accept: application/json 
MS-RequestId: 35163960-06c5-4677-9200-7e3b0cc1bb6e 
MS-CorrelationId: bffa7f30-344e-48f8-be88-f591927dd655 
Content-Type: application/json 
Content-Length: 1029 
Expect: 100-continue 
Connection: Keep-Alive 
 
{ 
    "id": "0ee4f7f6-b583-403e-81bb-9facbc96ef54", 
    "offerId": "CFQ7TTC0LH18:0001:CFQ7TTC0P0WS", 
    "offerName": "Microsoft 365 Business Basic", 
    "friendlyName": "Microsoft 365 Business Basic", 
    "productType": { 
        "id": "OnlineServicesNCE", 
        "displayName": "OnlineServicesNCE" 
    }, 
    "quantity": 2, 
    "unitType": "Licenses", 
    "hasPurchasableAddons": false, 
    "creationDate": "2024-06-05T19:26:38.3667635Z", 
    "effectiveStartDate": "2024-06-05T00:00:00Z", 
    "commitmentEndDate": "2024-07-04T00:00:00Z", 
    "commitmentEndDateTime": "2024-07-04T23:59:59Z", 
    "cancellationAllowedUntilDate": "2024-06-12T19:27:03.440527Z", 
    "billingCycleEndDate": "2024-07-04T00:00:00Z", 
    "billingCycleEndDateTime": "2024-07-04T23:59:59Z", 
    "status": "active",  
    "autoRenewEnabled": false, 
    "isTrial": false, 
    "billingType": "license", 
    "billingCycle": "monthly", 
    "termDuration": "P1M", 
    "renewalTermDuration": "", 
    "isMicrosoftProduct": true, 
    "partnerId": "", 
    "attentionNeeded": false, 
    "actionTaken": false, 
    "contractType": "subscription", 
    "links": { 
        "product": { 
            "uri": "/products/CFQ7TTC0LH18?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "sku": { 
            "uri": "/products/CFQ7TTC0LH18/skus/0001?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "availability": { 
            "uri": "/products/CFQ7TTC0LH18/skus/0001/availabilities/CFQ7TTC0P0WS?country=US", 
            "method": "GET", 
            "headers": [] 
        }, 
        "self": { 
            "uri": "/customers/a2ce50db-e1d9-4b3b-aa75-6de2bfcdd752/subscriptions/0ee4f7f6-b583-403e-81bb-9facbc96ef54", 
            "method": "GET", 
            "headers": [] 
        } 
    }, 
    "publisherName": "Microsoft Corporation", 
    "refundableQuantity": { 
        "totalQuantity": 1, 
        "details": [ 
            { 
                "quantity": 1, 
                "allowedUntilDateTime": "2024-06-14T17:41:13.4675407Z" 
            } 
        ] 
    }, 
    "orderId": "79d9f5e2f43a", 
    "attributes": { 
        "objectType": "Subscription" 
    } 
}