require 'fastly'
api_instance = Fastly::BillingInvoicesApi.new
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
get_invoice_by_invoice_id | GET /billing/v3/invoices/{invoice_id} | Get invoice by ID. |
get_month_to_date_invoice | GET /billing/v3/invoices/month-to-date | Get month-to-date invoice. |
list_invoices | GET /billing/v3/invoices | List of invoices. |
get_invoice_by_invoice_id(opts): <EomInvoiceResponse> # Get invoice by ID.
Returns invoice associated with the invoice id.
api_instance = Fastly::BillingInvoicesApi.new
opts = {
invoice_id: 4183280, # Integer |
}
begin
# Get invoice by ID.
result = api_instance.get_invoice_by_invoice_id(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling BillingInvoicesApi->get_invoice_by_invoice_id: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | Integer |
[Back to top] [Back to API list] [Back to README]
get_month_to_date_invoice: <MtdInvoiceResponse> # Get month-to-date invoice.
Returns month-to-date invoice for the current month.
api_instance = Fastly::BillingInvoicesApi.new
begin
# Get month-to-date invoice.
result = api_instance.get_month_to_date_invoice
p result
rescue Fastly::ApiError => e
puts "Error when calling BillingInvoicesApi->get_month_to_date_invoice: #{e}"
end
This endpoint does not need any parameter.
[Back to top] [Back to API list] [Back to README]
list_invoices(opts): <ListEomInvoicesResponse> # List of invoices.
Returns the list of invoices, sorted by billing start date (newest to oldest).
api_instance = Fastly::BillingInvoicesApi.new
opts = {
billing_start_date: '2023-01-01', # String |
billing_end_date: '2023-01-31', # String |
limit: 'limit_example', # String | Number of results per page. The maximum is 200.
cursor: 'cursor_example', # 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.
}
begin
# List of invoices.
result = api_instance.list_invoices(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling BillingInvoicesApi->list_invoices: #{e}"
end
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][default 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] |