example-data.com

invoices / #1

fromUserId
211
toUserId
74
invoiceNumber
INV-2024-0001
status
viewed
issuedAt
dueAt
paidAt
subtotal
23575.44
tax
3536.32
total
27111.76
currency
EUR
lineItems
[
  {
    "description": "Technical support",
    "quantity": 40,
    "unitPrice": 129.84,
    "lineTotal": 5193.6
  },
  {
    "description": "Data analysis",
    "quantity": 30,
    "unitPrice": 434.78,
    "lineTotal": 13043.4
  },
  {
    "description": "Quality assurance",
    "quantity": 36,
    "unitPrice": 108.75,
    "lineTotal": 3915
  },
  {
    "description": "Software development",
    "quantity": 12,
    "unitPrice": 118.62,
    "lineTotal": 1423.44
  }
]
createdAt

Component variants

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

res = requests.get(
    "https://example-data.com/api/v1/invoices/1"
)
invoice = res.json()
{
  "id": 1,
  "fromUserId": 211,
  "toUserId": 74,
  "invoiceNumber": "INV-2024-0001",
  "status": "viewed",
  "issuedAt": "2024-10-18T03:09:14.336Z",
  "dueAt": "2024-11-27T03:09:14.336Z",
  "paidAt": null,
  "subtotal": 23575.44,
  "tax": 3536.32,
  "total": 27111.76,
  "currency": "EUR",
  "lineItems": [
    {
      "description": "Technical support",
      "quantity": 40,
      "unitPrice": 129.84,
      "lineTotal": 5193.6
    },
    {
      "description": "Data analysis",
      "quantity": 30,
      "unitPrice": 434.78,
      "lineTotal": 13043.4
    },
    {
      "description": "Quality assurance",
      "quantity": 36,
      "unitPrice": 108.75,
      "lineTotal": 3915
    },
    {
      "description": "Software development",
      "quantity": 12,
      "unitPrice": 118.62,
      "lineTotal": 1423.44
    }
  ],
  "createdAt": "2024-10-17T19:25:36.167Z"
}
Draftbit