I want to get billing information

September 10, 2015 2.9k views
DigitalOcean API

Can we get billing information using APIs or any other way.
is it possible

2 comments
  • +1 to get invoices in PDF through the API.

  • +1
    To collect invoices is annoying.

    The PDF does not come as an e-mail attachment and as there is no API to download it, one is forced to visit the web app and download it from here.

5 Answers

You can view the billing related information here: https://cloud.digitalocean.com/settings/billing.

Using the API, you can only get basic account information such as the droplet limit and the email address:

{
  "account": {
    "droplet_limit": 25,
    "email": "sammy@digitalocean.com",
    "uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
    "email_verified": true
  }
}

+1 for extending the API and doctl to include basic credit and usage information, e.g. something like:

{
"account": {
"dropletlimit": 25,
"email": "sammy@digitalocean.com",
"uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
"email
verified": true,
"currency": "USD",
"credit": 32.30,
"usage": 17.10
}
}

+2 for option to have more detailed information also ...

+1 for pdf's download via API,

If you have lots of teams it is very annoying process to log and save the PDF invoice files...

Have another answer? Share your knowledge.