Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.omneo.io/llms.txt

Use this file to discover all available pages before exploring further.

Use the Omneo SDK to fetch a profile’s transaction history and render it in a front-end application. The SDK handles authentication and state management, so your UI subscribes to events rather than managing API calls directly.

Prerequisites

  • The SDK is initialised with a valid profile-scoped token. See Omneo SDK and Omneo ID.

Fetch and display transactions

Call hydrate('transactions') to register transaction data with the SDK, then subscribe to transactions.ready to receive the data when it loads.
const shapesClient = ShapesSDK.init({
  url: 'https://api.[tenant].getomneo.com/id',
  token: '{omneo_id_token}'
})

shapesClient.hydrate('transactions')

shapesClient.on('transactions.ready', function(data) {
  data.forEach(function(transaction) {
    console.log(transaction)
    renderTransaction(transaction)
  })
})
The handler receives an array of transaction objects. Each object includes the transaction ID, profile, location, totals, timestamps, and a nested items array with line-item detail.

Include product variant data

Standard transaction responses exclude product variant information. To retrieve transactions with variant details, use a direct SDK get call:
async function getTransactionsWithVariants() {
  const response = await shapesClient.get('transactions?include=product')
  const transactions = response?.body?.data
  console.log(transactions)
}
This approach bypasses the SDK’s state management — the response is returned directly and the SDK state is not updated. Handle the data manually in your UI.

Update the UI on changes

To keep the UI current after new transactions arrive, subscribe to transactions.update instead of (or in addition to) transactions.ready:
shapesClient.on('transactions.update', function(data) {
  renderTransactionList(data)
})