example-data.com
Menu
Browse docs and collections

Overview

invoices / #17

invoices #17

fromUserId
Jarrell Flatley @jarrell_flatley39
toUserId
Fatima Dicki @fatima_dicki
invoiceNumber
INV-2024-0017
status
sent
issuedAt
dueAt
paidAt
subtotal
7983.76
tax
1197.56
total
9181.32
currency
GBP
lineItems
              [
  {
    "description": "Data analysis",
    "quantity": 16,
    "unitPrice": 46.69,
    "lineTotal": 747.04
  },
  {
    "description": "Marketing services",
    "quantity": 36,
    "unitPrice": 201.02,
    "lineTotal": 7236.72
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 17,
  "fromUserId": 61,
  "toUserId": 176,
  "invoiceNumber": "INV-2024-0017",
  "status": "sent",
  "issuedAt": "2024-10-20T09:57:25.451Z",
  "dueAt": "2024-10-31T09:57:25.451Z",
  "paidAt": null,
  "subtotal": 7983.76,
  "tax": 1197.56,
  "total": 9181.32,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Data analysis",
      "quantity": 16,
      "unitPrice": 46.69,
      "lineTotal": 747.04
    },
    {
      "description": "Marketing services",
      "quantity": 36,
      "unitPrice": 201.02,
      "lineTotal": 7236.72
    }
  ],
  "createdAt": "2024-10-19T11:00:41.231Z"
}