Get all invoices
Route
GET
/api/v1/invoices?per_page=2&page=1
Usage
- Curl
- Python
- Ruby
- Node.js
- Go
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request GET "$LAGO_URL/api/v1/invoices?per_page=2&page=1" \
--header "Authorization: Bearer $API_KEY"
from lago_python_client import Client
client = Client(api_key='__YOUR_API_KEY__')
client.invoices().find_all({'per_page': 2, 'page': 1})
require 'lago-ruby-client'
client = Lago::Api::Client.new({api_key: '__YOUR_API_KEY__'})
client.invoices.get_all({ per_page: 2, page: 3 })
let client = new Client('__API_KEY__')
await client.findAllInvoices({per_page: 2, page: 3});
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
invoiceListInput := &lago.InvoiceListInput{
PerPage: 1,
Page: 1,
IssuingDateFrom: "2022-01-01",
IssuingDateTo: "2022-01-01",
}
invoiceResult, err := lagoClient.Invoice().GetList(invoiceListInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// invoiceResult is *lago.InvoiceResult
fmt.Println(invoiceResult)
}
Arguments
Attributes | Type | Description |
---|---|---|
per_page | String Optional | Number of records per page. |
page | String Optional | Page number |
issuing_date_from | String Optional | Filter results by FROM date. Format example: 2022-02-15 |
issuing_date_to | String Optional | Filter results by TO date. Format example: 2022-02-15 |
external_customer_id | String Optional | Filter results by CUSTOMER unique identifier in your application |
status | String Optional | Filter results by status (draft or finalized ) |
payment_status | String Optional | Filter results by payment status (pending , failed or succeeded ) |
Responses
- HTTP 200
- HTTP 401
Invoices were successfully found.
Returns a list of invoice objects.
{
"status": 401,
"error": "Unauthorized"
}
Access to the API endpoint is unhautorized.
Possible reasons are:
- The
Authorization
header is missing - The
Authorization
header does not contain the API key - The Api key is invalid or expired