example-data.com
Menu
Browse docs and collections

Overview

invoices / #218

invoices #218

fromUserId
Oran Torphy @oran_torphy
toUserId
Jarrell Flatley @jarrell_flatley39
invoiceNumber
INV-2024-0218
status
paid
issuedAt
dueAt
paidAt
subtotal
4260.4
tax
639.06
total
4899.46
currency
GBP
lineItems
              [
  {
    "description": "Maintenance contract",
    "quantity": 31,
    "unitPrice": 116.32,
    "lineTotal": 3605.92
  },
  {
    "description": "Training session",
    "quantity": 8,
    "unitPrice": 81.81,
    "lineTotal": 654.48
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 218,
  "fromUserId": 189,
  "toUserId": 61,
  "invoiceNumber": "INV-2024-0218",
  "status": "paid",
  "issuedAt": "2024-07-12T08:27:42.356Z",
  "dueAt": "2024-07-26T08:27:42.356Z",
  "paidAt": "2024-07-20T10:29:10.480Z",
  "subtotal": 4260.4,
  "tax": 639.06,
  "total": 4899.46,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Maintenance contract",
      "quantity": 31,
      "unitPrice": 116.32,
      "lineTotal": 3605.92
    },
    {
      "description": "Training session",
      "quantity": 8,
      "unitPrice": 81.81,
      "lineTotal": 654.48
    }
  ],
  "createdAt": "2024-07-12T06:28:35.153Z"
}