Get a list of invoices
Get a list of invoices with details about each invoices using the API.
You can also review all invoices on your Dashboard > Data > Accounts. Open the account for which you want to review invoices, then go to the Invoices tab.
Guide​
- Call the
account
query. - Add the account ID.
- Add all information you'd like to review about each invoice.
- Add pagination if you're looking for invoices for a certain interval.
Query​
🔎 Open the query in API Explorer
query RetrieveInvoices {
account(accountId: "$YOUR_ACCOUNT_ID") {
invoices(after: "", first: 10) {
edges {
node {
closingDate
createdAt
expiresAt
name
id
openingDate
status
updatedAt
url
type
}
}
pageInfo {
hasNextPage
hasPreviousPage
}
totalCount
}
}
}
Payload​
The query returns all of the information about two invoices.
{
"data": {
"account": {
"invoices": {
"edges": [
{
"node": {
"closingDate": "2023-02-28T22:59:59.999Z",
"createdAt": "2023-02-16T16:04:51.331Z",
"expiresAt": "2023-02-17T16:08:32.832Z",
"name": "INVOICE-20230228",
"id": "dc43f0f6-7bae-4f05-8b35-82363a1a17cf",
"openingDate": "2023-01-31T23:00:00.000Z",
"status": "Paid",
"updatedAt": "2023-02-16T16:04:52.582Z",
"url": "$INVOICE_URL",
"type":"Invoice"
}
},
{
"node": {
"closingDate": "2023-02-28T22:59:59.999Z",
"createdAt": "2023-02-16T16:02:55.416Z",
"expiresAt": "2023-02-17T16:08:32.832Z",
"name": "INVOICE-20230228",
"id": "b9ccad06-417a-48e0-8a08-37fee4ea39a3",
"openingDate": "2023-01-31T23:00:00.000Z",
"status": "Voided",
"updatedAt": "2023-02-16T16:04:50.888Z",
"url": null,
"type":"Invoice"
}
}
],
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": true
},
"totalCount": 2
}
}
}
}