example-data.com
Menu
Browse docs and collections

invoices

invoices

Page 4 of 13.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/invoices?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/invoices?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/invoices.d.ts https://example-data.com/types/invoices.d.ts
import type { Invoice, ListEnvelope } from "./types/invoices";

const res = await fetch(
  "https://example-data.com/api/v1/invoices?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Invoice>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/invoices",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 73,
      "fromUserId": 207,
      "toUserId": 188,
      "invoiceNumber": "INV-2024-0073",
      "status": "cancelled",
      "issuedAt": "2024-11-10T23:16:21.171Z",
      "dueAt": "2024-12-23T23:16:21.171Z",
      "paidAt": null,
      "subtotal": 14587.62,
      "tax": 1167.01,
      "total": 15754.63,
      "currency": "GBP",
      "lineItems": [
        {
          "description": "Content writing",
          "quantity": 34,
          "unitPrice": 247.43,
          "lineTotal": 8412.62
        },
        {
          "description": "Content writing",
          "quantity": 38,
          "unitPrice": 162.5,
          "lineTotal": 6175
        }
      ],
      "createdAt": "2024-11-10T08:03:09.841Z"
    },
    {
      "id": 74,
      "fromUserId": 116,
      "toUserId": 46,
      "invoiceNumber": "INV-2024-0074",
      "status": "viewed",
      "issuedAt": "2024-09-16T19:10:49.415Z",
      "dueAt": "2024-10-27T19:10:49.415Z",
      "paidAt": null,
      "subtotal": 14745.9,
      "tax": 1179.67,
      "total": 15925.57,
      "currency": "AUD",
      "lineItems": [
        {
          "description": "Implementation services",
          "quantity": 16,
          "unitPrice": 358.8,
          "lineTotal": 5740.8
        },
        {
          "description": "License fee",
          "quantity": 6,
          "unitPrice": 319.36,
          "lineTotal": 1916.16
        },
        {
          "description": "Documentation",
          "quantity": 5,
          "unitPrice": 192.52,
          "lineTotal": 962.6
        },
        {
          "description": "License fee",
          "quantity": 15,
          "unitPrice": 268.06,
          "lineTotal": 4020.9
        },
        {
          "description": "Training session",
          "quantity": 27,
          "unitPrice": 40.39,
          "lineTotal": 1090.53
        },
        {
          "description": "Content writing",
          "quantity": 37,
          "unitPrice": 27.43,
          "lineTotal": 1014.91
        }
      ],
      "createdAt": "2024-09-15T21:33:17.787Z"
    },
    {
      "id": 75,
      "fromUserId": 210,
      "toUserId": 199,
      "invoiceNumber": "INV-2024-0075",
      "status": "paid",
      "issuedAt": "2024-12-01T12:53:44.050Z",
      "dueAt": "2025-01-11T12:53:44.050Z",
      "paidAt": "2025-01-02T11:07:32.199Z",
      "subtotal": 18908.79,
      "tax": 0,
      "total": 18908.79,
      "currency": "GBP",
      "lineItems": [
        {
          "description": "Project management",
          "quantity": 10,
          "unitPrice": 496.88,
          "lineTotal": 4968.8
        },
        {
          "description": "Marketing services",
          "quantity": 25,
          "unitPrice": 360.59,
          "lineTotal": 9014.75
        },
        {
          "description": "License fee",
          "quantity": 34,
          "unitPrice": 144.86,
          "lineTotal": 4925.24
        }
      ],
      "createdAt": "2024-11-30T21:06:34.369Z"
    }
  ],
  "meta": {
    "page": 4,
    "limit": 24,
    "total": 300,
    "totalPages": 13
  },
  "links": {
    "self": "/api/v1/invoices?page=4&limit=24",
    "first": "/api/v1/invoices?page=1&limit=24",
    "last": "/api/v1/invoices?page=13&limit=24",
    "next": "/api/v1/invoices?page=5&limit=24",
    "prev": "/api/v1/invoices?page=3&limit=24"
  }
}