example-data.com
Menu
Browse docs and collections

Overview

invoices / #285

invoices #285

fromUserId
Terence Lemke @terence.lemke85
toUserId
Alexander Beahan @alexander.beahan57
invoiceNumber
INV-2024-0285
status
paid
issuedAt
dueAt
paidAt
subtotal
3934.51
tax
786.9
total
4721.41
currency
GBP
lineItems
              [
  {
    "description": "Content writing",
    "quantity": 1,
    "unitPrice": 460.43,
    "lineTotal": 460.43
  },
  {
    "description": "Accounting services",
    "quantity": 8,
    "unitPrice": 265.3,
    "lineTotal": 2122.4
  },
  {
    "description": "Design work",
    "quantity": 24,
    "unitPrice": 56.32,
    "lineTotal": 1351.68
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 285,
  "fromUserId": 74,
  "toUserId": 169,
  "invoiceNumber": "INV-2024-0285",
  "status": "paid",
  "issuedAt": "2024-09-28T16:51:05.659Z",
  "dueAt": "2024-11-13T16:51:05.659Z",
  "paidAt": "2024-11-08T04:08:28.460Z",
  "subtotal": 3934.51,
  "tax": 786.9,
  "total": 4721.41,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Content writing",
      "quantity": 1,
      "unitPrice": 460.43,
      "lineTotal": 460.43
    },
    {
      "description": "Accounting services",
      "quantity": 8,
      "unitPrice": 265.3,
      "lineTotal": 2122.4
    },
    {
      "description": "Design work",
      "quantity": 24,
      "unitPrice": 56.32,
      "lineTotal": 1351.68
    }
  ],
  "createdAt": "2024-09-28T01:43:53.677Z"
}