# edd_get_payment_transaction_id()

 The *edd\_get\_payment\_transaction\_id()* function is used to retrieve the transaction ID related to a specific purchase.

 The function takes the payment ID as a parameter:

```
$trans_id = edd_get_payment_transaction_id( $payment_id );
```

 The transaction ID returned is passed through a filter called [*edd\_get\_payment\_transaction\_id*](https://easydigitaldownloads.com/docs/edd_get_payment_transaction_id/), which receives two parameters:

- $transaction\_id
- $payment\_id

 Transaction ID tracking was implemented in EDD v2.1 and is done on a per-gateway basis, so not all payment records will have transaction IDs. If a transaction ID does not exist for a payment record, the *edd\_get\_payment\_transaction\_id-{gateway name} filter* is applied before the *edd\_get\_payment\_transaction\_id* filter so that the transaction ID can (possibly) be pulled from the payment notes. This allows payment gateways to update old payment records over time by retrieving the transaction ID from a custom storage method unique to that gateway.