# Creating a Transaction

> Create a Transaction to track user interactions like onboarding or withdrawals, either in a Workflow step or via the Create a Transaction API endpoint.

Source: https://help.withpersona.com/articles/2TvflQM7ehSqRvP23jVuDI/
Section: Transactions > Introduction > Key Concepts

## Creating a Transaction

## Overview

A [Transaction](https://help.withpersona.com/articles/5mzXj1PHBXtX5UlYbfZyvx/) is a flexible object in that represents a user interaction or event that you define. This can be onboarding, a loan application, a submitted form, a withdrawal, or any other meaningful interaction within your system. Transactions help you coordinate identity-related actions across multiple Persona products and your own infrastructure and are a key component for any API-first integration method. This article outlines the primary methods for creating a Transaction and highlights how to integrate Transaction creation into your existing workflows and automation processes.

## Methods for creating a Transaction

### 1\. Within a Workflow (Recommended)

You can create a Transactions within a Persona Workflow, either as a trigger or as a step in a larger identity orchestration flow.

### Relevant Workflow Steps

- [Workflows: Create Transaction Step](https://help.withpersona.com/articles/6yTKeRbCEdxNfYBucXqBZU/): Allows you to generate a Transaction from within a Workflow.

### Specifying Transaction attributes in the Workflow Step

You will need to specify the Transaction Type for a newly created Transaction and you can additionally define Transaction fields or other attributes. See the article on [Workflows: Create Transaction Step](https://help.withpersona.com/articles/6yTKeRbCEdxNfYBucXqBZU/) for step-specific configurations.

### 2\. Directly creating a Transaction via API (Recommended)

You can create a Transaction directly via the API.

### Relevant API endpoint

The relevant API endpoint to execute this request is:

- [Create a Transaction](https://docs.withpersona.com/reference/create-a-transaction)

### Specifying Transaction attributes in the API request

The Create a Transaction endpoint allows you to define various attributes when programmatically creating a Transaction.

- `transaction-type-id`: Defines the Transaction Type.
- `fields`: (Optional) Custom field data to describe or contextualize the Transaction (e.g., transaction amount, location, or reason). You can [define schema is on the Transaction Type](https://help.withpersona.com/articles/46CAEFF2OIg2G826BAlfkG/).
- `reference-id`: Unique identifier for the Transaction

To learn more about integration via Transactions, [review methods](https://docs.withpersona.com/docs/transactions).
