example-data.com
Menu
Browse docs and collections

Overview

invoices / #2

invoices #2

fromUserId
Webster Skiles @webster_skiles39
toUserId
Conner Bernhard @conner.bernhard33
invoiceNumber
INV-2024-0002
status
draft
issuedAt
dueAt
paidAt
subtotal
14134.68
tax
2826.94
total
16961.62
currency
USD
lineItems
              [
  {
    "description": "Technical support",
    "quantity": 35,
    "unitPrice": 127.26,
    "lineTotal": 4454.1
  },
  {
    "description": "Documentation",
    "quantity": 21,
    "unitPrice": 460.98,
    "lineTotal": 9680.58
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/invoices/2"
);
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/2"
);
const invoice = (await res.json()) as Invoice;

Python example

import requests

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

Response

{
  "id": 2,
  "fromUserId": 5,
  "toUserId": 3,
  "invoiceNumber": "INV-2024-0002",
  "status": "draft",
  "issuedAt": "2024-12-19T11:26:51.370Z",
  "dueAt": "2025-01-06T11:26:51.370Z",
  "paidAt": null,
  "subtotal": 14134.68,
  "tax": 2826.94,
  "total": 16961.62,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Technical support",
      "quantity": 35,
      "unitPrice": 127.26,
      "lineTotal": 4454.1
    },
    {
      "description": "Documentation",
      "quantity": 21,
      "unitPrice": 460.98,
      "lineTotal": 9680.58
    }
  ],
  "createdAt": "2024-12-19T04:18:33.361Z"
}