> For the complete documentation index, see [llms.txt](https://docs.tylt.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tylt.money/tylt-embedded-wallet-service/wallet-management-apis/validate-transaction.md).

# Validate Transaction

Validates a transaction or transaction reference using the underlying transaction-validation controller.

### Endpoint

```http
GET /whitelabel/transactions/validate
```

### Request Headers

```http
x-tlp-apikey: <api-key>
x-tlp-signature: <hmac-signature>
```

### Query Parameters

Provide at least one of the following user identifiers: `endUserEmail`, `endUserId`, or `externalUserId`.

| Field            | Type   |    Required | Description                         |
| ---------------- | ------ | ----------: | ----------------------------------- |
| `endUserEmail`   | String | Conditional | End user’s registered email address |
| `endUserId`      | Number | Conditional | Tylt end-user ID                    |
| `externalUserId` | String | Conditional | Merchant’s own user identifier      |
| `transactionId`  | Number |         Yes | The transaction's identifier        |

### Example Request

```http
GET /whitelabel/transactions/validate?externalUserId=user-10021&transactionId=98765
```

> The exact validation parameter must be confirmed against the deployed API schema.

### Code Snippet

{% tabs %}
{% tab title="JavaScript (Axios)" %}

```javascript
import crypto from 'crypto';
import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

const queryParams = {
    endUserId: 20001, // Optional: Provide one user identifier only
    endUserEmail: "joe@example.com", // Optional: Alternative to endUserId and externalUserId
    externalUserId: "user-10021", // Optional: Alternative to endUserId and endUserEmail
    transactionId: '2144884'
};

const rawPayload = JSON.stringify(queryParams);
const signature = crypto.createHmac('sha256', apiSecret).update(rawPayload).digest('hex');

const headers = {
    'x-tlp-apikey': apiKey,
    'x-tlp-signature': signature
};

const queryString = new URLSearchParams(queryParams).toString();
axios.get(`https://api.tylt.money/whitelabel/transactions/validate?${queryString}`, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error('Error:', error.response ? error.response.data : error.message));
```

{% endtab %}
{% endtabs %}

### Example Response

```json
{
  "status": "success",
  "data": {
    "isValid": true
  },
  "msg": ""
}
```

### Use Cases

Use this endpoint to:

* Confirm that a transaction exists
* Confirm that it belongs to the identified end user
* Validate a transaction before displaying a receipt
* Confirm transaction status during reconciliation
* Validate a transaction reference provided by the end user

***

##
