example-data.com
Menu
Browse docs and collections

Overview

invoices / #231

invoices #231

fromUserId
Maymie Boehm @maymie.boehm90
toUserId
Jo Haag-Mayer @jo_haag-mayer
invoiceNumber
INV-2024-0231
status
viewed
issuedAt
dueAt
paidAt
subtotal
23007.28
tax
1840.58
total
24847.86
currency
USD
lineItems
              [
  {
    "description": "Hardware supply",
    "quantity": 12,
    "unitPrice": 207.88,
    "lineTotal": 2494.56
  },
  {
    "description": "Marketing services",
    "quantity": 34,
    "unitPrice": 211.18,
    "lineTotal": 7180.12
  },
  {
    "description": "Hardware supply",
    "quantity": 35,
    "unitPrice": 372.78,
    "lineTotal": 13047.3
  },
  {
    "description": "Legal review",
    "quantity": 6,
    "unitPrice": 47.55,
    "lineTotal": 285.3
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 231,
  "fromUserId": 48,
  "toUserId": 54,
  "invoiceNumber": "INV-2024-0231",
  "status": "viewed",
  "issuedAt": "2024-12-07T01:31:54.998Z",
  "dueAt": "2024-12-31T01:31:54.998Z",
  "paidAt": null,
  "subtotal": 23007.28,
  "tax": 1840.58,
  "total": 24847.86,
  "currency": "USD",
  "lineItems": [
    {
      "description": "Hardware supply",
      "quantity": 12,
      "unitPrice": 207.88,
      "lineTotal": 2494.56
    },
    {
      "description": "Marketing services",
      "quantity": 34,
      "unitPrice": 211.18,
      "lineTotal": 7180.12
    },
    {
      "description": "Hardware supply",
      "quantity": 35,
      "unitPrice": 372.78,
      "lineTotal": 13047.3
    },
    {
      "description": "Legal review",
      "quantity": 6,
      "unitPrice": 47.55,
      "lineTotal": 285.3
    }
  ],
  "createdAt": "2024-12-06T21:28:46.477Z"
}