example-data.com

invoices / #2

fromUserId
5
toUserId
3
invoiceNumber
INV-2024-0002
status
draft
issuedAt
dueAt
paidAt
subtotal
14134.68
tax
2826.94
total
16961.62
currency
USD
lineItems
[
  {
    "description": "Technical support",
    "quantity": 35,
    "unitPrice": 127.26,
    "lineTotal": 4454.1
  },
  {
    "description": "Documentation",
    "quantity": 21,
    "unitPrice": 460.98,
    "lineTotal": 9680.58
  }
]
createdAt

Component variants

curl -sS \
  "https://example-data.com/api/v1/invoices/2" \
  -H "Accept: application/json"
const res = await fetch(
  "https://example-data.com/api/v1/invoices/2"
);
const invoice = await res.json();
import type { Invoice } from "https://example-data.com/types/invoices.d.ts";

const res = await fetch(
  "https://example-data.com/api/v1/invoices/2"
);
const invoice = (await res.json()) as Invoice;
import requests

res = requests.get(
    "https://example-data.com/api/v1/invoices/2"
)
invoice = res.json()
{
  "id": 2,
  "fromUserId": 5,
  "toUserId": 3,
  "invoiceNumber": "INV-2024-0002",
  "status": "draft",
  "issuedAt": "2024-12-19T11:26:51.370Z",
  "dueAt": "2025-01-06T11:26:51.370Z",
  "paidAt": null,
  "subtotal": 14134.68,
  "tax": 2826.94,
  "total": 16961.62,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Technical support",
      "quantity": 35,
      "unitPrice": 127.26,
      "lineTotal": 4454.1
    },
    {
      "description": "Documentation",
      "quantity": 21,
      "unitPrice": 460.98,
      "lineTotal": 9680.58
    }
  ],
  "createdAt": "2024-12-19T04:18:33.361Z"
}
Draftbit