pydo.billing_history.list()

Description

To retrieve a list of all billing history entries, send a GET request to /v2/customers/my/billing_history.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

balance = client.billing_history.list()

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The response will be a JSON object that contains the following attributes

Click to expand an example response.
{
  "billing_history": [
    {
      "description": "Invoice for May 2018",
      "amount": "12.34",
      "invoice_id": "123",
      "invoice_uuid": "example-uuid",
      "date": "2018-06-01T08:44:38Z",
      "type": "Invoice"
    },
    {
      "description": "Payment (MC 2018)",
      "amount": "-12.34",
      "date": "2018-06-02T08:44:38Z",
      "type": "Payment"
    }
  ],
  "links": {
    "pages": {
      "next": "https://api.digitalocean.com/v2/customers/my/billing_history?page=2&per_page=2",
      "last": "https://api.digitalocean.com/v2/customers/my/billing_history?page=3&per_page=2"
    }
  },
  "meta": {
    "total": 5
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}