> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vindicia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# fetchByMerchantTransactionId

Returns the `Transaction` specified by the input `merchantTransactionId`. Use this method to fetch specific transactions. Use `fetchBillingResults` to retrieve all results in a single call.

Use this method also to confirm that Select received a transaction when the `merchantTransactionId` was provided. It returns the transaction that was submitted, but it does not return the final processing status of the transaction. Use `fetchBillingResults` to obtain the final processing status.

When a `transactionId`, that is, the transaction processing Id of a Select processing step (retry) after submission, is provided, that transaction is returned. Note that the only way to find out the final state of a `transactionId` is by using the `fetchBillingResults` call. This means that you should already have received all final state results. Making this call with a `transactionId` that you got from fetchBillingResults would only provide the same results.

## Input

*merchantTransactionId*: the `merchantTransactionId` for the transaction to fetch.

## Output

*return*: an object of type `Return` that indicates the success or failure of the call.

*transaction*: the transaction identified by the `TransactionId`.

## Returns

This method returns the codes listed in [Retain Return Codes](retain.return_codes).

## Example

```

$select = new select();
//Assume we have a merchantTransactionId 'TxPrfx123'
//that we want to retrieve information on.
$merchantTxId = 'TxPrfx123';
$ret = $select->fetchByMerchantTransactionId($merchantTxId);
if($ret['returnCode'] == 200)
{
    $fetchedTransaction = $ret['transaction'];
    //Process fetched transaction here...
}
else
{
//Handle error condition.
}
```

**Parent topic:**[Vindicia Retain Methods](../topics/vindicia_retain_methods)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.