All URIs are relative to https://api.vultr.com/v2
Method | HTTP request | Description |
---|---|---|
get_invoice | GET /billing/invoices/{invoice-id} | Get Invoice |
get_invoice_items | GET /billing/invoices/{invoice-id}/items | Get Invoice Items |
list_billing_history | GET /billing/history | List Billing History |
list_invoices | GET /billing/invoices | List Invoices |
get_invoice(invoice_id)
Get Invoice
Retrieve specified invoice
require 'time'
require 'vultr_ruby'
# setup authorization
VultrRuby.configure do |config|
# Configure Bearer authorization: API Key
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = VultrRuby::BillingApi.new
invoice_id = 'invoice_id_example' # String | ID of invoice
begin
# Get Invoice
result = api_instance.get_invoice(invoice_id)
p result
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->get_invoice: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_invoice_with_http_info(invoice_id)
begin
# Get Invoice
data, status_code, headers = api_instance.get_invoice_with_http_info(invoice_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetInvoice200Response>
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->get_invoice_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | String | ID of invoice |
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json
get_invoice_items(invoice_id)
Get Invoice Items
Retrieve full specified invoice
require 'time'
require 'vultr_ruby'
# setup authorization
VultrRuby.configure do |config|
# Configure Bearer authorization: API Key
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = VultrRuby::BillingApi.new
invoice_id = 'invoice_id_example' # String | ID of invoice
begin
# Get Invoice Items
result = api_instance.get_invoice_items(invoice_id)
p result
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->get_invoice_items: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_invoice_items_with_http_info(invoice_id)
begin
# Get Invoice Items
data, status_code, headers = api_instance.get_invoice_items_with_http_info(invoice_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetInvoiceItems200Response>
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->get_invoice_items_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | String | ID of invoice |
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json
list_billing_history
List Billing History
Retrieve list of billing history
require 'time'
require 'vultr_ruby'
# setup authorization
VultrRuby.configure do |config|
# Configure Bearer authorization: API Key
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = VultrRuby::BillingApi.new
begin
# List Billing History
result = api_instance.list_billing_history
p result
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->list_billing_history: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_billing_history_with_http_info
begin
# List Billing History
data, status_code, headers = api_instance.list_billing_history_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <ListBillingHistory200Response>
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->list_billing_history_with_http_info: #{e}"
end
This endpoint does not need any parameter.
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json
list_invoices
List Invoices
Retrieve a list of invoices
require 'time'
require 'vultr_ruby'
# setup authorization
VultrRuby.configure do |config|
# Configure Bearer authorization: API Key
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = VultrRuby::BillingApi.new
begin
# List Invoices
result = api_instance.list_invoices
p result
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->list_invoices: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_invoices_with_http_info
begin
# List Invoices
data, status_code, headers = api_instance.list_invoices_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <ListInvoices200Response>
rescue VultrRuby::ApiError => e
puts "Error when calling BillingApi->list_invoices_with_http_info: #{e}"
end
This endpoint does not need any parameter.
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json