Google Ads API Billing set

61 views
Skip to first unread message

rentca...@gmail.com

unread,
Jan 28, 2021, 8:15:03 PM1/28/21
to AdWords API and Google Ads API Forum
Hello,

I would like to get a betting understanding of the Billing set up process.  I have read the information from https://developers.google.com/google-ads/api/docs/billing/billing-setups and have created the following method to create a payment account under a specific payment profile account (id).

        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";
        }

My question is will it return something like the following:

{
    "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"
                }
            }
        }
    ],

KDJ

Google Ads API Forum Advisor Prod

unread,
Jan 29, 2021, 3:12:48 PM1/29/21
to rentca...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. The BillingSetupService.MutateBillingSetup() would return resource_name as the MutateBillingSetupResult. The BillingSetupService.GetBillingSetup() would return BillingSetup that contains fields in your proposed response.

Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Bbx3O:ref
Reply all
Reply to author
Forward
0 new messages