example-data.com
Menu
Browse docs and collections

Overview

invoices / #290

invoices #290

fromUserId
Maria Senger @maria.senger
toUserId
Lilla Koss @lilla.koss
invoiceNumber
INV-2024-0290
status
viewed
issuedAt
dueAt
paidAt
subtotal
1942.37
tax
194.24
total
2136.61
currency
EUR
lineItems
              [
  {
    "description": "Accounting services",
    "quantity": 20,
    "unitPrice": 15.7,
    "lineTotal": 314
  },
  {
    "description": "Training session",
    "quantity": 27,
    "unitPrice": 60.31,
    "lineTotal": 1628.37
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 290,
  "fromUserId": 120,
  "toUserId": 59,
  "invoiceNumber": "INV-2024-0290",
  "status": "viewed",
  "issuedAt": "2024-05-30T19:19:26.505Z",
  "dueAt": "2024-06-13T19:19:26.505Z",
  "paidAt": null,
  "subtotal": 1942.37,
  "tax": 194.24,
  "total": 2136.61,
  "currency": "EUR",
  "lineItems": [
    {
      "description": "Accounting services",
      "quantity": 20,
      "unitPrice": 15.7,
      "lineTotal": 314
    },
    {
      "description": "Training session",
      "quantity": 27,
      "unitPrice": 60.31,
      "lineTotal": 1628.37
    }
  ],
  "createdAt": "2024-05-30T08:28:29.592Z"
}