example-data.com

invoices / #222

fromUserId
10
toUserId
28
invoiceNumber
INV-2024-0222
status
draft
issuedAt
dueAt
paidAt
subtotal
6775.92
tax
1016.39
total
7792.31
currency
AUD
lineItems
[
  {
    "description": "Design work",
    "quantity": 6,
    "unitPrice": 466.76,
    "lineTotal": 2800.56
  },
  {
    "description": "Hardware supply",
    "quantity": 24,
    "unitPrice": 165.64,
    "lineTotal": 3975.36
  }
]
createdAt

Component variants

curl -sS \
  "https://example-data.com/api/v1/invoices/222" \
  -H "Accept: application/json"
const res = await fetch(
  "https://example-data.com/api/v1/invoices/222"
);
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/222"
);
const invoice = (await res.json()) as Invoice;
import requests

res = requests.get(
    "https://example-data.com/api/v1/invoices/222"
)
invoice = res.json()
{
  "id": 222,
  "fromUserId": 10,
  "toUserId": 28,
  "invoiceNumber": "INV-2024-0222",
  "status": "draft",
  "issuedAt": "2024-10-07T22:13:29.916Z",
  "dueAt": "2024-11-29T22:13:29.916Z",
  "paidAt": null,
  "subtotal": 6775.92,
  "tax": 1016.39,
  "total": 7792.31,
  "currency": "AUD",
  "lineItems": [
    {
      "description": "Design work",
      "quantity": 6,
      "unitPrice": 466.76,
      "lineTotal": 2800.56
    },
    {
      "description": "Hardware supply",
      "quantity": 24,
      "unitPrice": 165.64,
      "lineTotal": 3975.36
    }
  ],
  "createdAt": "2024-10-07T03:15:01.734Z"
}
Draftbit