Billing

This section allows you to check your Billing status; this makes accounting with our service easier.

Billing Details

List all items of the cost breakdown and also other details such as the billing frequency.

billingDetails, err := api.GetBillingDetails()
if err != nil {
log.Printf("failed to get Billing Details: %s", err)
os.Exit(1)
}

For the full and updated list of the properties in the BillingDetails object, you may read the API documentation for further details.

Get Billing Frequency List

Obtain the list of billing frequencies (past, current and future).

frequencyList, err := api.GetBillingFrequencyList()
if err != nil {
log.Printf("failed to get Billing Frequency List: %s", err)
os.Exit(1)
}
for i, freq := range frequencyList {
fmt.Printf("Frequency[%v]: %v\n", i, freq)
}
}

Set Next Billing Frequency

Change the next billing frequency.

newFrequency, err := api.SetNextBillingFrequency(proto.TimeInterval_MONTHLY, time.Now().AddDate(0, 2, 0))
if err != nil {
log.Printf("failed to get Set Next Billing Frequency: %s", err)
os.Exit(1)
}
fmt.Printf("New Frequency: %v\n", newFrequency)

Get Large Traffic Usage

Obtain the list of large traffic usages.

largeTraffic, err := api.GetLargeTraffic(time.Now())
if err != nil {
log.Printf("Failed to get large traffic: %s", err)
os.Exit(1)
}
fmt.Println("Large Traffic:", largeTraffic)