example-data.com
Menu
Browse docs and collections

Overview

invoices / #264

invoices #264

fromUserId
Edward Jacobson @edward_jacobson38
toUserId
Loren Schmidt @loren_schmidt
invoiceNumber
INV-2024-0264
status
cancelled
issuedAt
dueAt
paidAt
subtotal
22615.33
tax
4523.07
total
27138.4
currency
GBP
lineItems
              [
  {
    "description": "Hardware supply",
    "quantity": 38,
    "unitPrice": 75.13,
    "lineTotal": 2854.94
  },
  {
    "description": "Project management",
    "quantity": 4,
    "unitPrice": 179.49,
    "lineTotal": 717.96
  },
  {
    "description": "Consulting services",
    "quantity": 38,
    "unitPrice": 170.79,
    "lineTotal": 6490.02
  },
  {
    "description": "Implementation services",
    "quantity": 9,
    "unitPrice": 152.41,
    "lineTotal": 1371.69
  },
  {
    "description": "Documentation",
    "quantity": 24,
    "unitPrice": 222.8,
    "lineTotal": 5347.2
  },
  {
    "description": "Accounting services",
    "quantity": 28,
    "unitPrice": 208.34,
    "lineTotal": 5833.52
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 264,
  "fromUserId": 38,
  "toUserId": 222,
  "invoiceNumber": "INV-2024-0264",
  "status": "cancelled",
  "issuedAt": "2024-05-31T13:12:46.557Z",
  "dueAt": "2024-06-22T13:12:46.557Z",
  "paidAt": null,
  "subtotal": 22615.33,
  "tax": 4523.07,
  "total": 27138.4,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Hardware supply",
      "quantity": 38,
      "unitPrice": 75.13,
      "lineTotal": 2854.94
    },
    {
      "description": "Project management",
      "quantity": 4,
      "unitPrice": 179.49,
      "lineTotal": 717.96
    },
    {
      "description": "Consulting services",
      "quantity": 38,
      "unitPrice": 170.79,
      "lineTotal": 6490.02
    },
    {
      "description": "Implementation services",
      "quantity": 9,
      "unitPrice": 152.41,
      "lineTotal": 1371.69
    },
    {
      "description": "Documentation",
      "quantity": 24,
      "unitPrice": 222.8,
      "lineTotal": 5347.2
    },
    {
      "description": "Accounting services",
      "quantity": 28,
      "unitPrice": 208.34,
      "lineTotal": 5833.52
    }
  ],
  "createdAt": "2024-05-31T08:54:17.011Z"
}