import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.invoices.list({});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"status": "open",
"number": "<string>",
"description": "<string>",
"customer_name": "<string>",
"email_address": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"amount": 123,
"currency": "<string>",
"paid_at": "<string>",
"price_variant": "<string>",
"customer": "<string>",
"order": "<string>"
}
],
"has_more": true,
"url": "<string>"
}Returns a list of invoices for the current account
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.invoices.list({});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"status": "open",
"number": "<string>",
"description": "<string>",
"customer_name": "<string>",
"email_address": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"amount": 123,
"currency": "<string>",
"paid_at": "<string>",
"price_variant": "<string>",
"customer": "<string>",
"order": "<string>"
}
],
"has_more": true,
"url": "<string>"
}API key in the format: Bearer {api_token}
Filter by invoice status
open, paid, past_due, void Filter by customer ID
Comma-separated relations to expand: customer, price_variant, order
Cursor for pagination — the ID of the last item in the previous page
Items per page
1 <= x <= 100Was this page helpful?