Get a customer's billing profile
Applies to: Partner Center | Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government
Gets the billing profile of a customer.
In Partner Center, this operation can be performed by first selecting a customer. The billing profile can be found under the Billing information heading.
Prerequisites
Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
A customer ID (
customer-tenant-id
). If you don't know the customer's ID, you can look it up in Partner Center. Select the Customers workspace from the Partner Center Home page. Select the customer from the Customer list, then select Account. On the customer's Account page, look for the Microsoft ID in the Customer Account details section. The Microsoft ID is the same as the customer ID (customer-tenant-id
).
C#
To get a customer's billing profile, use your IPartner.Customers collection and call the ById() method. Then call the Profiles property, followed by the Billing property. Finally, call the Get() or GetAsync() methods.
// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;
var billingProfile = partnerOperations.Customers.ById(selectedCustomerId).Profiles.Billing.Get();
Sample: Console test app. Project: PartnerSDK.FeatureSamples Class: GetCustomerBillingProfile.cs
REST request
Request syntax
Method | Request URI |
---|---|
GET | {baseURL}/v1/customers/{customer-tenant-id}/profiles/billing HTTP/1.1 |
URI parameter
Use the following query parameter to get the billing profile.
Name | Type | Required | Description |
---|---|---|---|
customer-tenant-id | guid | Y | The value is a GUID formatted customer-tenant-id that allows the reseller to filter the results for a given customer that belongs to the reseller. |
Request headers
For more information, see Partner Center REST headers.
Request body
None
Request example
GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/profiles/billing HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: a5581a74-2778-4e34-9172-18baa4877081
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
REST response
If successful, this method returns a collection of Profile resources in the response body.
Response success and error codes
Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Error Codes.
Response example
HTTP/1.1 200 OK
Content-Length: 1206
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: a5581a74-2778-4e34-9172-18baa4877081
Date: Mon, 23 Nov 2015 18:13:43 GMT
{
"id": "<billing-profile-id>",
"firstName": "FirstName",
"lastName": "LastName",
"email": "email@sample.com",
"culture": "en-US",
"language": "en",
"companyName": "CompanyName",
"defaultAddress": {
"country": "US",
"city": "Redmond",
"state": "WA",
"addressLine1": "1 Microsoft Way",
"postalCode": "98052",
"firstName": "FirstName",
"lastName": "LastName",
"phoneNumber": "4255555555"
},
"links": {
"self": {
"uri": "/v1/customers/<customer-tenant-id>/profiles/billing",
"method": "GET",
"headers": []
}
},
"attributes": {
"etag": "<etag>",
"objectType": "CustomerBillingProfile"
}
}