example-data.com
Menu
Browse docs and collections

Overview

invoices / #128

invoices #128

fromUserId
Roma Durgan @roma.durgan
toUserId
Amya Powlowski @amya_powlowski32
invoiceNumber
INV-2024-0128
status
viewed
issuedAt
dueAt
paidAt
subtotal
16631.97
tax
1330.56
total
17962.53
currency
GBP
lineItems
              [
  {
    "description": "Accounting services",
    "quantity": 18,
    "unitPrice": 262.07,
    "lineTotal": 4717.26
  },
  {
    "description": "License fee",
    "quantity": 36,
    "unitPrice": 42.97,
    "lineTotal": 1546.92
  },
  {
    "description": "Accounting services",
    "quantity": 29,
    "unitPrice": 357.51,
    "lineTotal": 10367.79
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 128,
  "fromUserId": 215,
  "toUserId": 80,
  "invoiceNumber": "INV-2024-0128",
  "status": "viewed",
  "issuedAt": "2024-06-25T14:08:09.733Z",
  "dueAt": "2024-08-19T14:08:09.733Z",
  "paidAt": null,
  "subtotal": 16631.97,
  "tax": 1330.56,
  "total": 17962.53,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Accounting services",
      "quantity": 18,
      "unitPrice": 262.07,
      "lineTotal": 4717.26
    },
    {
      "description": "License fee",
      "quantity": 36,
      "unitPrice": 42.97,
      "lineTotal": 1546.92
    },
    {
      "description": "Accounting services",
      "quantity": 29,
      "unitPrice": 357.51,
      "lineTotal": 10367.79
    }
  ],
  "createdAt": "2024-06-24T23:56:03.543Z"
}