> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://amer.developers.trustly.com/llms.txt.
> For full documentation content, see https://amer.developers.trustly.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.com/_mcp/server.

# Transaction ID

The `transactionId` parameter is a unique identifier used throughout the Trustly API to track the lifecycle of an authorization or payment event. Understanding its role in various API calls is essential for correct integration.

### Transaction ID usage

The `transactionId` is used to reference specific phases and events of a transaction:

* **Initial Authorization:** When creating a bank authorization via the `EstablishTransaction` endpoint, a `transactionId` is generated. This ID specifically references the event of the consumer granting the mandate (consent) to use their account.
* **Fund Movement:** Subsequent operations that move funds, such as a **Capture** or **Deposit** transaction, create a *new* transaction linked to the initial authorization. The output `transactionId` for these operations refers solely to the specific payment event (e.g., the debit or credit being processed).

When processing a [Cancel Transaction](/api-reference/api/transactions/post-transactions-cancel) call, use the `transactionId` associated with the specific fund movement (Capture or Deposit) transaction, **not** the original bank authorization ID. Canceling the bank authorization ID could result in a permanent cancellation of the consumer's account mandate.

### Transaction lifecycle examples

The table below illustrates which subsequent API actions can be performed using the `transactionId` generated by an initial action.

| Initial Action (Generates)      | Subsequent Actions (Receives Reference)                                                                   |
| :------------------------------ | :-------------------------------------------------------------------------------------------------------- |
| **Establish (Consent/Mandate)** | PreAuth (Authorization), Capture (Payin), Deposit (Payout), Cancel, User information, Account information |
| **PreAuth (Authorization)**     | Capture (Payin), Cancel                                                                                   |
| **Capture (Payin)**             | Cancel, Refund                                                                                            |
| **Deposit (Payout)**            | Cancel, Reclaim                                                                                           |

Any `transactionId` can be used with the <a>Get Transaction</a> API endpoint to retrieve the latest status and details.