example-data.com
Menu
Browse docs and collections

Overview

invoices / #87

invoices #87

fromUserId
Santa Corwin @santa.corwin59
toUserId
Fatima Dicki @fatima_dicki
invoiceNumber
INV-2024-0087
status
paid
issuedAt
dueAt
paidAt
subtotal
28421.93
tax
0
total
28421.93
currency
AUD
lineItems
              [
  {
    "description": "Implementation services",
    "quantity": 34,
    "unitPrice": 390.77,
    "lineTotal": 13286.18
  },
  {
    "description": "Content writing",
    "quantity": 39,
    "unitPrice": 94.87,
    "lineTotal": 3699.93
  },
  {
    "description": "Consulting services",
    "quantity": 5,
    "unitPrice": 80.77,
    "lineTotal": 403.85
  },
  {
    "description": "Content writing",
    "quantity": 31,
    "unitPrice": 355.87,
    "lineTotal": 11031.97
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 87,
  "fromUserId": 247,
  "toUserId": 176,
  "invoiceNumber": "INV-2024-0087",
  "status": "paid",
  "issuedAt": "2024-06-18T15:22:21.017Z",
  "dueAt": "2024-08-16T15:22:21.017Z",
  "paidAt": "2024-08-13T07:25:04.490Z",
  "subtotal": 28421.93,
  "tax": 0,
  "total": 28421.93,
  "currency": "AUD",
  "lineItems": [
    {
      "description": "Implementation services",
      "quantity": 34,
      "unitPrice": 390.77,
      "lineTotal": 13286.18
    },
    {
      "description": "Content writing",
      "quantity": 39,
      "unitPrice": 94.87,
      "lineTotal": 3699.93
    },
    {
      "description": "Consulting services",
      "quantity": 5,
      "unitPrice": 80.77,
      "lineTotal": 403.85
    },
    {
      "description": "Content writing",
      "quantity": 31,
      "unitPrice": 355.87,
      "lineTotal": 11031.97
    }
  ],
  "createdAt": "2024-06-17T22:41:09.962Z"
}