Skip to content

Latest commit

 

History

History
128 lines (89 loc) · 3.97 KB

BillingInvoicesApi.md

File metadata and controls

128 lines (89 loc) · 3.97 KB

Fastly\Api\BillingInvoicesApi

$apiInstance = new Fastly\Api\BillingInvoicesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

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($options): \Fastly\Model\EomInvoiceResponse // Get invoice by ID.

Returns invoice associated with the invoice id.

Example

    $options['invoice_id'] = 4183280; // int

try {
    $result = $apiInstance->getInvoiceByInvoiceId($options);
} catch (Exception $e) {
    echo 'Exception when calling BillingInvoicesApi->getInvoiceByInvoiceId: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

Name Type Description Notes
invoice_id int

Return type

\Fastly\Model\EomInvoiceResponse

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

getMonthToDateInvoice()

getMonthToDateInvoice($options): \Fastly\Model\MtdInvoiceResponse // Get month-to-date invoice.

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

Example

    
try {
    $result = $apiInstance->getMonthToDateInvoice($options);
} catch (Exception $e) {
    echo 'Exception when calling BillingInvoicesApi->getMonthToDateInvoice: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

This endpoint does not need any parameters.

Return type

\Fastly\Model\MtdInvoiceResponse

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

listInvoices()

listInvoices($options): \Fastly\Model\ListEomInvoicesResponse // List of invoices.

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

Example

    $options['billing_start_date'] = 2023-01-01; // string
$options['billing_end_date'] = 2023-01-31; // string
$options['limit'] = '100'; // string | Number of results per page. The maximum is 200.
$options['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.

try {
    $result = $apiInstance->listInvoices($options);
} catch (Exception $e) {
    echo 'Exception when calling BillingInvoicesApi->listInvoices: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

\Fastly\Model\ListEomInvoicesResponse

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