example-data.com
Menu
Browse docs and collections

Overview

invoices / #222

invoices #222

fromUserId
Jaycee Erdman @jaycee_erdman96
toUserId
Queen Lubowitz @queen.lubowitz76
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

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/invoices/222" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/invoices/222"
);
const invoice = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/invoices.d.ts https://example-data.com/types/invoices.d.ts
import type { Invoice } from "./types/invoices";

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

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/invoices/222"
)
invoice = res.json()

Response

{
  "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"
}