# 11-Search-VASP-by-TXID-Request



11-Search-VASP-by-TXID-Request [#11-search-vasp-by-txid-request]

In the case where an anonymous transaction has made, you can verify if it was generated from one of CodeVASP members, and query the entity ID by calling this API.

This API searches for TXID originators only among CodeVASP members. A `NOT_FOUND_TXID` response indicates that the TXID was either generated by a non-CodeVASP member or there was a temporary server issue.

> ❗️The Txid or tx hash must always be used exactly as provided in the blockchain Node Output data. Adding '0x' in front of the tx hash may cause a mismatch. Therefore, please ensure that '0x' is not included unless it is present in the Node Output.

> ❗️After making a request to an API that operates **asynchronously**, you can either **receive the result using a Callback URL or check the result via the 'Search VASP by TXID Result' API**. The result data is the same for both methods.

> ❗️If the `currency` and `network` parameters are entered, GTR member VASPs will also be searched. Providing these parameters is recommended for more comprehensive search results. For coin-specific network information, please refer to \[interoperability page with other protocols].

Endpoint [#endpoint]

`POST` `/v1/code/verification/tx`

Request Parameters [#request-parameters]

Headers [#headers]

| Name                 | Type   | Required | Description               |
| :------------------- | :----- | :------- | :------------------------ |
| X-Code-Req-Datetime  | string | Required | ISO8601 UTC datetime      |
| X-Code-Req-Nonce     | string | Required | Random nonce              |
| X-Code-Req-PubKey    | string | Required | Your Public Key           |
| X-Code-Req-Signature | string | Required | Signature                 |
| X-Request-Origin     | string | Required | `code:{yourVaspEntityId}` |
| accept               | string | Optional | `application/json`        |
| content-type         | string | Required | `application/json`        |

Body Parameters [#body-parameters]

| Name               | Type   | Required | Description                                                                                                                    |
| :----------------- | :----- | :------- | :----------------------------------------------------------------------------------------------------------------------------- |
| txid               | string | Required | Transaction ID (TXID).                                                                                                         |
| beneficiaryAddress | string | Required | Beneficiary's wallet address (with tag/memo if applicable).                                                                    |
| requestId          | string | Required | Unique request ID for querying the result.                                                                                     |
| currency           | string | Optional | Currency symbol (required for GTR search).                                                                                     |
| network            | string | Optional | Network name (required for GTR search). Use `all` to search all. Please refer \[12-Interoperability page with other protocols] |
| callbackUrl        | string | Optional | Callback URL in `https://` format.                                                                                             |

Response [#response]

Fields [#fields]

| Name      | Type   | Description                       |
| :-------- | :----- | :-------------------------------- |
| result    | string | Result code (`SUCCESS` if valid). |
| requestId | string | The request ID provided.          |

Examples [#examples]

Request [#request]

```bash
curl --request POST \
     --url https://trapi-dev.codevasp.com/v1/code/verification/tx \
     --header 'X-Code-Req-Datetime: 2024-03-04T15:10Z' \
     --header 'X-Code-Req-Nonce: 989166249' \
     --header 'X-Code-Req-PubKey: YourPubkey' \
     --header 'X-Code-Req-Signature: Signature' \
     --header 'X-Request-Origin: code:yourVaspEntityId' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "txid": "311BFF73D9B7969CCF1042186180159C724FAB59013A7A034A93E5FB9D6BAFE6",
  "requestId": "fafd59e2-aff7-4cff-b7d8-9caa0cda70da",
  "beneficiaryAddress": "address:tag",
  "currency": "xrp",
  "network": "xrp",
  "callbackUrl": "https://endpoint.com"
}'
```

Response [#response-1]

```json
{
  "result": "SUCCESS",
  "requestId": "b09c8d00-8da9-11ec-b909-0242ac120002"
}
```
