example-data.com

invoices / #231

fromUserId
48
toUserId
54
invoiceNumber
INV-2024-0231
status
viewed
issuedAt
dueAt
paidAt
subtotal
23007.28
tax
1840.58
total
24847.86
currency
USD
lineItems
[
  {
    "description": "Hardware supply",
    "quantity": 12,
    "unitPrice": 207.88,
    "lineTotal": 2494.56
  },
  {
    "description": "Marketing services",
    "quantity": 34,
    "unitPrice": 211.18,
    "lineTotal": 7180.12
  },
  {
    "description": "Hardware supply",
    "quantity": 35,
    "unitPrice": 372.78,
    "lineTotal": 13047.3
  },
  {
    "description": "Legal review",
    "quantity": 6,
    "unitPrice": 47.55,
    "lineTotal": 285.3
  }
]
createdAt

Component variants

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

res = requests.get(
    "https://example-data.com/api/v1/invoices/231"
)
invoice = res.json()
{
  "id": 231,
  "fromUserId": 48,
  "toUserId": 54,
  "invoiceNumber": "INV-2024-0231",
  "status": "viewed",
  "issuedAt": "2024-12-07T01:31:54.998Z",
  "dueAt": "2024-12-31T01:31:54.998Z",
  "paidAt": null,
  "subtotal": 23007.28,
  "tax": 1840.58,
  "total": 24847.86,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Hardware supply",
      "quantity": 12,
      "unitPrice": 207.88,
      "lineTotal": 2494.56
    },
    {
      "description": "Marketing services",
      "quantity": 34,
      "unitPrice": 211.18,
      "lineTotal": 7180.12
    },
    {
      "description": "Hardware supply",
      "quantity": 35,
      "unitPrice": 372.78,
      "lineTotal": 13047.3
    },
    {
      "description": "Legal review",
      "quantity": 6,
      "unitPrice": 47.55,
      "lineTotal": 285.3
    }
  ],
  "createdAt": "2024-12-06T21:28:46.477Z"
}
Draftbit