example-data.com
Menu
Browse docs and collections

Overview

invoices / #284

invoices #284

fromUserId
Mia Renner @mia.renner47
toUserId
Florencio Mohr @florencio_mohr
invoiceNumber
INV-2024-0284
status
paid
issuedAt
dueAt
paidAt
subtotal
23335.51
tax
0
total
23335.51
currency
GBP
lineItems
              [
  {
    "description": "Technical support",
    "quantity": 8,
    "unitPrice": 476.99,
    "lineTotal": 3815.92
  },
  {
    "description": "Software development",
    "quantity": 14,
    "unitPrice": 137.51,
    "lineTotal": 1925.14
  },
  {
    "description": "Design work",
    "quantity": 35,
    "unitPrice": 435.91,
    "lineTotal": 15256.85
  },
  {
    "description": "Consulting services",
    "quantity": 5,
    "unitPrice": 467.52,
    "lineTotal": 2337.6
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 284,
  "fromUserId": 212,
  "toUserId": 71,
  "invoiceNumber": "INV-2024-0284",
  "status": "paid",
  "issuedAt": "2024-10-11T05:18:07.468Z",
  "dueAt": "2024-10-27T05:18:07.468Z",
  "paidAt": "2024-10-13T12:10:22.942Z",
  "subtotal": 23335.51,
  "tax": 0,
  "total": 23335.51,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Technical support",
      "quantity": 8,
      "unitPrice": 476.99,
      "lineTotal": 3815.92
    },
    {
      "description": "Software development",
      "quantity": 14,
      "unitPrice": 137.51,
      "lineTotal": 1925.14
    },
    {
      "description": "Design work",
      "quantity": 35,
      "unitPrice": 435.91,
      "lineTotal": 15256.85
    },
    {
      "description": "Consulting services",
      "quantity": 5,
      "unitPrice": 467.52,
      "lineTotal": 2337.6
    }
  ],
  "createdAt": "2024-10-10T17:54:52.451Z"
}