example-data.com
Menu
Browse docs and collections

Overview

invoices / #153

invoices #153

fromUserId
Myrl Pollich @myrl.pollich
toUserId
Jonathan Howe @jonathan_howe77
invoiceNumber
INV-2024-0153
status
viewed
issuedAt
dueAt
paidAt
subtotal
21873.46
tax
0
total
21873.46
currency
GBP
lineItems
              [
  {
    "description": "Content writing",
    "quantity": 21,
    "unitPrice": 365.81,
    "lineTotal": 7682.01
  },
  {
    "description": "Hardware supply",
    "quantity": 35,
    "unitPrice": 121.37,
    "lineTotal": 4247.95
  },
  {
    "description": "Accounting services",
    "quantity": 27,
    "unitPrice": 157.13,
    "lineTotal": 4242.51
  },
  {
    "description": "Accounting services",
    "quantity": 13,
    "unitPrice": 391.75,
    "lineTotal": 5092.75
  },
  {
    "description": "Photography services",
    "quantity": 2,
    "unitPrice": 304.12,
    "lineTotal": 608.24
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 153,
  "fromUserId": 90,
  "toUserId": 150,
  "invoiceNumber": "INV-2024-0153",
  "status": "viewed",
  "issuedAt": "2024-08-03T20:16:14.796Z",
  "dueAt": "2024-09-08T20:16:14.796Z",
  "paidAt": null,
  "subtotal": 21873.46,
  "tax": 0,
  "total": 21873.46,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Content writing",
      "quantity": 21,
      "unitPrice": 365.81,
      "lineTotal": 7682.01
    },
    {
      "description": "Hardware supply",
      "quantity": 35,
      "unitPrice": 121.37,
      "lineTotal": 4247.95
    },
    {
      "description": "Accounting services",
      "quantity": 27,
      "unitPrice": 157.13,
      "lineTotal": 4242.51
    },
    {
      "description": "Accounting services",
      "quantity": 13,
      "unitPrice": 391.75,
      "lineTotal": 5092.75
    },
    {
      "description": "Photography services",
      "quantity": 2,
      "unitPrice": 304.12,
      "lineTotal": 608.24
    }
  ],
  "createdAt": "2024-08-03T06:30:24.990Z"
}