cURL
curl https://invoice.horizonpay.co/api/v1/invoices/in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8/events \
-H "Authorization: Bearer $INVOICE_AI_API_KEY"import InvoiceAI from '@horizonpay/invoice-ai'
const invoiceai = new InvoiceAI() // reads INVOICE_AI_API_KEY
for await (const event of invoiceai.invoices.events('in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8')) {
console.log(event.type, event.created_at)
}from invoice_ai import InvoiceAI
client = InvoiceAI() # reads INVOICE_AI_API_KEY
for event in client.invoices.events("in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8"):
print(event.type, event.created_at){
"data": [
{
"id": "9b1e5c7a-2d4f-4a86-b3e0-7c5d1f9a2e64",
"type": "invoice.paid",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28",
"reference": "chk_123456"
},
"created_at": "2026-09-29T14:20:00.000Z"
},
{
"id": "3e8d1a6c-5f2b-4c90-a7e3-8b4d2f1c6a95",
"type": "invoice.viewed",
"meta": null,
"created_at": "2026-09-23T08:12:00.000Z"
},
{
"id": "7a2c9e4f-1b6d-4f38-9e5a-2c8b6d4f1e07",
"type": "invoice.emailed",
"meta": {
"to": "[email protected]"
},
"created_at": "2026-09-22T10:00:05.000Z"
},
{
"id": "5c4f7b2e-9a1d-4e63-8f0b-6d3a2e9c7b18",
"type": "invoice.finalized",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28"
},
"created_at": "2026-09-22T10:00:00.000Z"
},
{
"id": "1d9b6e3a-4c7f-4a25-b8e1-9f2c5a7d3b60",
"type": "invoice.created",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28"
},
"created_at": "2026-09-22T09:30:00.000Z"
}
],
"next_cursor": null
}{
"type": "https://invoice.horizonpay.co/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Send your API key as `Authorization: Bearer inv_live_…`.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "unauthorized"
}{
"type": "https://invoice.horizonpay.co/problems/forbidden",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential is missing the invoices:write scope.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "forbidden"
}{
"type": "https://invoice.horizonpay.co/problems/not-found",
"title": "Not found",
"status": 404,
"detail": "Invoice not found.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "not_found"
}{
"type": "https://invoice.horizonpay.co/problems/validation",
"title": "Validation failed",
"status": 422,
"detail": "The cursor is not valid.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "validation",
"errors": [
{
"path": "cursor",
"message": "Pass the `next_cursor` from the previous page, unchanged."
}
]
}{
"type": "https://invoice.horizonpay.co/problems/rate-limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit of 120 per 60s exceeded.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "rate_limited"
}Invoices
List invoice events
Lists one invoice’s history, newest first: created, updated, finalized, emailed, viewed, downloaded, paid, voided. invoice.viewed and invoice.downloaded mean the customer opened the public link; each is recorded at most once per invoice every 10 minutes.
Scope: invoices:read
GET
/
invoices
/
{id}
/
events
cURL
curl https://invoice.horizonpay.co/api/v1/invoices/in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8/events \
-H "Authorization: Bearer $INVOICE_AI_API_KEY"import InvoiceAI from '@horizonpay/invoice-ai'
const invoiceai = new InvoiceAI() // reads INVOICE_AI_API_KEY
for await (const event of invoiceai.invoices.events('in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8')) {
console.log(event.type, event.created_at)
}from invoice_ai import InvoiceAI
client = InvoiceAI() # reads INVOICE_AI_API_KEY
for event in client.invoices.events("in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8"):
print(event.type, event.created_at){
"data": [
{
"id": "9b1e5c7a-2d4f-4a86-b3e0-7c5d1f9a2e64",
"type": "invoice.paid",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28",
"reference": "chk_123456"
},
"created_at": "2026-09-29T14:20:00.000Z"
},
{
"id": "3e8d1a6c-5f2b-4c90-a7e3-8b4d2f1c6a95",
"type": "invoice.viewed",
"meta": null,
"created_at": "2026-09-23T08:12:00.000Z"
},
{
"id": "7a2c9e4f-1b6d-4f38-9e5a-2c8b6d4f1e07",
"type": "invoice.emailed",
"meta": {
"to": "[email protected]"
},
"created_at": "2026-09-22T10:00:05.000Z"
},
{
"id": "5c4f7b2e-9a1d-4e63-8f0b-6d3a2e9c7b18",
"type": "invoice.finalized",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28"
},
"created_at": "2026-09-22T10:00:00.000Z"
},
{
"id": "1d9b6e3a-4c7f-4a25-b8e1-9f2c5a7d3b60",
"type": "invoice.created",
"meta": {
"actor": "api_key",
"request_id": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"api_key_id": "6d3a9f1c-8e2b-4c75-a0d4-1f7e3b9c5a28"
},
"created_at": "2026-09-22T09:30:00.000Z"
}
],
"next_cursor": null
}{
"type": "https://invoice.horizonpay.co/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Send your API key as `Authorization: Bearer inv_live_…`.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "unauthorized"
}{
"type": "https://invoice.horizonpay.co/problems/forbidden",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential is missing the invoices:write scope.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "forbidden"
}{
"type": "https://invoice.horizonpay.co/problems/not-found",
"title": "Not found",
"status": 404,
"detail": "Invoice not found.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "not_found"
}{
"type": "https://invoice.horizonpay.co/problems/validation",
"title": "Validation failed",
"status": 422,
"detail": "The cursor is not valid.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "validation",
"errors": [
{
"path": "cursor",
"message": "Pass the `next_cursor` from the previous page, unchanged."
}
]
}{
"type": "https://invoice.horizonpay.co/problems/rate-limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit of 120 per 60s exceeded.",
"instance": "req_7f3c9a1e2b4d4e8a9c6f2d1b0a3e5f71",
"code": "rate_limited"
}Authorizations
An Invoice-AI API key sent as Authorization: Bearer inv_live_….
Create keys in Settings → API keys; the secret is shown once. Each key carries scopes, and every operation lists the scope it needs (x-required-scope):
business:read— Read your business profile, tax ID and bank detailsclients:read— List and read your clientsclients:write— Create, update and archive clientsproducts:read— List and read products and pricesproducts:write— Create, update and archive products and pricesinvoices:read— List and read invoices, including PDFsinvoices:write— Create, edit and delete draftsinvoices:finalize— Finalize invoices and void theminvoices:send— Email invoices to your clientspayments:write— Mark invoices as paidwebhooks:manage— Manage webhook endpoints
Keys cannot be created or revoked through the API, so a leaked key cannot mint more keys.
Path Parameters
The invoice, in_… or UUID.
Example:
"in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8"
Query Parameters
The next_cursor from the previous page. Opaque — do not build it yourself.
Page size, 1–100. Defaults to 25.
Required range:
1 <= x <= 100