pydo.invoices.get_by_uuid()

Description

To retrieve the invoice items for an invoice, send a GET request to /v2/customers/my/invoices/$INVOICE_UUID.

Parameters

Name Type Required Description Default Value
invoice_uuid string True UUID of the invoice

Request Sample

import os
from pydo import Client

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

invoices = client.invoices.get_by_uuid(invoice_uuid=1)

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 with a key called invoice_items. This will be set to an array of invoice item objects.

Click to expand an example response.
{
  "invoice_items": [
    {
      "product": "Kubernetes Clusters",
      "resource_uuid": "711157cb-37c8-4817-b371-44fa3504a39c",
      "group_description": "my-doks-cluster",
      "description": "a56e086a317d8410c8b4cfd1f4dc9f82",
      "amount": "12.34",
      "duration": "744",
      "duration_unit": "Hours",
      "start_time": "2020-01-01T00:00:00Z",
      "end_time": "2020-02-01T00:00:00Z"
    },
    {
      "product": "Spaces Subscription",
      "description": "Spaces ($5/mo 250GB storage & 1TB bandwidth)",
      "amount": "34.45",
      "duration": "744",
      "duration_unit": "Hours",
      "start_time": "2020-01-01T00:00:00Z",
      "end_time": "2020-02-01T00:00:00Z"
    }
  ],
  "links": {
    "pages": {
      "next": "https://api.digitalocean.com/v2/customers/my/invoices/22737513-0ea7-4206-8ceb-98a575af7681?page=2&per_page=2",
      "last": "https://api.digitalocean.com/v2/customers/my/invoices/22737513-0ea7-4206-8ceb-98a575af7681?page=3&per_page=2"
    }
  },
  "meta": {
    "total": 6
  }
}

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"
}