API reference
//List invoices
🔐 Required role:
API_ADMIN📖 Data dictionary: Invoice
Retrieve invoices with AR transaction data, paginated
This operation accepts only pageSize and page; any other body property is rejected with 400. To filter, use POST /gql/v1/invoices/search.
Uses standard limit/offset pagination via pageSize and page — see Pagination. Use total.aggregate.count to detect the end.
This endpoint delivers complete invoice management functionality with:
- Pagination for large invoice datasets
- Integration with AR transactions for complete financial context
- Tax, interest, and payment status tracking
- Client relationship data for each invoice
- Aggregate counting for reporting and analytics
Key Financial Features:
- Invoice status tracking (PENDING, PAID, OVERDUE, POSTED, etc.)
- Tax and interest calculations included
- Due date monitoring for collections management
- AR transaction linkage for payment reconciliation
- Amount and allocation tracking for financial reporting
Ordering: newest first (createdAt desc), then invoiceNumber asc.
Business Applications:
- Accounts receivable management and aging reports
- Client billing history and statement generation
- Collections management and overdue tracking
- Financial reporting and revenue recognition
- Payment reconciliation and allocation tracking
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Limit — number of records to return (not a page count). Hasura maps this to limit.
Default:50
Example:25
- Sandbox (requires Cloudflare Access headers)https://api.sandbox.aiwyn.app/gql/v1/invoices
- Staging (requires Cloudflare Access headers)https://api.staging.aiwyn.app/gql/v1/invoices
- Production (your live firm data; no Cloudflare Access headers)https://api.aiwyn.ai/gql/v1/invoices
curl -i -X POST \
https://api.sandbox.aiwyn.app/gql/v1/invoices \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
-H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"pageSize": 25,
"page": 0
}'Response
{ "invoices": [ { … }, { … }, { … } ], "total": { "aggregate": { … } } }