example-data.com
Menu
Browse docs and collections

Overview

invoices / #27

invoices #27

fromUserId
Bradford Doyle @bradford.doyle42
toUserId
Ruben Terry @ruben.terry
invoiceNumber
INV-2024-0027
status
paid
issuedAt
dueAt
paidAt
subtotal
17797.39
tax
0
total
17797.39
currency
EUR
lineItems
              [
  {
    "description": "Maintenance contract",
    "quantity": 28,
    "unitPrice": 257.15,
    "lineTotal": 7200.2
  },
  {
    "description": "Software development",
    "quantity": 9,
    "unitPrice": 98.43,
    "lineTotal": 885.87
  },
  {
    "description": "Photography services",
    "quantity": 16,
    "unitPrice": 405.75,
    "lineTotal": 6492
  },
  {
    "description": "Project management",
    "quantity": 26,
    "unitPrice": 123.82,
    "lineTotal": 3219.32
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 27,
  "fromUserId": 79,
  "toUserId": 91,
  "invoiceNumber": "INV-2024-0027",
  "status": "paid",
  "issuedAt": "2024-08-02T04:36:20.170Z",
  "dueAt": "2024-08-11T04:36:20.170Z",
  "paidAt": "2024-08-09T13:34:17.110Z",
  "subtotal": 17797.39,
  "tax": 0,
  "total": 17797.39,
  "currency": "EUR",
  "lineItems": [
    {
      "description": "Maintenance contract",
      "quantity": 28,
      "unitPrice": 257.15,
      "lineTotal": 7200.2
    },
    {
      "description": "Software development",
      "quantity": 9,
      "unitPrice": 98.43,
      "lineTotal": 885.87
    },
    {
      "description": "Photography services",
      "quantity": 16,
      "unitPrice": 405.75,
      "lineTotal": 6492
    },
    {
      "description": "Project management",
      "quantity": 26,
      "unitPrice": 123.82,
      "lineTotal": 3219.32
    }
  ],
  "createdAt": "2024-08-01T10:00:59.023Z"
}