Invoices API Overview
Programatically access cloud infrastructure invoices
CMP Invoices provides you instant visibility into your Google Cloud, G Suite (Workspace), AWS or Office 365 invoices without having to spend hours scanning through separate cloud vendor billing portals. More information about managing cloud invoices with the CMP is available here
The Billing API helps you programmatically obtain your DoiT International invoices for supported assets such as Google Cloud or Amazon Web Services with an easy-to-use RESTful API.
API Reference
The Invoices API reference is available at https://developer.doit-intl.com/reference#idofinvoices
Required Permissions
Invoice Viewer (part of
Finance User
built-in role)
Invoices API has the following methods:
invoices.list
The invoices.list method provides a list of all invoices available for your billing profile/s, as described under Managing Invoices section.
You can filter the list by using one or more of the following parameters:
Parameter | Description |
---|---|
|
|
|
|
|
Supported filter keys:
Learn more about how to properly use filter *.list requests |
Sample invoices.list Request using both minCreationTime
and filter
parameters:
curl --location --request \
GET 'https://api.doit-intl.com/billing/v1/invoices?minCreationTime=1596243660&filter=platform:amazon-web-services|google-cloud' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw ''
your-api-key
Always replace "your-api-key" with your actual API key as explained at Getting Started
Sample invoices.list Response:
{
"invoices": [
{
"id": "IN204004836",
"invoiceDate": 1598832000000,
"platform": "amazon-web-services",
"dueDate": 1601424000000,
"status": "PAST DUE",
"totalAmount": 68991.75,
"balanceAmount": 80720.35,
"currency": "USD",
"url": "https://files.doit-intl.com/invoices/aaa/bbb.pdf"
},
{
"id": "IN204004665",
"invoiceDate": 1598832000000,
"platform": "google-cloud",
"dueDate": 1601424000000,
"status": "PAST DUE",
"totalAmount": 6804.56,
"balanceAmount": 7961.34,
"currency": "USD",
"url": "https://files.doit-intl.com/invoices/xxx/yyy.pdf"
},
]
}
invoices.get
Get the full details of the individual invoice using the invoice number.
Sample invoices.get Request
curl --location --request GET 'https://api.doit-intl.com/billing/v1/invoices/IN204004836' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw ''
your-api-key
Always replace "your-api-key" with your actual API key as explained at Getting Started
Sample invoices.get Response:
{
"id": "IN204004836",
"invoiceDate": 1598832000000,
"platform": "amazon-web-services",
"dueDate": 1601424000000,
"status": "PAST DUE",
"totalAmount": 10464.36,
"balanceAmount": 80720.35,
"currency": "USD",
"url": "https://files.doit-intl.com/invoices/aaa/bbb.pdf",
"lineItems": [
{
"type": "amazon-web-services",
"description": "Amazon Web Services",
"price": 5825.16,
"qty": 1,
"currency": "USD",
"Details": "Cover 1 month"
},
{
"type": "amazon-web-services",
"description": "Amazon Web Services",
"price": 4639.2,
"qty": 1,
"currency": "USD",
"Details": "Cover 1 month"
}
]
}
Response Body
If successful, the response body contains an instance of Invoice
{
"id": string,
"invoiceDate": number,
"platform": string,
"dueDate": number,
"status": string,
"totalAmount": float,
"balanceAmount": float,
"currency": string,
"url": string,
"lineItems": [ object (lineItem) ]
}
Every invoice will include at least one or more lineItems
:
{
"type": string,
"description": string,
"price": float,
"qty": number,
"currency": string
}
Response Body Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Updated 7 months ago