example-data.com
Menu
Browse docs and collections

Overview

invoices / #276

invoices #276

fromUserId
Kennith Hahn @kennith.hahn
toUserId
Samson Stroman @samson_stroman
invoiceNumber
INV-2024-0276
status
paid
issuedAt
dueAt
paidAt
subtotal
14626.4
tax
1170.11
total
15796.51
currency
GBP
lineItems
              [
  {
    "description": "System integration",
    "quantity": 37,
    "unitPrice": 10.67,
    "lineTotal": 394.79
  },
  {
    "description": "Photography services",
    "quantity": 14,
    "unitPrice": 84.41,
    "lineTotal": 1181.74
  },
  {
    "description": "Consulting services",
    "quantity": 27,
    "unitPrice": 209.73,
    "lineTotal": 5662.71
  },
  {
    "description": "Research services",
    "quantity": 38,
    "unitPrice": 14.56,
    "lineTotal": 553.28
  },
  {
    "description": "Accounting services",
    "quantity": 36,
    "unitPrice": 189.83,
    "lineTotal": 6833.88
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 276,
  "fromUserId": 201,
  "toUserId": 52,
  "invoiceNumber": "INV-2024-0276",
  "status": "paid",
  "issuedAt": "2024-09-15T16:34:17.513Z",
  "dueAt": "2024-11-10T16:34:17.513Z",
  "paidAt": "2024-10-23T08:56:14.124Z",
  "subtotal": 14626.4,
  "tax": 1170.11,
  "total": 15796.51,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "System integration",
      "quantity": 37,
      "unitPrice": 10.67,
      "lineTotal": 394.79
    },
    {
      "description": "Photography services",
      "quantity": 14,
      "unitPrice": 84.41,
      "lineTotal": 1181.74
    },
    {
      "description": "Consulting services",
      "quantity": 27,
      "unitPrice": 209.73,
      "lineTotal": 5662.71
    },
    {
      "description": "Research services",
      "quantity": 38,
      "unitPrice": 14.56,
      "lineTotal": 553.28
    },
    {
      "description": "Accounting services",
      "quantity": 36,
      "unitPrice": 189.83,
      "lineTotal": 6833.88
    }
  ],
  "createdAt": "2024-09-14T17:04:08.952Z"
}