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.
- Go
- NodeJS
- Java
- Python
billingDetails, err := api.GetBillingDetails(client)
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).
- Go
- NodeJS
- Java
- Python
frequencyList, err := api.GetBillingFrequencyList(client)
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.
- Go
- NodeJS
- Java
- Python
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.
- Go
- NodeJS
- Java
- Python
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)