> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt # GetAccountInvoices POST https://api.voximplant.com/platform_api/GetAccountInvoices Gets all invoices for the specified USD or EUR account. **Example request:** GetAccountInvoices example. Reference: https://docs.voximplant.ai/api-reference/management-api/reference/invoices/get-account-invoices ## Authentication - `Authorization` header (bearer token, required) — Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the `Authorization` header as a Bearer value: ``` Authorization: Bearer $VOXIMPLANT_TOKEN ``` See [Authorization](/api-reference/management-api/authorization) for ready-to-copy snippets in bash, Python, Node.js and Go that turn your `credentials.json` into a token. ## Request ### Query parameters - `count` (integer, optional) — Number of invoices to show per page. Default value is 20 - `offset` (integer, optional) — Number of invoices to skip (e.g. if you set count = 20 and offset = 0 the first time, the next time, offset has to be equal to 20 to skip the items shown earlier). Default value is 0 ## Response ### 200 Successful response - `result` (list of AccountInvoice, optional) — Array of the account invoices - `total_count` (integer, optional) — Total number of invoices matching the query parameters - `count` (integer, optional) — Number of returned invoices matching the query parameters ## Types ### AccountInvoice GetAccountInvoices function result. - `period` (InvoicePeriod, optional) — Invoice period - `amount` (InvoiceTotalDetails, optional) — Info on all money spent in the invoice - `invoice_id` (integer, optional) — Invoice id - `rows` (list of AccountInvoiceRowsItems, optional) — Detailed info on each spending - `invoice_number` (string, optional) — Unique invoice number - `invoice_date` (string, optional) — Date string as returned by the Management API. Date when the invoice is created in the following format: YYYY-MM-DD - `status` (string, optional) — Invoice status ### InvoicePeriod Invoices period. - `from` (string, optional) — Date string as returned by the Management API. From date in the following format: YYYY-MM-DD - `to` (string, optional) — Date string as returned by the Management API. To date in the following format: YYYY-MM-DD ### InvoiceTotalDetails Invoice total amount details. - `tax_amount` (double, optional) — Total amount of taxes - `total_amount` (double, optional) — Invoice total amount including taxes - `amount_to_pay` (double, optional) — Discounted amount to pay - `discount_amount` (double, optional) — Discount - `currency` (string, optional) — Invoice currency ### AccountInvoiceRowsItems - `amount` (AccountInvoiceRowsItemsAmount, optional) - `service_name` (string, optional) - `taxes` (list of AccountInvoiceRowsItemsTaxesItems, optional) ### AccountInvoiceRowsItemsAmount - `tax_amount` (double, optional) - `total_amount` (integer, optional) - `amount_to_pay` (integer, optional) - `discount_amount` (integer, optional) - `currency` (string, optional) ### AccountInvoiceRowsItemsTaxesItems - `taxable_measure` (double, optional) - `amount` (double, optional) - `level` (string, optional) - `rate` (double, optional) - `name` (string, optional) - `currency` (string, optional) - `category` (string, optional) ## Examples **Response** ```json { "result": [ { "period": { "from": "2021-05-11", "to": "2021-05-31" }, "amount": { "tax_amount": 47.23144604, "total_amount": 300, "amount_to_pay": 270, "discount_amount": 30, "currency": "USD" }, "invoice_id": 1, "rows": [ { "amount": { "tax_amount": 47.23144604, "total_amount": 300, "amount_to_pay": 207, "discount_amount": 30, "currency": "USD" }, "service_name": "Phone numbers", "taxes": [ { "taxable_measure": 291.37165093, "amount": 8.44977788, "level": "State", "rate": 0.029, "name": "Excise Tax (Wireless)", "currency": "USD", "category": "EXCISE TAXES" }, { "taxable_measure": 32.4, "amount": 10.8216, "level": "Federal", "rate": 0.334, "name": "Fed USF Paging", "currency": "USD", "category": "CONNECTIVITY CHARGES" }, { "taxable_measure": 291.37216628, "amount": 1.09264562, "level": "City", "rate": 0.00375, "name": "NY Local Transit Tax", "currency": "USD", "category": "SALES AND USE TAXES" }, { "taxable_measure": 291.371485, "amount": 2.10078841, "level": "County", "rate": 0.00721, "name": "NY MCTD 186c (Wireless)", "currency": "USD", "category": "EXCISE TAXES" }, { "taxable_measure": 291.37216628, "amount": 13.11174748, "level": "City", "rate": 0.045, "name": "NY Sales Tax", "currency": "USD", "category": "SALES AND USE TAXES" }, { "taxable_measure": 291.37216628, "amount": 11.65488665, "level": "State", "rate": 0.04, "name": "NY Sales Tax", "currency": "USD", "category": "SALES AND USE TAXES" } ] } ], "invoice_number": "US-1", "invoice_date": "2021-09-31", "status": "numbered" } ], "total_count": 1, "count": 1 } ``` **SDK Code** ```python Example 1 import requests url = "https://api.voximplant.com/platform_api/GetAccountInvoices" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Example 1 const url = 'https://api.voximplant.com/platform_api/GetAccountInvoices'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example 1 package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.voximplant.com/platform_api/GetAccountInvoices" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Example 1 require 'uri' require 'net/http' url = URI("https://api.voximplant.com/platform_api/GetAccountInvoices") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Example 1 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.voximplant.com/platform_api/GetAccountInvoices") .header("Authorization", "Bearer ") .asString(); ``` ```php Example 1 request('POST', 'https://api.voximplant.com/platform_api/GetAccountInvoices', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Example 1 using RestSharp; var client = new RestClient("https://api.voximplant.com/platform_api/GetAccountInvoices"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Example 1 import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetAccountInvoices")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```