SetupBilling ERROR - NO_SIGNUP_PERMISSION - INVALID_ARGUMENT

43 views
Skip to first unread message

muhammed yalmaç

unread,
Dec 10, 2023, 8:23:05 PM12/10/23
to Google Ads API and AdWords API Forum


Hello I needed to replace an existing payments profile with another and I couldn't do it. can you help me.

ERROR

API error with message: '{
"message": "Request contains an invalid argument.",
"code": 3,
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com\/google.ads.googleads.v15.errors.GoogleAdsFailure",
"errors": [
{
"errorCode": {
"billingSetupError": "NO_SIGNUP_PERMISSION"
},
"message": "The customer does not have permission to signup for billing or does not have permission to use a given payments profile ID."
}
],
}
]
}'.





CODE:
?php
require 'vendor/autoload.php';

use Google\Ads\GoogleAds\Lib\V15\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\Lib\V15\GoogleAdsException;
use Google\Ads\GoogleAds\V15\Resources\BillingSetup;
use Google\Ads\GoogleAds\V15\Resources\BillingSetup\PaymentsAccountInfo;
use Google\Ads\GoogleAds\V15\Services\BillingSetupOperation;

use Google\ApiCore\ApiException;

function createBillingSetup($customerId) {
    $developer_token = 'xxx';
    $client_id = 'xxxxxx';
    $client_secret = 'xxxxx';
    $refresh_token = 'xxxxxx';
    $customer_id = 'xxxxx';
    $manager_customer_id = 'xxxxxx'; // Yönetici müşteri kimliği

    $googleAdsClient = (new GoogleAdsClientBuilder())
        ->withDeveloperToken($developer_token)
        ->withOAuth2Credential(
            (new OAuth2TokenBuilder())
                ->withClientId($client_id)
                ->withClientSecret($client_secret)
                ->withRefreshToken($refresh_token)
                ->build()
        )
        ->withLoginCustomerId($manager_customer_id)
        ->build();

    $start_date_time = date('Y-m-d\TH:i:sP'); // ISO 8601 formatında şimdiki zaman

    try {

        $paymentsAccountInfo = new PaymentsAccountInfo([
            'payments_account_name' => 'xxxx',
            'payments_profile_id' => 'xxxx-xxxx-xxxx'
        ]);


        $billingSetup = new BillingSetup([
            'payments_account_info' => $paymentsAccountInfo
        ]);

        $billingSetup->setPaymentsAccountInfo($paymentsAccountInfo);

        $billingSetup->setStartDateTime($start_date_time);

        $billingSetupOperation = new BillingSetupOperation();
        $billingSetupOperation->setCreate($billingSetup);

        $billingSetupServiceClient = $googleAdsClient->getBillingSetupServiceClient();
        $response = $billingSetupServiceClient->mutateBillingSetup($customer_id, $billingSetupOperation);
        printf("Created Billing Setup with resource name: '%s'.\n", $response->getResult()->getResourceName());
    } catch (GoogleAdsException $googleAdsException) {
        foreach ($googleAdsException->getGoogleAdsFailure()->getErrors() as $error) {
            printf("Error with message: '%s'.\n", $error->getMessage());
        }
    } catch (ApiException $apiException) {
        printf("API error with message: '%s'.\n", $apiException->getMessage());
    }
}

// Örnek kullanım:
createBillingSetup('xxxxxxx');
?>

Google Ads API Forum Advisor

unread,
Dec 10, 2023, 11:03:32 PM12/10/23
to muhamme...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

After reviewing your concern, I understand that you are getting a 'NO_SIGNUP_PERMISSION' error when trying to change the payment profile.  The 'NO_SIGNUP_PERMISSION' error means that the billing setups can only be created by customers who have permission to set up billings. We would recommend you to contact your Google representative for setting up permissions. You can refer to the 'About payments profiles' help center article for more information. If issue still persists, please provide us with the uncropped UI screenshot along with the complete API logs (request and response with request-id and request header) generated at your end.

If you are using a PHP library and haven't enabled the logging yet, I would request you to enable logging for it. You can refer to the PHP guide to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qXggi:ref"

Thanks,
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages