example-data.com
Menu
Browse docs and collections

Overview

invoices / #270

invoices #270

fromUserId
Allan Buckridge @allan_buckridge
toUserId
Selina Flatley @selina_flatley
invoiceNumber
INV-2024-0270
status
overdue
issuedAt
dueAt
paidAt
subtotal
14034
tax
1403.4
total
15437.4
currency
GBP
lineItems
              [
  {
    "description": "Consulting services",
    "quantity": 40,
    "unitPrice": 139.21,
    "lineTotal": 5568.4
  },
  {
    "description": "Implementation services",
    "quantity": 30,
    "unitPrice": 97.84,
    "lineTotal": 2935.2
  },
  {
    "description": "Implementation services",
    "quantity": 40,
    "unitPrice": 73.52,
    "lineTotal": 2940.8
  },
  {
    "description": "Maintenance contract",
    "quantity": 15,
    "unitPrice": 172.64,
    "lineTotal": 2589.6
  }
]
            
createdAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 270,
  "fromUserId": 106,
  "toUserId": 193,
  "invoiceNumber": "INV-2024-0270",
  "status": "overdue",
  "issuedAt": "2024-05-26T10:28:31.297Z",
  "dueAt": "2024-07-15T10:28:31.297Z",
  "paidAt": null,
  "subtotal": 14034,
  "tax": 1403.4,
  "total": 15437.4,
  "currency": "GBP",
  "lineItems": [
    {
      "description": "Consulting services",
      "quantity": 40,
      "unitPrice": 139.21,
      "lineTotal": 5568.4
    },
    {
      "description": "Implementation services",
      "quantity": 30,
      "unitPrice": 97.84,
      "lineTotal": 2935.2
    },
    {
      "description": "Implementation services",
      "quantity": 40,
      "unitPrice": 73.52,
      "lineTotal": 2940.8
    },
    {
      "description": "Maintenance contract",
      "quantity": 15,
      "unitPrice": 172.64,
      "lineTotal": 2589.6
    }
  ],
  "createdAt": "2024-05-25T18:51:25.002Z"
}