example-data.com
Menu
Browse docs and collections

Overview

invoices / #22

invoices #22

fromUserId
Lemuel Jast @lemuel.jast27
toUserId
Jarrell Flatley @jarrell_flatley39
invoiceNumber
INV-2024-0022
status
paid
issuedAt
dueAt
paidAt
subtotal
15747.76
tax
1259.82
total
17007.58
currency
USD
lineItems
              [
  {
    "description": "License fee",
    "quantity": 7,
    "unitPrice": 498.15,
    "lineTotal": 3487.05
  },
  {
    "description": "Technical support",
    "quantity": 1,
    "unitPrice": 211.89,
    "lineTotal": 211.89
  },
  {
    "description": "Photography services",
    "quantity": 39,
    "unitPrice": 68.78,
    "lineTotal": 2682.42
  },
  {
    "description": "Hardware supply",
    "quantity": 14,
    "unitPrice": 474.11,
    "lineTotal": 6637.54
  },
  {
    "description": "System integration",
    "quantity": 6,
    "unitPrice": 454.81,
    "lineTotal": 2728.86
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 22,
  "fromUserId": 105,
  "toUserId": 61,
  "invoiceNumber": "INV-2024-0022",
  "status": "paid",
  "issuedAt": "2024-11-18T21:43:20.640Z",
  "dueAt": "2024-12-07T21:43:20.640Z",
  "paidAt": "2024-11-21T19:13:58.082Z",
  "subtotal": 15747.76,
  "tax": 1259.82,
  "total": 17007.58,
  "currency": "USD",
  "lineItems": [
    {
      "description": "License fee",
      "quantity": 7,
      "unitPrice": 498.15,
      "lineTotal": 3487.05
    },
    {
      "description": "Technical support",
      "quantity": 1,
      "unitPrice": 211.89,
      "lineTotal": 211.89
    },
    {
      "description": "Photography services",
      "quantity": 39,
      "unitPrice": 68.78,
      "lineTotal": 2682.42
    },
    {
      "description": "Hardware supply",
      "quantity": 14,
      "unitPrice": 474.11,
      "lineTotal": 6637.54
    },
    {
      "description": "System integration",
      "quantity": 6,
      "unitPrice": 454.81,
      "lineTotal": 2728.86
    }
  ],
  "createdAt": "2024-11-18T07:06:14.597Z"
}