Skip to content

Latest commit

 

History

History
121 lines (75 loc) · 3.97 KB

BillingApi.md

File metadata and controls

121 lines (75 loc) · 3.97 KB

BillingApi

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
get_invoice GET /billing/v2/year/{year}/month/{month} Get an invoice
get_invoice_by_id GET /billing/v2/account_customers/{customer_id}/invoices/{invoice_id} Get an invoice
get_invoice_mtd GET /billing/v2/account_customers/{customer_id}/mtd_invoice Get month-to-date billing estimate

get_invoice

Get the invoice for a given year and month. Can be any month from when the Customer was created to the current month.

let cfg = &Configuration::default();
let params = GetInvoiceParams {
    // parameters
};
get_invoice(cfg, params)

Parameters

Name Type Description Required Notes
month String 2-digit month. [required]
year String 4-digit year. [required]

Return type

crate::models::BillingResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/csv, application/pdf

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

get_invoice_by_id

Get the invoice for the given invoice_id.

let cfg = &Configuration::default();
let params = GetInvoiceByIdParams {
    // parameters
};
get_invoice_by_id(cfg, params)

Parameters

Name Type Description Required Notes
customer_id String Alphanumeric string identifying the customer. [required]
invoice_id i32 [required]

Return type

crate::models::BillingResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/csv, application/pdf

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

get_invoice_mtd

Get the current month-to-date estimate. This endpoint has two different responses. Under normal circumstances, it generally takes less than 5 seconds to generate but in certain cases can take up to 60 seconds. Once generated the month-to-date estimate is cached for 4 hours, and is available the next request will return the JSON representation of the month-to-date estimate. While a report is being generated in the background, this endpoint will return a 202 Accepted response. The full format of which can be found in detail in our billing calculation guide. There are certain accounts for which we are unable to generate a month-to-date estimate. For example, accounts who have parent-pay are unable to generate an MTD estimate. The parent accounts are able to generate a month-to-date estimate but that estimate will not include the child accounts amounts at this time.

let cfg = &Configuration::default();
let params = GetInvoiceMtdParams {
    // parameters
};
get_invoice_mtd(cfg, params)

Parameters

Name Type Description Required Notes
customer_id String Alphanumeric string identifying the customer. [required]
month Option<String> 2-digit month.
year Option<String> 4-digit year.

Return type

crate::models::BillingEstimateResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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