# Retrieve Transaction

Retrieve a previously created transaction using its **`id`**.&#x20;

This returns the same response as a transaction verification except that the transaction **`id`** generated by SwitchApp is used in this case to retrieve the transaction record instead of your payment reference.

{% hint style="info" %}
**NOTE:** Transactions provide a source of truth for reconciliations. As such, they cannot be deleted. But you may hide or archive them.
{% endhint %}

{% openapi src="/files/D2OnIDDY2fzSVTk2AYNl" path="/v1/transactions/{id}" method="get" %}
[merchant-api-swagger-10-04-2023.json](https://163660187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8qcR8TOKMHOvHEJFAJcO%2Fuploads%2Fz1Hkjfk2wl3pDM0TQvng%2Fmerchant-api-swagger-10-04-2023.json?alt=media\&token=79cc08f6-9596-401d-993c-32a29da7d56f)
{% endopenapi %}

{% tabs %}
{% tab title="curl" %}

```clike
curl https://api.switchappgo.com/v1/transactions/:transactionId \
    -H "authorization: 'bearer sk_test_nTgS42KNdKr6Ts798DT'"
    -X GET
```

{% endtab %}

{% tab title="node" %}

```javascript
const switchapp = require('switchapp')('sk_test_nTgS42KNdKr6Ts798DT');

const newTx = await switchapp.transactions.verify({
    txRef: transactionId
})
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.switchappgo.com/payments/transactions/retrieve-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
