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
EstablishTransactionendpoint, atransactionIdis 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
transactionIdfor these operations refers solely to the specific payment event (e.g., the debit or credit being processed).
When processing a Cancel Transaction 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 Get Transaction API endpoint to retrieve the latest status and details.