example-data.com

invoices / #5

fromUserId
153
toUserId
197
invoiceNumber
INV-2024-0005
status
paid
issuedAt
dueAt
paidAt
subtotal
31552.7
tax
0
total
31552.7
currency
GBP
lineItems
[
  {
    "description": "Accounting services",
    "quantity": 40,
    "unitPrice": 448.21,
    "lineTotal": 17928.4
  },
  {
    "description": "License fee",
    "quantity": 18,
    "unitPrice": 492.4,
    "lineTotal": 8863.2
  },
  {
    "description": "Implementation services",
    "quantity": 10,
    "unitPrice": 476.11,
    "lineTotal": 4761.1
  }
]
createdAt

Component variants

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

res = requests.get(
    "https://example-data.com/api/v1/invoices/5"
)
invoice = res.json()
{
  "id": 5,
  "fromUserId": 153,
  "toUserId": 197,
  "invoiceNumber": "INV-2024-0005",
  "status": "paid",
  "issuedAt": "2024-08-10T16:18:26.854Z",
  "dueAt": "2024-08-21T16:18:26.854Z",
  "paidAt": "2024-08-12T19:44:41.071Z",
  "subtotal": 31552.7,
  "tax": 0,
  "total": 31552.7,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Accounting services",
      "quantity": 40,
      "unitPrice": 448.21,
      "lineTotal": 17928.4
    },
    {
      "description": "License fee",
      "quantity": 18,
      "unitPrice": 492.4,
      "lineTotal": 8863.2
    },
    {
      "description": "Implementation services",
      "quantity": 10,
      "unitPrice": 476.11,
      "lineTotal": 4761.1
    }
  ],
  "createdAt": "2024-08-10T12:13:12.470Z"
}
Draftbit