Billing Accounts - Get
Gets a billing account by its ID.
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}?api-version=2020-05-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}?api-version=2020-05-01&$expand={$expand}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
billing
|
path | True |
string |
The ID that uniquely identifies a billing account. |
api-version
|
query | True |
string |
The version of the API to be used with the client request. The current version is 2020-05-01. |
$expand
|
query |
string |
May be used to expand the soldTo, invoice sections and billing profiles. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK. The request has succeeded. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Billing |
Billing |
BillingAccounts
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}?api-version=2020-05-01
Sample Response
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}",
"name": "{billingAccountName}",
"type": "Microsoft.Billing/billingAccounts",
"properties": {
"displayName": "Test Account",
"agreementType": "MicrosoftCustomerAgreement",
"accountStatus": "Active",
"accountType": "Enterprise",
"hasReadAccess": true
}
}
BillingAccountWithExpand
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}?api-version=2020-05-01&$expand=soldTo,billingProfiles,billingProfiles/invoiceSections
Sample Response
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}",
"name": "{billingAccountName}",
"type": "Microsoft.Billing/billingAccounts",
"properties": {
"displayName": "Test Account 1",
"agreementType": "MicrosoftCustomerAgreement",
"accountStatus": "Active",
"soldTo": {
"companyName": "Contoso",
"firstName": "Test",
"lastName": "User",
"addressLine1": "Test Address",
"addressLine2": "Test Address",
"addressLine3": "Test Address",
"city": "City",
"postalCode": "00000",
"region": "WA",
"country": "US",
"email": "abc@contoso.com",
"phoneNumber": "000-000-0000"
},
"accountType": "Enterprise",
"billingProfiles": {
"hasMoreResults": true,
"value": [
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000",
"name": "11000000-0000-0000-0000-000000000000",
"type": "Microsoft.Billing/billingAccounts/billingProfiles",
"properties": {
"displayName": "BillingProfile1",
"billingRelationshipType": "Direct",
"billTo": {
"companyName": "Contoso",
"firstName": "Test",
"lastName": "User",
"addressLine1": "Test Address1",
"addressLine2": "Test Address2",
"addressLine3": "Test Address3",
"city": "City",
"postalCode": "00000",
"region": "WA",
"country": "US",
"email": "abc@contoso.com",
"phoneNumber": "000-000-0000"
},
"currency": "USD",
"enabledAzurePlans": [
{
"skuId": "0001",
"skuDescription": "Microsoft Azure Plan"
},
{
"skuId": "0002",
"skuDescription": "Microsoft Azure Plan for DevTest"
}
],
"invoiceDay": 5,
"invoiceEmailOptIn": true,
"poNumber": "ABC12345",
"hasReadAccess": true,
"systemId": "1XXX-11XX-XX1-XXXX-XXX",
"status": "Warned",
"statusReasonCode": "PastDue",
"spendingLimit": "On",
"invoiceSections": {
"hasMoreResults": true,
"value": [
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1",
"name": "invoiceSectionId1",
"type": "Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections",
"properties": {
"displayName": "invoiceSectionName1",
"labels": {
"pcCode": "A123456",
"costCategory": "Support"
},
"state": "Active",
"systemId": "9XXX-11XX-XX1-XXXX-XXX"
}
}
]
}
}
},
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001",
"name": "11000000-0000-0000-0000-000000000001",
"type": "Microsoft.Billing/billingAccounts/billingProfiles",
"properties": {
"displayName": "BillingProfile2",
"billingRelationshipType": "IndirectCustomer",
"billTo": {
"companyName": "Contoso",
"firstName": "Test",
"lastName": "User",
"addressLine1": "Test Address1",
"addressLine2": "Test Address2",
"addressLine3": "Test Address3",
"city": "City",
"postalCode": "00000",
"region": "WA",
"country": "US",
"email": "abc@contoso.com",
"phoneNumber": "000-000-0000"
},
"currency": "USD",
"enabledAzurePlans": [
{
"skuId": "0001",
"skuDescription": "Microsoft Azure Plan"
},
{
"skuId": "0002",
"skuDescription": "Microsoft Azure Plan for DevTest"
}
],
"indirectRelationshipInfo": {
"billingAccountName": "30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000",
"billingProfileName": "33000000-0000-0000-0000-000000000001",
"displayName": "Partner1"
},
"invoiceDay": 5,
"invoiceEmailOptIn": true,
"poNumber": "ABC12345",
"hasReadAccess": true,
"systemId": "2XXX-22XX-XX1-XXXX-XXX",
"status": "Active",
"spendingLimit": "Off",
"invoiceSections": {
"hasMoreResults": true,
"value": [
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId2",
"name": "invoiceSectionId2",
"type": "Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections",
"properties": {
"displayName": "invoiceSectionName2",
"labels": {
"pcCode": "Z223456",
"costCategory": "Marketing"
},
"state": "Active",
"systemId": "9XXX-22XX-XX1-XXXX-XXX"
}
}
]
}
}
}
]
},
"hasReadAccess": true
}
}
Definitions
Name | Description |
---|---|
Account |
The current status of the billing account. |
Account |
The type of customer. |
Address |
Address details. |
Agreement |
The type of agreement. |
Azure |
Details of the Azure plan. |
Billing |
A billing account. |
Billing |
A billing profile. |
Billing |
The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. |
Billing |
The status of the billing profile. |
Billing |
Identifies which services and purchases are paid by a billing profile. |
Department |
A department. |
Enrollment |
The properties of an enrollment. |
Enrollment |
An enrollment account. |
Enrollment |
The policies for Enterprise Agreement enrollments. |
Error |
The details of the error. |
Error |
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. |
Error |
|
Indirect |
The billing profile details of the partner of the customer for an indirect motion. |
Invoice |
An invoice section. |
Invoice |
The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. |
Invoice |
Identifies the state of an invoice section. |
Spending |
The billing profile spending limit. |
Status |
Reason for the specified billing profile status. |
target |
Identifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds. |
AccountStatus
The current status of the billing account.
Name | Type | Description |
---|---|---|
Active |
string |
|
Deleted |
string |
|
Disabled |
string |
|
Expired |
string |
|
Extended |
string |
|
Terminated |
string |
|
Transferred |
string |
AccountType
The type of customer.
Name | Type | Description |
---|---|---|
Enterprise |
string |
|
Individual |
string |
|
Partner |
string |
AddressDetails
Address details.
Name | Type | Description |
---|---|---|
addressLine1 |
string |
Address line 1. |
addressLine2 |
string |
Address line 2. |
addressLine3 |
string |
Address line 3. |
city |
string |
Address city. |
companyName |
string |
Company name. |
country |
string |
Country code uses ISO2, 2-digit format. |
district |
string |
Address district. |
string |
Email address. |
|
firstName |
string |
First name. |
lastName |
string |
Last name. |
middleName |
string |
Middle name. |
phoneNumber |
string |
Phone number. |
postalCode |
string |
Postal code. |
region |
string |
Address region. |
AgreementType
The type of agreement.
Name | Type | Description |
---|---|---|
EnterpriseAgreement |
string |
|
MicrosoftCustomerAgreement |
string |
|
MicrosoftOnlineServicesProgram |
string |
|
MicrosoftPartnerAgreement |
string |
AzurePlan
Details of the Azure plan.
Name | Type | Description |
---|---|---|
skuDescription |
string |
The sku description. |
skuId |
string |
The sku id. |
BillingAccount
A billing account.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
name |
string |
Resource name. |
properties.accountStatus |
The current status of the billing account. |
|
properties.accountType |
The type of customer. |
|
properties.agreementType |
The type of agreement. |
|
properties.billingProfiles |
The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. |
|
properties.departments |
The departments associated to the enrollment. |
|
properties.displayName |
string |
The billing account name. |
properties.enrollmentAccounts |
The accounts associated to the enrollment. |
|
properties.enrollmentDetails |
The details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. |
|
properties.hasReadAccess |
boolean |
Indicates whether user has read access to the billing account. |
properties.notificationEmailAddress |
string |
Notification email address, only for legacy accounts |
properties.soldTo |
The address of the individual or organization that is responsible for the billing account. |
|
type |
string |
Resource type. |
BillingProfile
A billing profile.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
name |
string |
Resource name. |
properties.billTo |
Billing address. |
|
properties.billingRelationshipType |
Identifies which services and purchases are paid by a billing profile. |
|
properties.currency |
string |
The currency in which the charges for the billing profile are billed. |
properties.displayName |
string |
The name of the billing profile. |
properties.enabledAzurePlans |
Information about the enabled azure plans. |
|
properties.hasReadAccess |
boolean |
Indicates whether user has read access to the billing profile. |
properties.indirectRelationshipInfo |
Identifies the billing profile that is linked to another billing profile in indirect purchase motion. |
|
properties.invoiceDay |
integer |
The day of the month when the invoice for the billing profile is generated. |
properties.invoiceEmailOptIn |
boolean |
Flag controlling whether the invoices for the billing profile are sent through email. |
properties.invoiceSections |
The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. |
|
properties.poNumber |
string |
The purchase order name that will appear on the invoices generated for the billing profile. |
properties.spendingLimit |
The billing profile spending limit. |
|
properties.status |
The status of the billing profile. |
|
properties.statusReasonCode |
Reason for the specified billing profile status. |
|
properties.systemId |
string |
The system generated unique identifier for a billing profile. |
properties.tags |
object |
Tags of billing profiles. |
properties.targetClouds |
Identifies the cloud environments that are associated with a billing profile. This is a system managed optional field and gets updated as the billing profile gets associated with accounts in various clouds. |
|
type |
string |
Resource type. |
BillingProfilesOnExpand
The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand.
Name | Type | Description |
---|---|---|
hasMoreResults |
boolean |
Indicates whether there are more billing profiles than the ones listed in this collection. The collection lists a maximum of 50 billing profiles. To get all billing profiles, use the list billing profiles API. |
value |
The billing profiles associated with the billing account. |
BillingProfileStatus
The status of the billing profile.
Name | Type | Description |
---|---|---|
Active |
string |
|
Disabled |
string |
|
Warned |
string |
BillingRelationshipType
Identifies which services and purchases are paid by a billing profile.
Name | Type | Description |
---|---|---|
CSPPartner |
string |
|
Direct |
string |
|
IndirectCustomer |
string |
|
IndirectPartner |
string |
Department
A department.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
name |
string |
Resource name. |
properties.costCenter |
string |
The cost center associated with the department. |
properties.departmentName |
string |
The name of the department. |
properties.enrollmentAccounts |
Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. |
|
properties.status |
string |
The status of the department. |
type |
string |
Resource type. |
Enrollment
The properties of an enrollment.
Name | Type | Description |
---|---|---|
billingCycle |
string |
The billing cycle for the enrollment. |
channel |
string |
The channel type of the enrollment. |
countryCode |
string |
The country code of the enrollment. |
currency |
string |
The billing currency for the enrollment. |
endDate |
string |
The end date of the enrollment. |
language |
string |
The language for the enrollment. |
policies |
The policies for Enterprise Agreement enrollments. |
|
startDate |
string |
The start date of the enrollment. |
status |
string |
The current status of the enrollment. |
EnrollmentAccount
An enrollment account.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
name |
string |
Resource name. |
properties.accountName |
string |
The name of the enrollment account. |
properties.accountOwner |
string |
The owner of the enrollment account. |
properties.accountOwnerEmail |
string |
The enrollment account owner email address. |
properties.costCenter |
string |
The cost center associated with the enrollment account. |
properties.department |
Associated department. By default this is not populated, unless it's specified in $expand. |
|
properties.endDate |
string |
The end date of the enrollment account. |
properties.startDate |
string |
The start date of the enrollment account. |
properties.status |
string |
The status of the enrollment account. |
type |
string |
Resource type. |
EnrollmentPolicies
The policies for Enterprise Agreement enrollments.
Name | Type | Description |
---|---|---|
accountOwnerViewCharges |
boolean |
The policy that controls whether Account Owners can view charges. |
departmentAdminViewCharges |
boolean |
The policy that controls whether Department Administrators can view charges. |
marketplaceEnabled |
boolean |
The policy that controls whether Azure marketplace purchases are allowed in the enrollment. |
reservedInstancesEnabled |
boolean |
The policy that controls whether Azure reservation purchases are allowed in the enrollment. |
ErrorDetails
The details of the error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
details |
The sub details of the error. |
|
message |
string |
Error message indicating why the operation failed. |
target |
string |
The target of the particular error. |
ErrorResponse
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
Name | Type | Description |
---|---|---|
error |
The details of the error. |
ErrorSubDetails
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message indicating why the operation failed. |
target |
string |
The target of the particular error. |
IndirectRelationshipInfo
The billing profile details of the partner of the customer for an indirect motion.
Name | Type | Description |
---|---|---|
billingAccountName |
string |
The billing account name of the partner or the customer for an indirect motion. |
billingProfileName |
string |
The billing profile name of the partner or the customer for an indirect motion. |
displayName |
string |
The display name of the partner or customer for an indirect motion. |
InvoiceSection
An invoice section.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
name |
string |
Resource name. |
properties.displayName |
string |
The name of the invoice section. |
properties.labels |
object |
Dictionary of metadata associated with the invoice section. |
properties.state |
Identifies the state of an invoice section. |
|
properties.systemId |
string |
The system generated unique identifier for an invoice section. |
properties.tags |
object |
Dictionary of metadata associated with the invoice section. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
properties.targetCloud |
Identifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds. |
|
type |
string |
Resource type. |
InvoiceSectionsOnExpand
The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand.
Name | Type | Description |
---|---|---|
hasMoreResults |
boolean |
Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists a maximum of 50 invoice sections. To get all invoice sections, use the list invoice sections API. |
value |
The invoice sections associated to the billing profile. |
InvoiceSectionState
Identifies the state of an invoice section.
Name | Type | Description |
---|---|---|
Active |
string |
|
Restricted |
string |
SpendingLimit
The billing profile spending limit.
Name | Type | Description |
---|---|---|
Off |
string |
|
On |
string |
StatusReasonCode
Reason for the specified billing profile status.
Name | Type | Description |
---|---|---|
PastDue |
string |
|
SpendingLimitExpired |
string |
|
SpendingLimitReached |
string |
targetCloud
Identifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds.
Name | Type | Description |
---|---|---|
USGov |
string |
|
USNat |
string |
|
USSec |
string |