example-data.com
Menu
Browse docs and collections

Overview

transactions / #1574

transactions #1574

accountId
accounts/121
kind
payment
amount
-3451.57
currency
CAD
description
Online purchase
status
cancelled
occurredAt
createdAt

Component variants

Related

References

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/transactions/1574"
);
const transaction = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/transactions.d.ts https://example-data.com/types/transactions.d.ts
import type { Transaction } from "./types/transactions";

const res = await fetch(
  "https://example-data.com/api/v1/transactions/1574"
);
const transaction = (await res.json()) as Transaction;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/transactions/1574"
)
transaction = res.json()

Response

{
  "id": 1574,
  "accountId": 121,
  "kind": "payment",
  "amount": -3451.57,
  "currency": "CAD",
  "description": "Online purchase",
  "status": "cancelled",
  "occurredAt": "2024-09-03T09:42:22.697Z",
  "createdAt": "2024-09-03T09:43:14.411Z"
}