example-data.com
Menu
Browse docs and collections

Overview

invoices / #281

invoices #281

fromUserId
Autumn Bartell @autumn.bartell95
toUserId
Vincenza Zemlak-Collier @vincenza_zemlak-collier
invoiceNumber
INV-2024-0281
status
draft
issuedAt
dueAt
paidAt
subtotal
33945.54
tax
3394.55
total
37340.09
currency
GBP
lineItems
              [
  {
    "description": "Consulting services",
    "quantity": 13,
    "unitPrice": 328.79,
    "lineTotal": 4274.27
  },
  {
    "description": "Content writing",
    "quantity": 23,
    "unitPrice": 340.53,
    "lineTotal": 7832.19
  },
  {
    "description": "Software development",
    "quantity": 36,
    "unitPrice": 447.58,
    "lineTotal": 16112.88
  },
  {
    "description": "Design work",
    "quantity": 1,
    "unitPrice": 499.6,
    "lineTotal": 499.6
  },
  {
    "description": "Training session",
    "quantity": 15,
    "unitPrice": 348.44,
    "lineTotal": 5226.6
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 281,
  "fromUserId": 58,
  "toUserId": 168,
  "invoiceNumber": "INV-2024-0281",
  "status": "draft",
  "issuedAt": "2024-07-14T02:56:31.560Z",
  "dueAt": "2024-08-09T02:56:31.560Z",
  "paidAt": null,
  "subtotal": 33945.54,
  "tax": 3394.55,
  "total": 37340.09,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Consulting services",
      "quantity": 13,
      "unitPrice": 328.79,
      "lineTotal": 4274.27
    },
    {
      "description": "Content writing",
      "quantity": 23,
      "unitPrice": 340.53,
      "lineTotal": 7832.19
    },
    {
      "description": "Software development",
      "quantity": 36,
      "unitPrice": 447.58,
      "lineTotal": 16112.88
    },
    {
      "description": "Design work",
      "quantity": 1,
      "unitPrice": 499.6,
      "lineTotal": 499.6
    },
    {
      "description": "Training session",
      "quantity": 15,
      "unitPrice": 348.44,
      "lineTotal": 5226.6
    }
  ],
  "createdAt": "2024-07-13T08:52:24.333Z"
}