example-data.com
Menu
Browse docs and collections

Overview

invoices / #258

invoices #258

fromUserId
Margaretta Barrows @margaretta_barrows41
toUserId
April Kihn @april.kihn55
invoiceNumber
INV-2024-0258
status
paid
issuedAt
dueAt
paidAt
subtotal
14612.66
tax
1169.01
total
15781.67
currency
CAD
lineItems
              [
  {
    "description": "Maintenance contract",
    "quantity": 23,
    "unitPrice": 383.5,
    "lineTotal": 8820.5
  },
  {
    "description": "Data analysis",
    "quantity": 9,
    "unitPrice": 390.62,
    "lineTotal": 3515.58
  },
  {
    "description": "Maintenance contract",
    "quantity": 10,
    "unitPrice": 119.88,
    "lineTotal": 1198.8
  },
  {
    "description": "Legal review",
    "quantity": 23,
    "unitPrice": 46.86,
    "lineTotal": 1077.78
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 258,
  "fromUserId": 39,
  "toUserId": 137,
  "invoiceNumber": "INV-2024-0258",
  "status": "paid",
  "issuedAt": "2024-08-15T07:24:55.364Z",
  "dueAt": "2024-09-08T07:24:55.364Z",
  "paidAt": "2024-08-25T13:24:04.003Z",
  "subtotal": 14612.66,
  "tax": 1169.01,
  "total": 15781.67,
  "currency": "CAD",
  "lineItems": [
    {
      "description": "Maintenance contract",
      "quantity": 23,
      "unitPrice": 383.5,
      "lineTotal": 8820.5
    },
    {
      "description": "Data analysis",
      "quantity": 9,
      "unitPrice": 390.62,
      "lineTotal": 3515.58
    },
    {
      "description": "Maintenance contract",
      "quantity": 10,
      "unitPrice": 119.88,
      "lineTotal": 1198.8
    },
    {
      "description": "Legal review",
      "quantity": 23,
      "unitPrice": 46.86,
      "lineTotal": 1077.78
    }
  ],
  "createdAt": "2024-08-15T00:23:16.685Z"
}