Billing Profiles - Get Eligibility To Detach Payment Method

Validates if the default payment method can be detached from the billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/validateDetachPaymentMethodEligibility?api-version=2019-10-01-preview

URI Parameters

Name In Required Type Description
billingAccountName
path True

string

The ID that uniquely identifies a billing account.

billingProfileName
path True

string

The ID that uniquely identifies a billing profile.

api-version
query True

string

The version of the API to be used with the client request. The current version is 2019-10-01-preview.

Responses

Name Type Description
200 OK

DetachPaymentMethodEligibilityResult

OK. The request has succeeded.

Other Status Codes

ErrorResponse

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

ValidateDetachPaymentMethodEligibilityFailure
ValidateDetachPaymentMethodEligibilitySuccess

ValidateDetachPaymentMethodEligibilityFailure

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/validateDetachPaymentMethodEligibility?api-version=2019-10-01-preview

Sample Response

{
  "isEligible": false,
  "errorDetails": [
    {
      "code": "AzureSubscriptions",
      "message": "Payment method cannot be detached as there are active or disabled azure subscriptions on this billing profile."
    },
    {
      "code": "RecurringCharges",
      "message": "Payment method cannot be detached as there are recurring charges on this billing profile."
    },
    {
      "code": "ReservedInstances",
      "message": "Payment method cannot be detached as there are reserved instances on this billing profile."
    },
    {
      "code": "OutstandingCharges",
      "message": "Payment method cannot be detached as there are unpaid outstanding charges on this billing profile."
    },
    {
      "code": "PendingCharges",
      "message": "Payment method cannot be detached as there are pending charges accumulating on this billing profile."
    }
  ]
}

ValidateDetachPaymentMethodEligibilitySuccess

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/validateDetachPaymentMethodEligibility?api-version=2019-10-01-preview

Sample Response

{
  "isEligible": true
}

Definitions

Name Description
detachPaymentMethodEligibilityErrorCode

Error code for the detach payment method eligibility validation.

DetachPaymentMethodEligibilityResult

Result of the detach payment method eligibility validation.

DetachPaymentMethodErrorDetails

Error details of the detach payment method eligibility validation.

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

ErrorSubDetails

detachPaymentMethodEligibilityErrorCode

Error code for the detach payment method eligibility validation.

Name Type Description
AzureSubscriptions

string

OutstandingCharges

string

PendingCharges

string

RecurringCharges

string

ReservedInstances

string

DetachPaymentMethodEligibilityResult

Result of the detach payment method eligibility validation.

Name Type Description
errorDetails

DetachPaymentMethodErrorDetails[]

The list of detach payment method eligibility errors.

isEligible

boolean

Specifies whether the payment method is eligible to be detached from the billing profile.

DetachPaymentMethodErrorDetails

Error details of the detach payment method eligibility validation.

Name Type Description
code

detachPaymentMethodEligibilityErrorCode

Error code for the detach payment method eligibility validation.

message

string

Error message for the detach payment method eligibility validation.

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

details

ErrorSubDetails[]

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

ErrorDetails

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.