Budgets API v2.0

The Budgets API lets you view your account’s current budget settings. You can also use the API to replace your existing budget settings with new values.

Path

base_path/api_version/account_id/budgets[/update]

Where:

Path Parameter Description
base_path https://www.googleapis.com/travelpartner
api_version v2.0
account_id A parent account or sub account ID.
update The optional action to submit a budget update. If you do not specify update in the URL path, then the Budgets API returns the daily spending cap and maximum bid for the account.

Query String Parameters

None.

Supported Methods

HTTP Method Description
GET Gets the specified account's current budget settings.
PUT Replaces your account's budget settings with new settings.

Examples

Gets the budget for the specified account:

GET https://www.googleapis.com/travelpartner/v2.0/4200042/budgets

Sets a new budget for the specified account:

PUT https://www.googleapis.com/travelpartner/v2.0/4200042/budgets/update

For more information, see the Budgeting & Billing Guide and Setting Spending Caps.

Getting budget settings

You can use the Budgets API to get the account’s daily spending cap and maximum bid.

To get budget details about an account, submit a GET request by using the following syntax:

GET https://www.googleapis.com/travelpartner/v2.0/account_id/budgets

The Budgets API responds with a JSON object that describes the budget for the specified account.

The following example shows a budgets list response that has a spending cap of $250.00 USD and a max bid of $10.00:

{
  "budget": [
    {
      "account_daily": {
        "amount": 250.00,
        "currency": "USD"
      }
    },
    {
      "maximum_bid": {
        "amount": 10.00,
        "currency": "USD"
      }
    }
  ]
}

Replacing budget settings

You can use the Budgets API to replace an account’s daily spending cap and maximum bid cap with new values.

To update a budget with new settings, submit a PUT request to the update action with the following syntax:

PUT https://www.googleapis.com/travelpartner/v2.0/account_id/budgets/update

You must set the request’s Content-Type header to “application/json”.

You define your new budget settings in the body of the HTTP message in JSON format, with the root budget object. The budget object contains multiple arrays, with each array defining one aspect of the budget, as the following example shows:

{
  "budget": [
    // Set the daily spending cap
    {
      "account_daily": {
        "amount": <budget_amount>,
        "currency": "<3_letter_currency_code>"
      }
    },

    // Set the account max bid
    {
      "maximum_bid": {
        "amount": <budget_amount>,
        "currency": "<3_letter_currency_code>"
      }
    }
  ]
} // end budget object

Use the account_daily object to define the daily spending cap for the account, in the specified currency. The minimum value for the daily spending cap is $100 USD. Any value between $.01 and $99.99 is interpreted as a cap of $100 USD. Set the value of account_daily to $0 to disable your account.

Use the maximum_bid object to define the max bid for the account, in the specified currency. All bids will be at or below this value. When you set a maximum bid cap, the limit is applied to all auctions across your entire account. No bid will exceed this value.

The following example sets an account’s daily budget to $500.00 USD, and the maximum bid to $20.00:

{
  "budget": [
    {
      "account_daily": {
        "amount": 500.00,  // Set the daily spending cap to $500.00
        "currency": "USD"
      }
    },
    {
      "maximum_bid": {
        "amount": 20.00,  // Set the maximum bid to $20.00
        "currency": "USD"
      }
    }
  ]
} // end root object

To set a budget to be unlimited, set account_daily to a negative value; for example:

"account_daily": {
  "amount": -1,  // Sets the budget to unlimited
  "currency": "USD"
}

To clear the maximum bid value, set maximum_bid to a negative value; for example:

"maximum_bid": {
  "amount": -1,  // Clears the maximum bid
  "currency": "USD"
}

Budgets API Changes

The Budgets API is new to v2.0.

Enviar comentarios sobre…

¿Necesitas ayuda? Visita nuestra página de asistencia.