Skip to content

Commit 6bf4b75

Browse files
committed
Billing insights endpoint documentation added to public with related minor fixes
1 parent c8bfa37 commit 6bf4b75

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ tags:
7070
7171
- name: Billing
7272
description: |-
73-
The billing endpoints allow you to retrieve your account balance, invoices
74-
and billing history.
73+
The billing endpoints allow you to retrieve your account balance, invoices,
74+
billing history, and insights.
7575
7676
**Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can
7777
retrieve the balance information for the requested customer account.
@@ -88,6 +88,14 @@ tags:
8888
issued, or credits granted. To interact with invoices, you
8989
will generally send requests to the invoices endpoint at
9090
`/v2/customers/my/billing_history`.
91+
92+
**Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items,
93+
including total amount, region, SKU, and description for a specified date range.
94+
It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for
95+
a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month.
96+
`v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer
97+
account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by
98+
start_date and end_date must be in YYYY-MM-DD format.
9199
92100
- name: Block Storage
93101
description: |-
@@ -831,6 +839,10 @@ paths:
831839
get:
832840
$ref: "resources/billing/invoices_get_summaryByUUID.yml"
833841

842+
/v2/billing/{account_urn}/insights/{start_date}/{end_date}:
843+
get:
844+
$ref: "resources/billing/billingInsights_list.yml"
845+
834846
/v2/databases/options:
835847
get:
836848
$ref: "resources/databases/databases_list_options.yml"

specification/resources/billing/billingInsights_list.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ summary: List Billing Insights
44

55
description: >-
66
7-
This endpoint returns day-over-day changes in billing resource usage based on nightly invoice items, including total amount, region, SKU, and description for a specified date range. It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month.
7+
This endpoint returns day-over-day changes in billing resource usage based on nightly invoice items, including total amount, region, SKU, and description for a specified date range. It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for a given month as nightly invoice item estimates do not necessarily encompass all invoicing factors for the entire month.
88
99
tags:
1010
- Billing
@@ -23,9 +23,6 @@ responses:
2323
'401':
2424
$ref: '../../shared/responses/unauthorized.yml'
2525

26-
'403':
27-
$ref: '../../shared/responses/forbidden.yml'
28-
2926
'404':
3027
$ref: '../../shared/responses/not_found.yml'
3128

specification/resources/billing/examples/python/billingInsights_list.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ source: |-
99
account_urn="do:team:12345678-1234-1234-1234-123456789012",
1010
start_date="2025-01-01",
1111
end_date="2025-01-31",
12-
page_size=100,
13-
page_number=1
12+
per_page=100,
13+
page=1
1414
)

specification/resources/billing/parameters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ account_urn:
1919
start_date:
2020
name: start_date
2121
description: Start date for billing insights in YYYY-MM-DD format
22-
in: query
22+
in: path
2323
schema:
2424
type: string
2525
format: date
@@ -29,7 +29,7 @@ start_date:
2929
end_date:
3030
name: end_date
3131
description: End date for billing insights in YYYY-MM-DD format. Must be within 31 days of start_date
32-
in: query
32+
in: path
3333
schema:
3434
type: string
3535
format: date

0 commit comments

Comments
 (0)