> For the complete documentation index, see [llms.txt](https://docs.switchappgo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.switchappgo.com/payments/transactions/verify-transaction.md).

# Verify transaction

After initializing a transaction, you transfer control to your customer to complete payment. Hence, online payments require you to always run a verification check even if you are informed that payment has been completed.

Transaction verification provides a way for you to confirm the status of a transaction. A transaction may be in a **`processing`** state if payment processor networks are having a slow day. However, once a transaction is completed, a verification request will let you know if it was successful or failed.

{% hint style="info" %}
**NOTE:** If a verified transaction is successful, you can give value to your customer as SwitchApp guarantees that payment has been received.
{% endhint %}

{% openapi src="/files/yNYfxvOAS2AtEzGrJBGd" path="/v1/transactions/verify/{tx\_ref}" method="get" %}
[merchant-api-swagger-10-04-2023 - 1.json](https://163660187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8qcR8TOKMHOvHEJFAJcO%2Fuploads%2FiV9fw9tqYE1MwAdHKqX2%2Fmerchant-api-swagger-10-04-2023%20-%201.json?alt=media\&token=babc9855-c331-49bb-b3b5-09e307e42cbd)
{% endopenapi %}

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

```clike
curl https://api.switchappgo.com/v1/transactions/verify/{reference} \
    -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({
    tx_ref: 'YOUR_REFERENCE'
})
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/verify-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.
