example-data.com
Menu
Browse docs and collections

Overview

invoices / #230

invoices #230

fromUserId
Cassidy Price-Schimmel @cassidy.price-schimmel
toUserId
Earlene Wisozk @earlene.wisozk
invoiceNumber
INV-2024-0230
status
viewed
issuedAt
dueAt
paidAt
subtotal
2231.63
tax
0
total
2231.63
currency
GBP
lineItems
              [
  {
    "description": "Documentation",
    "quantity": 1,
    "unitPrice": 25.93,
    "lineTotal": 25.93
  },
  {
    "description": "Accounting services",
    "quantity": 7,
    "unitPrice": 315.1,
    "lineTotal": 2205.7
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 230,
  "fromUserId": 227,
  "toUserId": 216,
  "invoiceNumber": "INV-2024-0230",
  "status": "viewed",
  "issuedAt": "2024-07-13T15:15:54.614Z",
  "dueAt": "2024-08-15T15:15:54.614Z",
  "paidAt": null,
  "subtotal": 2231.63,
  "tax": 0,
  "total": 2231.63,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Documentation",
      "quantity": 1,
      "unitPrice": 25.93,
      "lineTotal": 25.93
    },
    {
      "description": "Accounting services",
      "quantity": 7,
      "unitPrice": 315.1,
      "lineTotal": 2205.7
    }
  ],
  "createdAt": "2024-07-12T17:55:47.966Z"
}