example-data.com
Menu
Browse docs and collections

Overview

invoices / #234

invoices #234

fromUserId
Dovie Gorczany @dovie.gorczany
toUserId
Mike Zemlak @mike.zemlak96
invoiceNumber
INV-2024-0234
status
viewed
issuedAt
dueAt
paidAt
subtotal
25181.65
tax
1259.08
total
26440.73
currency
GBP
lineItems
              [
  {
    "description": "Training session",
    "quantity": 24,
    "unitPrice": 306.79,
    "lineTotal": 7362.96
  },
  {
    "description": "Accounting services",
    "quantity": 33,
    "unitPrice": 19.4,
    "lineTotal": 640.2
  },
  {
    "description": "License fee",
    "quantity": 30,
    "unitPrice": 365.03,
    "lineTotal": 10950.9
  },
  {
    "description": "System integration",
    "quantity": 31,
    "unitPrice": 200.89,
    "lineTotal": 6227.59
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 234,
  "fromUserId": 111,
  "toUserId": 136,
  "invoiceNumber": "INV-2024-0234",
  "status": "viewed",
  "issuedAt": "2024-11-16T00:39:42.325Z",
  "dueAt": "2024-12-19T00:39:42.325Z",
  "paidAt": null,
  "subtotal": 25181.65,
  "tax": 1259.08,
  "total": 26440.73,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Training session",
      "quantity": 24,
      "unitPrice": 306.79,
      "lineTotal": 7362.96
    },
    {
      "description": "Accounting services",
      "quantity": 33,
      "unitPrice": 19.4,
      "lineTotal": 640.2
    },
    {
      "description": "License fee",
      "quantity": 30,
      "unitPrice": 365.03,
      "lineTotal": 10950.9
    },
    {
      "description": "System integration",
      "quantity": 31,
      "unitPrice": 200.89,
      "lineTotal": 6227.59
    }
  ],
  "createdAt": "2024-11-15T05:22:34.815Z"
}