const apiInstance = new Fastly.BillingInvoicesApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
getInvoiceByInvoiceId | GET /billing/v3/invoices/{invoice_id} | Get invoice by ID. |
getMonthToDateInvoice | GET /billing/v3/invoices/month-to-date | Get month-to-date invoice. |
listInvoices | GET /billing/v3/invoices | List of invoices. |
getInvoiceByInvoiceId({ invoice_id })
Returns invoice associated with the invoice id.
const options = {
invoice_id: 4183280, // required
};
apiInstance.getInvoiceByInvoiceId(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | Number |
getMonthToDateInvoice()
Returns month-to-date invoice for the current month.
apiInstance.getMonthToDateInvoice()
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
This endpoint does not need any parameters.
listInvoices({ , [billing_start_date, ][billing_end_date, ][limit, ][cursor] })
Returns the list of invoices, sorted by billing start date (newest to oldest).
const options = {
billing_start_date: 2023-01-01,
billing_end_date: 2023-01-31,
limit: "'100'",
cursor: "cursor_example",
};
apiInstance.listInvoices(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
billing_start_date | String | [optional] | |
billing_end_date | String | [optional] | |
limit | String | Number of results per page. The maximum is 200. | [optional] [defaults to '100'] |
cursor | String | Cursor value from the next_cursor field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
[optional] |