example-data.com
Menu
Browse docs and collections

Overview

invoices / #52

invoices #52

fromUserId
Cassidy Boehm @cassidy_boehm22
toUserId
Amparo Dietrich @amparo.dietrich
invoiceNumber
INV-2024-0052
status
paid
issuedAt
dueAt
paidAt
subtotal
19794.57
tax
2969.19
total
22763.76
currency
USD
lineItems
              [
  {
    "description": "Training session",
    "quantity": 27,
    "unitPrice": 279.92,
    "lineTotal": 7557.84
  },
  {
    "description": "Implementation services",
    "quantity": 29,
    "unitPrice": 239.79,
    "lineTotal": 6953.91
  },
  {
    "description": "System integration",
    "quantity": 18,
    "unitPrice": 293.49,
    "lineTotal": 5282.82
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 52,
  "fromUserId": 204,
  "toUserId": 159,
  "invoiceNumber": "INV-2024-0052",
  "status": "paid",
  "issuedAt": "2024-10-30T09:01:29.674Z",
  "dueAt": "2024-12-29T09:01:29.674Z",
  "paidAt": "2024-12-06T13:13:47.303Z",
  "subtotal": 19794.57,
  "tax": 2969.19,
  "total": 22763.76,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Training session",
      "quantity": 27,
      "unitPrice": 279.92,
      "lineTotal": 7557.84
    },
    {
      "description": "Implementation services",
      "quantity": 29,
      "unitPrice": 239.79,
      "lineTotal": 6953.91
    },
    {
      "description": "System integration",
      "quantity": 18,
      "unitPrice": 293.49,
      "lineTotal": 5282.82
    }
  ],
  "createdAt": "2024-10-29T14:27:57.596Z"
}