Billing
3 operations in the Adverity Connect API. Replace {{INSTANCE}} and {{KEY}} in the examples with your instance and API key. How authentication works.
List billing objects export
GET/api/billing-objects/export/
API key permissionAuthorization: Read-onlyauthorization:read
Query parameters
formatstringSelects how an error is rendered. A successful export is always CSV.
One of
csvjson
Responses
200A CSV file with one row per granted billing object, across every connection you can access. Granted means the object has not been removed and the external grantor (the person who authorized the connection) has granted access to it. For connectors with account hierarchies, every level is a row. The list is flat: no search, ordering or paging.
Three cases differ:
- Some connectors leave out billing objects that are not billed themselves, such as Google Ads manager (MCC) accounts.
- A connection whose connector is not billed per billing object gets one row of its own: the connection name in `Billing Object`, and `Status` `Active`.
- A billed connection with no granted billing objects gets no row.
Columns: `Workspace`, `Authorization`, `Billing Object`, then the columns of the exported connectors, then `Date Added` and `Date Updated` (`YYYY-MM-DD`) and `Status` (`Active` or `Inactive`).text/csv
Response schema
string
Get billings
GET/api/billings/{id}/
API key permissionAuthorization: Read-onlyauthorization:read
Path parameters
idintegerrequiredThe connection id.
Query parameters
orderingstringComma-separated
createdandid; a-prefix sorts descending.pageintegerThe page number; only used with
page_size.page_sizeintegerEnables pagination. Without it, all rows are returned.
Responses
200The connection's billing objects that are granted (for a grantor, all visible ones). For connectors with account hierarchies, only the top level; some connectors nest the descendants under `children`.application/json
Response schema
object BillingObjectList
countintegerOnly with
page_size.nextstring · urinullableOnly with
page_size.previousstring · urinullableOnly with
page_size.dataarray of objectrequiredItems · BillingObject
idintegerrequiredcreatedstring · date-timerequirednullableNull for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.
selectablebooleanrequiredFalse if the object cannot be switched on or off by itself: an ancestor that is switched on (or, for a grantor, granted) with its descendants locks it, or the connector does not allow selecting it, such as manager accounts of the deprecated Google Adwords connector.
_metaobjectrequiredAttributes · BillingObjectMeta
urlstringA link to the object, if the connector has one. Never sent to a grantor.
updatedstring · date-timenullableOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Null for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.statusone ofOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Whether the object is switched on, or, for an external grantor, whether it is granted. An object locked on by a switched-on ancestor isActive. Null only for manager accounts of the deprecated Google Adwords connector.Active- ActiveInactive- Inactive
Attributes
BillingObjectStatusEnum
NullEnum
childrenarray of objectThe billing objects one level below this one. Only sent by connectors that nest their hierarchy, such as Google Ads, Keyword Planner, Local Services Ads, the deprecated Google Adwords connector and NoCode connectors; can be empty.
Recursive: see
BillingObjectabove.
columnsarray of objectOmitted, with empty
data, while a reauthorizing grantor waits for the metadata update.Items · BillingObjectColumn
namestringrequiredlabelstringrequireddataTypestringrequiredstring, unless the connector maps the field to a type such asdate.isLinkbooleanrequired
Update billings
PATCH/api/billings/{id}/
API key permissionAuthorization: Writeauthorization:write
Path parameters
idintegerrequiredThe connection id.
Query parameters
add_extra_infostring1addsstatusandupdatedto every object.
Request body
application/json
Body schema
object PatchedBillingObjectsUpdateRequest
objectsarray of objectThe billing objects to switch on or off. Only granted objects are changed; others are ignored silently. For a grantor this changes the grant instead. Unless
enable_all_billing_objectsis true, every billing object of the connection that is not listed is switched off, except descendants locked by a switched-on ancestor; an empty or missing list then switches everything off. For a grantor, unlisted objects keep their grant and lose only the on/off flag (except while reauthorizing the connection).Items · BillingObjectUpdate
idintegerrequiredis_enabledbooleanrequired
isInitialbooleanSwitches every billing object of the connection off before the rest of the request is applied. For an external grantor this also withdraws all grants. Ignored while a grantor reauthorizes the connection.
enable_all_billing_objectsbooleannullableTurn the connection's setting that enables all billing objects on or off (for an external grantor: that grants them). Null or omitted leaves it unchanged.
Responses
200The listed billing objects whose state this request changed: their on/off flag, for a grantor their grant, or for a hierarchy root its "with descendants" flag. Not included: listed objects already in the requested state, objects locked by an ancestor, objects not part of the connection or not granted, unlisted objects that were switched off, and ancestors or descendants changed as a side effect. Exceptions: with `isInitial`, a listed object that was already on is returned; with `enable_all_billing_objects: true`, listed objects that "enable all" switched on are not. `updated` and `status` are included only with `add_extra_info=1`.application/json
Response schema
array of object
idintegerrequiredcreatedstring · date-timerequirednullableNull for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.
selectablebooleanrequiredFalse if the object cannot be switched on or off by itself: an ancestor that is switched on (or, for a grantor, granted) with its descendants locks it, or the connector does not allow selecting it, such as manager accounts of the deprecated Google Adwords connector.
_metaobjectrequiredAttributes · BillingObjectMeta
urlstringA link to the object, if the connector has one. Never sent to a grantor.
updatedstring · date-timenullableOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Null for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.statusone ofOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Whether the object is switched on, or, for an external grantor, whether it is granted. An object locked on by a switched-on ancestor isActive. Null only for manager accounts of the deprecated Google Adwords connector.Active- ActiveInactive- Inactive
Attributes
BillingObjectStatusEnum
NullEnum
childrenarray of objectThe billing objects one level below this one. Only sent by connectors that nest their hierarchy, such as Google Ads, Keyword Planner, Local Services Ads, the deprecated Google Adwords connector and NoCode connectors; can be empty.
Items · BillingObject
idintegerrequiredcreatedstring · date-timerequirednullableNull for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.
selectablebooleanrequiredFalse if the object cannot be switched on or off by itself: an ancestor that is switched on (or, for a grantor, granted) with its descendants locks it, or the connector does not allow selecting it, such as manager accounts of the deprecated Google Adwords connector.
_metaobjectrequiredAttributes · BillingObjectMeta
urlstringA link to the object, if the connector has one. Never sent to a grantor.
updatedstring · date-timenullableOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Null for manager (MCC) accounts of Google Ads, Keyword Planner, Local Services Ads and the deprecated Google Adwords connector.statusone ofOnly included with extra info: always on
GET /api/billings/{id}/, on PATCH only withadd_extra_info=1. Whether the object is switched on, or, for an external grantor, whether it is granted. An object locked on by a switched-on ancestor isActive. Null only for manager accounts of the deprecated Google Adwords connector.Active- ActiveInactive- Inactive
Attributes
BillingObjectStatusEnum
NullEnum
childrenarray of objectThe billing objects one level below this one. Only sent by connectors that nest their hierarchy, such as Google Ads, Keyword Planner, Local Services Ads, the deprecated Google Adwords connector and NoCode connectors; can be empty.
Recursive: see
BillingObjectabove.