Skip to content

Latest commit

 

History

History
124 lines (87 loc) · 2.84 KB

BillingInvoicesApi.md

File metadata and controls

124 lines (87 loc) · 2.84 KB

Fastly.BillingInvoicesApi

const apiInstance = new Fastly.BillingInvoicesApi();

Methods

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

getInvoiceByInvoiceId({ invoice_id })

Returns invoice associated with the invoice id.

Example

const options = {
  invoice_id: 4183280, // required
};

apiInstance.getInvoiceByInvoiceId(options)
  .then((data) => {
    console.log(data, "API called successfully.");
  })
  .catch((error) => {
    console.error(error);
  });

Options

Name Type Description Notes
invoice_id Number

Return type

EomInvoiceResponse

getMonthToDateInvoice

getMonthToDateInvoice()

Returns month-to-date invoice for the current month.

Example

apiInstance.getMonthToDateInvoice()
  .then((data) => {
    console.log(data, "API called successfully.");
  })
  .catch((error) => {
    console.error(error);
  });

Options

This endpoint does not need any parameters.

Return type

MtdInvoiceResponse

listInvoices

listInvoices({ , [billing_start_date, ][billing_end_date, ][limit, ][cursor] })

Returns the list of invoices, sorted by billing start date (newest to oldest).

Example

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);
  });

Options

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]

Return type

ListEomInvoicesResponse

[Back to top] [Back to API list] [Back to README]