example-data.com
Menu
Browse docs and collections

Overview

invoices / #217

invoices #217

fromUserId
Matt Kuhic @matt_kuhic57
toUserId
Perry Kerluke @perry_kerluke83
invoiceNumber
INV-2024-0217
status
paid
issuedAt
dueAt
paidAt
subtotal
6963.51
tax
1392.7
total
8356.21
currency
AUD
lineItems
              [
  {
    "description": "Technical support",
    "quantity": 22,
    "unitPrice": 220.34,
    "lineTotal": 4847.48
  },
  {
    "description": "Technical support",
    "quantity": 37,
    "unitPrice": 57.19,
    "lineTotal": 2116.03
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 217,
  "fromUserId": 226,
  "toUserId": 174,
  "invoiceNumber": "INV-2024-0217",
  "status": "paid",
  "issuedAt": "2024-08-20T14:30:53.468Z",
  "dueAt": "2024-09-05T14:30:53.468Z",
  "paidAt": "2024-08-20T17:05:49.845Z",
  "subtotal": 6963.51,
  "tax": 1392.7,
  "total": 8356.21,
  "currency": "AUD",
  "lineItems": [
    {
      "description": "Technical support",
      "quantity": 22,
      "unitPrice": 220.34,
      "lineTotal": 4847.48
    },
    {
      "description": "Technical support",
      "quantity": 37,
      "unitPrice": 57.19,
      "lineTotal": 2116.03
    }
  ],
  "createdAt": "2024-08-20T07:14:18.052Z"
}