다음을 통해 공유


구독 일시 중단

적용 대상: 파트너 센터 | 21Vianet에서 운영되는 파트너 센터 | Microsoft Cloud for US Government 파트너 센터

사기 또는 미결제로 인해 고객 및 구독 ID와 일치하는 구독 리소스를 일시 중단합니다.

파트너 센터에서는 먼저 고객을 선택하여 이 작업을 수행할 수 있습니다. 그런 다음 이름을 바꾸려는 해당 구독을 선택합니다. 완료하려면 일시 중단 단추를 선택한 다음 제출을 선택합니다.

필수 조건

  • 자격 증명(파트너 센터 인증에서 설명). 이 시나리오는 독립 실행형 앱과 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.

  • 고객 ID (customer-tenant-id). 고객의 ID를 모르는 경우 고객 작업 영역을 선택하고 고객 목록에서 고객을 선택한 다음 계정을 선택하여 파트너 센터에서 조회할 수 있습니다. 고객 계정 페이지의 고객 계정 정보 섹션에서 Microsoft ID를 찾습니다. Microsoft ID는 고객 ID(customer-tenant-id)와 동일합니다.

  • 구독 ID입니다.

C#

고객의 구독을 일시 중단하려면 먼저 구독을 다운로드한 다음 구독의 상태 속성을 변경합니다. 상태 코드에 대한 자세한 내용은 [SubscriptionStatus 열거형/dotnet/api/microsoft.store.partnercenter.models.subscriptions.subscriptionstatus)를 참조하세요. 변경이 완료되면 IAggregatePartner.Customers 컬렉션을 사용하고 ById() 메서드를 호출합니다. 그런 다음, Subscriptions 속성과 ById() 메서드를 호출합니다. 그런 다음 Patch() 메서드를 호출하여 마칩니다.

// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;
// Subscription selectedSubscription;

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

샘플: 콘솔 테스트 앱. 프로젝트: PartnerSDK.FeatureSample 클래스: UpdateSubscription.cs

REST 요청

요청 구문

메서드 요청 URI
패치 {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription} HTTP/1.1

URI 매개 변수

이 표에는 구독을 일시 중단하는 데 필요한 쿼리 매개 변수가 나열됩니다.

속성 Type 필수 설명
customer-tenant-id guid Y 고객에게 해당하는 GUID입니다.
id-for-subscription guid Y 구독에 해당하는 GUID입니다.

요청 헤더

자세한 내용은 파트너 센터 REST 헤더를 참조하세요.

요청 본문

요청 본문에는 전체 구독 리소스가 필요합니다. 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
If-Match: <etag>
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": "suspended",
    "AutoRenewEnabled": false,
    "BillingType": "none",
    "PartnerId": null,
    "ContractType": "subscription",
    "OrderId": "6183db3d-6318-4e52-877e-25806e4971be",
    "Attributes": {
        "Etag": "<etag>",
        "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": "suspended",
    "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"
    }
}

새 상거래 예제

Request

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": "suspended", // original value = “active” 
    "autoRenewEnabled": true, 
    "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" 
    } 
} 

Response


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": "suspended",  
    "autoRenewEnabled": false, // autorenew is turned off when the subscription is suspended 
    "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": null, // seat reduction is not supported in suspended state 
    "orderId": "79d9f5e2f43a", 
    "attributes": { 
        "objectType": "Subscription" 
    } 
}