MPPFinanceDocsv0.1
SDK Reference/getHistory()

getHistory()

Returns the transaction history for all cards issued by the agent wallet.

Signature

client.getHistory(options?: HistoryOptions): Promise<Transaction[]>

Transaction fields

FieldTypeDescription
idstringTransaction ID
cardIdstringCard that was charged
amountnumberCharged amount in cents
merchantstringMerchant domain
statusstringapproved | declined
timestampnumberUnix timestamp

Example

history.ts
const history = await client.getHistory({ limit: 25 })

history.forEach(tx => {
  const status = tx.status === 'approved' ? '✓' : '✗'
  console.log(`${status} ${tx.merchant} — $${(tx.amount / 100).toFixed(2)}`)
})