curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coupon_code": "SELECTED:1234567:USD"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply"
payload = { "coupon_code": "SELECTED:1234567:USD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({coupon_code: 'SELECTED:1234567:USD'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'coupon_code' => 'SELECTED:1234567:USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply"
payload := strings.NewReader("{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}"
response = http.request(request)
puts response.read_body{
"applied_incentive_code": "9TQGLXDH6Q74EU",
"account_id": "68b1c0d4e7b91d003c45a1f8"
}Apply a Google Ads incentive
Applies one of the offers from List Google Ads incentives to the app’s Google Ads account.
Send the offer’s code as coupon_code. Google then tracks the account’s spend against the offer, and once the spend requirement is met it grants the reward as ad credit, which appears in List Google Ads promotional credits.
An account holds one incentive at most. When it already holds one, nothing is applied and the response carries the code of the incentive it holds. Compare applied_incentive_code with what you expected rather than assuming a successful call applied your offer.
Applying the same offer again doesn’t apply it twice. While an earlier attempt is still settling, a new call is rejected without reaching Google, so wait a few minutes and retry.
The account has to be provisioned in Google Ads, and the offer has to be quoted in the account’s currency, so read the offers with account_id set. Applying isn’t available while the workspace is on a billing hold.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coupon_code": "SELECTED:1234567:USD"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply"
payload = { "coupon_code": "SELECTED:1234567:USD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({coupon_code: 'SELECTED:1234567:USD'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'coupon_code' => 'SELECTED:1234567:USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply"
payload := strings.NewReader("{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/accounts/{account_id}/incentives/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"coupon_code\": \"SELECTED:1234567:USD\"\n}"
response = http.request(request)
puts response.read_body{
"applied_incentive_code": "9TQGLXDH6Q74EU",
"account_id": "68b1c0d4e7b91d003c45a1f8"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app whose Google Ads campaigns to manage.
ID of the Google Ads account, as returned in id by Get Google Ads account. An account that belongs to a different app returns a 404.
Body
The code of the offer to apply, as returned by List Google Ads incentives.
"SELECTED:1234567:USD"
Response
The incentive the account holds after the call.
The incentive the Google Ads account holds after the call.
Google's coupon code for the incentive the account now holds. When the account already held one, this is that incentive's code rather than the offer you sent.
"9TQGLXDH6Q74EU"
ID of the Google Ads account the incentive applies to.
"68b1c0d4e7b91d003c45a1f8"
Was this page helpful?