Get confirmation of customer acceptance of Microsoft Cloud Agreement

Applies to: Partner Center

Does not apply to: Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government

The Agreement resource is currently supported by Partner Center only in the Microsoft public cloud.

Prerequisites

  • If you're using the Partner Center .NET SDK, version 1.9 or newer is required.

    Important

    As of June 2023, the latest Partner Center .NET SDK release 3.4.0 is now archived. You can download the SDK release from GitHub, along with a readme file that contains useful information.

    Partners are encouraged to continue to use the Partner Center REST APIs.

  • If you're using the Partner Center Java SDK, version 1.8 or newer is required.

  • Credentials as described in Partner Center authentication. This scenario only supports app + user authentication.

  • A customer ID (customer-tenant-id). If you don't know the customer's ID, you can look it up in Partner Center by selecting the Customers workspace, then the customer from the customer list, then Account. On the customer's Account page, look for the Microsoft ID in the Customer Account Info section. The Microsoft ID is the same as the customer ID (customer-tenant-id).

.NET (version 1.4 or newer)

To retrieve confirmation(s) of customer acceptance that was previously provided:

  • Use the IAggregatePartner.Customers collection and call ById method with the specified customer identifier.

  • Fetch the Agreements property and filter the results to Microsoft Cloud Agreement by calling ByAgreementType method.

  • Call Get or GetAsync method.

// IAggregatePartner partnerOperations;
// string selectedCustomerId;

string agreementType = "MicrosoftCloudAgreement";

var cloudAgreements = partnerOperations.Customers.ById(selectedCustomerId).Agreements.ByAgreementType(agreementType).Get();

A complete sample can be found in the GetCustomerAgreements class from the console test app project.

.NET (version 1.9 - 1.13)

To retrieve confirmation of customer acceptance provided previously:

Use the IAggregatePartner.Customers collection and call the ById method with the specified customer's identifier. Then, get the Agreements property, followed by calling the Get or GetAsync methods.

// IAggregatePartner partnerOperations;
// string selectedCustomerId;

var agreements = partnerOperations.Customers.ById(selectedCustomerId).Agreements.Get();

Java

The Partner Center Java SDK can be used to manage Partner Center resources. It's an open-source project maintained by the partner community and not officially supported by Microsoft. You can get help from the community or open an issue on GitHub if you experience a problem.

To retrieve confirmation of customer acceptance provided previously:

Use the IAggregatePartner.getCustomers function and call the byId function with the specified customer's identifier. Then, get the getAgreements function, followed by calling the get function.

// IAggregatePartner partnerOperations;
// String selectedCustomerId;

ResourceCollection<Agreement> agreements = partnerOperations.getCustomers().byId(selectedCustomerId).getAgreements().get();

A complete sample can be found in the GetCustomerAgreements class from the console test app project.

PowerShell

The Partner Center PowerShell module can be used to manage Partner Center resources. It's an open-source project maintained by the partner community and not officially supported by Microsoft. You can get help from the community or open an issue on GitHub if you experience a problem.

To retrieve confirmation of customer acceptance provided previously:

Use the Get-PartnerCustomerAgreement command.

Get-PartnerCustomerAgreement -CustomerId '14876998-c0dc-46e6-9d0c-65a57a6c32ec'

REST request

To retrieve confirmation of customer acceptance provided previously, see the following instructions.

Create a new Agreement resource with the relevant certification information.

Request syntax

Method Request URI
GET {baseURL}/v1/customers/{customer-tenant-id}/agreements HTTP/1.1

URI parameter

Use the following query parameter to specify the customer you're confirming.

Name Type Required Description
CustomerTenantId GUID Y The value is a GUID formatted CustomerTenantId that allows you to specify a customer.

Request headers

For more information, see Partner Center REST headers.

Request body

None.

Request example

GET https://api.partnercenter.microsoft.com/v1/customers/14876998-c0dc-46e6-9d0c-65a57a6c32ec/agreements HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: ab993325-1605-4cf4-bac4-fb584142a31b

REST response

If successful, this method returns a collection of Agreement resources in the response body.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and other debugging information. Use a network trace tool to read this code, error type, and other parameters. For the full list, see Partner Center REST error codes.

Response example

HTTP/1.1 200 OK
Content-Length: 620
Content-Type: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: ab993325-1605-4cf4-bac4-fb584142a31b
{
    "totalCount": 2,
    "items":
    [
        {
            "primaryContact":
            {
                "firstName":"Tania",
                "lastName":"Carr",
                "email":"SomeEmail@Outlook.com"
                "phoneNumber":"1234567890"
            },
            "templateId":"998b88de-aa99-4388-a42c-1b3517d49490",
            "dateAgreed":"2018-07-28T00:00:00",
            "type":"MicrosoftCloudAgreement",
            "agreementLink":"https://learn.microsoft.com/partner-center/agreements"
        },
        {
            "primaryContact":
            {
                "firstName":"Tania",
                "lastName":"Carr",
                "email":"SomeEmail@Outlook.com"
                "phoneNumber:"1234567890"
            },
            "templateId":"998b88de-aa99-4388-a42c-1b3517d49490",
            "dateAgreed":"2017-08-01T00:00:00",
            "type":"MicrosoftCloudAgreement",
            "agreementLink":"https://learn.microsoft.com/partner-center/agreements"
        }
    ]
}