example-data.com
Menu
Browse docs and collections

Overview

invoices / #75

invoices #75

fromUserId
Carroll Wisozk @carroll_wisozk
toUserId
Frederic Armstrong @frederic_armstrong96
invoiceNumber
INV-2024-0075
status
paid
issuedAt
dueAt
paidAt
subtotal
18908.79
tax
0
total
18908.79
currency
GBP
lineItems
              [
  {
    "description": "Project management",
    "quantity": 10,
    "unitPrice": 496.88,
    "lineTotal": 4968.8
  },
  {
    "description": "Marketing services",
    "quantity": 25,
    "unitPrice": 360.59,
    "lineTotal": 9014.75
  },
  {
    "description": "License fee",
    "quantity": 34,
    "unitPrice": 144.86,
    "lineTotal": 4925.24
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 75,
  "fromUserId": 210,
  "toUserId": 199,
  "invoiceNumber": "INV-2024-0075",
  "status": "paid",
  "issuedAt": "2024-12-01T12:53:44.050Z",
  "dueAt": "2025-01-11T12:53:44.050Z",
  "paidAt": "2025-01-02T11:07:32.199Z",
  "subtotal": 18908.79,
  "tax": 0,
  "total": 18908.79,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Project management",
      "quantity": 10,
      "unitPrice": 496.88,
      "lineTotal": 4968.8
    },
    {
      "description": "Marketing services",
      "quantity": 25,
      "unitPrice": 360.59,
      "lineTotal": 9014.75
    },
    {
      "description": "License fee",
      "quantity": 34,
      "unitPrice": 144.86,
      "lineTotal": 4925.24
    }
  ],
  "createdAt": "2024-11-30T21:06:34.369Z"
}