example-data.com
Menu
Browse docs and collections

Overview

invoices / #158

invoices #158

fromUserId
Santa Corwin @santa.corwin59
toUserId
Ken Towne @ken.towne
invoiceNumber
INV-2024-0158
status
paid
issuedAt
dueAt
paidAt
subtotal
28636.88
tax
2290.95
total
30927.83
currency
USD
lineItems
              [
  {
    "description": "Maintenance contract",
    "quantity": 20,
    "unitPrice": 151.73,
    "lineTotal": 3034.6
  },
  {
    "description": "Hardware supply",
    "quantity": 31,
    "unitPrice": 399.59,
    "lineTotal": 12387.29
  },
  {
    "description": "Maintenance contract",
    "quantity": 39,
    "unitPrice": 135.01,
    "lineTotal": 5265.39
  },
  {
    "description": "Data analysis",
    "quantity": 20,
    "unitPrice": 397.48,
    "lineTotal": 7949.6
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 158,
  "fromUserId": 247,
  "toUserId": 248,
  "invoiceNumber": "INV-2024-0158",
  "status": "paid",
  "issuedAt": "2024-11-04T10:19:35.614Z",
  "dueAt": "2024-12-15T10:19:35.614Z",
  "paidAt": "2024-11-21T11:02:22.082Z",
  "subtotal": 28636.88,
  "tax": 2290.95,
  "total": 30927.83,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Maintenance contract",
      "quantity": 20,
      "unitPrice": 151.73,
      "lineTotal": 3034.6
    },
    {
      "description": "Hardware supply",
      "quantity": 31,
      "unitPrice": 399.59,
      "lineTotal": 12387.29
    },
    {
      "description": "Maintenance contract",
      "quantity": 39,
      "unitPrice": 135.01,
      "lineTotal": 5265.39
    },
    {
      "description": "Data analysis",
      "quantity": 20,
      "unitPrice": 397.48,
      "lineTotal": 7949.6
    }
  ],
  "createdAt": "2024-11-04T10:07:15.096Z"
}