example-data.com
Menu
Browse docs and collections

Overview

transactions / #1287

transactions #1287

accountId
accounts/142
kind
payment
amount
-2039.32
currency
CNY
description
Restaurant charge
status
failed
occurredAt
createdAt

Component variants

Related

References

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/transactions/1287"
);
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/1287"
);
const transaction = (await res.json()) as Transaction;

Python example

import requests

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

Response

{
  "id": 1287,
  "accountId": 142,
  "kind": "payment",
  "amount": -2039.32,
  "currency": "CNY",
  "description": "Restaurant charge",
  "status": "failed",
  "occurredAt": "2024-09-16T14:11:59.696Z",
  "createdAt": "2024-09-16T14:12:21.280Z"
}