Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

REST Resource: customers.billingSetups

Resource: BillingSetup

A billing setup, which associates a payments account and an advertiser. A billing setup is specific to one advertiser.

JSON representation
{
  "resourceName": string,
  "status": enum (BillingSetupStatus),
  "paymentsAccountInfo": {
    object (PaymentsAccountInfo)
  },
  "id": string,
  "paymentsAccount": string,

  // Union field start_time can be only one of the following:
  "startDateTime": string,
  "startTimeType": enum (TimeType)
  // End of list of possible types for union field start_time.

  // Union field end_time can be only one of the following:
  "endDateTime": string,
  "endTimeType": enum (TimeType)
  // End of list of possible types for union field end_time.
}
Fields
resourceName

string

Immutable. The resource name of the billing setup. BillingSetup resource names have the form:

customers/{customerId}/billingSetups/{billing_setup_id}

status

enum (BillingSetupStatus)

Output only. The status of the billing setup.

paymentsAccountInfo

object (PaymentsAccountInfo)

Immutable. The payments account information associated with this billing setup. When setting up billing, this is used to signup with a new payments account (and then paymentsAccount should not be set). When getting a billing setup, this and paymentsAccount will be populated.

id

string (int64 format)

Output only. The ID of the billing setup.

paymentsAccount

string

Immutable. The resource name of the payments account associated with this billing setup. Payments resource names have the form:

customers/{customerId}/paymentsAccounts/{paymentsAccountId} When setting up billing, this is used to signup with an existing payments account (and then paymentsAccountInfo should not be set). When getting a billing setup, this and paymentsAccountInfo will be populated.

Union field start_time. When creating a new billing setup, this is when the setup should take effect. NOW is the only acceptable start time if the customer doesn't have any approved setups.

When fetching an existing billing setup, this is the requested start time. However, if the setup was approved (see status) after the requested start time, then this is the approval time. start_time can be only one of the following:

startDateTime

string

Immutable. The start date time in yyyy-MM-dd or yyyy-MM-dd HH:mm:ss format. Only a future time is allowed.

startTimeType

enum (TimeType)

Immutable. The start time as a type. Only NOW is allowed.

Union field end_time. When the billing setup ends / ended. This is either FOREVER or the start time of the next scheduled billing setup. end_time can be only one of the following:
endDateTime

string

Output only. The end date time in yyyy-MM-dd or yyyy-MM-dd HH:mm:ss format.

endTimeType

enum (TimeType)

Output only. The end time as a type. The only possible value is FOREVER.

BillingSetupStatus

The possible statuses of a BillingSetup.

Enums
UNSPECIFIED Not specified.
UNKNOWN Used for return value only. Represents value unknown in this version.
PENDING The billing setup is pending approval.
APPROVED_HELD The billing setup has been approved but the corresponding first budget has not. This can only occur for billing setups configured for monthly invoicing.
APPROVED The billing setup has been approved.
CANCELLED The billing setup was cancelled by the user prior to approval.

PaymentsAccountInfo

Container of payments account information for this billing.

JSON representation
{
  "paymentsAccountId": string,
  "paymentsAccountName": string,
  "paymentsProfileId": string,
  "paymentsProfileName": string,
  "secondaryPaymentsProfileId": string
}
Fields
paymentsAccountId

string

Output only. A 16 digit id used to identify the payments account associated with the billing setup.

This must be passed as a string with dashes, e.g. "1234-5678-9012-3456".

paymentsAccountName

string

Immutable. The name of the payments account associated with the billing setup.

This enables the user to specify a meaningful name for a payments account to aid in reconciling monthly invoices.

This name will be printed in the monthly invoices.

paymentsProfileId

string

Immutable. A 12 digit id used to identify the payments profile associated with the billing setup.

This must be passed in as a string with dashes, e.g. "1234-5678-9012".

paymentsProfileName

string

Output only. The name of the payments profile associated with the billing setup.

secondaryPaymentsProfileId

string

Output only. A secondary payments profile id present in uncommon situations, e.g. when a sequential liability agreement has been arranged.

Methods

get

Returns a billing setup.

mutate

Creates a billing setup, or cancels an existing billing setup.