public string NewPropertyBillingSetup(Int64 CustomerId, string PaymentProfileId, string CompanyName)
{
BillingSetupServiceClient billingService = Client.GetService(Services.V5.BillingSetupService);
BillingSetup billingSetup = new BillingSetup()
{
PaymentsAccountInfo = new PaymentsAccountInfo()
{
PaymentsAccountName = CompanyName,
PaymentsProfileId = PaymentProfileId
},
StartTimeType = Google.Ads.GoogleAds.V5.Enums.TimeTypeEnum.Types.TimeType.Now
};
BillingSetupOperation setupOperation = new BillingSetupOperation()
{
Create = billingSetup
};
MutateBillingSetupRequest setupRequest = new MutateBillingSetupRequest()
{
CustomerId = CustomerId.ToString(),
Operation = setupOperation
};
MutateBillingSetupResponse response = billingService.MutateBillingSetup(setupRequest);
if (response.Result.ResourceName.Length == 0) { return "failure"; }
return "success";
}
{
"results": [
{
"billingSetup": {
"resourceName": "customers/REDACTED/billingSetups/REDACTED",
"id": "REDACTED",
"status": "APPROVED",
"paymentsAccount": "customers/REDACTED/paymentsAccounts/REDACTED",
"paymentsAccountInfo": {
"paymentsAccountId": "REDACTED",
"paymentsAccountName": "Some name.",
"paymentsProfileId": "REDACTED",
"paymentsProfileName": "Some company name"
}
}
}
],