# 08-Report-Transfer-Result



08-Report-Transfer-Result [#08-report-transfer-result]

A VASP who transfers the virtual asset shall send the transfer result (Transaction ID) of the corresponding asset to the VASP to whom the asset is transferred immediately after transferring an asset, and use this API.

Tx ID or tx hash must always use blockchain **Node Output** data. Adding '0x' in front of a tx hash can lead to a mismatch in the tx hash. Please be cautious &#x2A;*not to include '0x'** which is not part of the **Node Output**.

Verify Result [#verify-result]

* This API works in synchronous manner that immediately returns a response from the counterparty, allowing you to determine whether the txid delivery was successful or failed.
* If you receive a response other than 'normal', it is recommended to implement a retry logic with an appropriate number of attempts.
* If a normal response is still not received after all retry attempts have been exhausted, further investigation is required. In this case, please inform the CodeVASP team.

> **Smart Contract Transactions**
>
> * Transactions executed via smart contracts may be rejected for deposit depending on the beneficiary VASP's policy. Therefore, always check the counterparty VASP's policy first.
> * **Multi-signature transactions** are a typical example.
> * To process these types of transactions in compliance with the protocol, one possible approach is to route the transfer through a hot wallet before sending it out.

Endpoint [#endpoint]

`POST` `/v1/code/transfer/{BeneficiaryVaspEntityId}/txid`

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`        |

Path Parameters [#path-parameters]

| Name                    | Type   | Required | Description                                |
| :---------------------- | :----- | :------- | :----------------------------------------- |
| BeneficiaryVaspEntityId | string | Required | EntityID of the VASP who owns the address. |

Body Parameters [#body-parameters]

| Name       | Type   | Required | Description                                                |
| :--------- | :----- | :------- | :--------------------------------------------------------- |
| transferId | string | Required | UUID assigned to the asset transfer authorization request. |
| txid       | string | Required | Transaction ID generated on the blockchain.                |
| vout       | string | Optional | Output index (for UTXO coins).                             |

**transferId**: This is UUID assigned to the an asset transfer authorization request. It updates the asset transfer result to the corresponding transaction.

***

**txid**: This is a transaction ID generated for virtual asset transfer. This is the information generated on each blockchain.

***

**vout**: For the utxo type coin, multiple txids can be created so that vout is required to distinguish unique txids.

* What is vout? [https://learnmeabitcoin.com/technical/transaction/input/vout/](https://learnmeabitcoin.com/technical/transaction/input/vout/)

Response [#response]

Fields [#fields]

| Name       | Type   | Description                                         |
| :--------- | :----- | :-------------------------------------------------- |
| transferId | string | The transfer ID.                                    |
| result     | string | Result code (`normal`, `error`).                    |
| reasonType | string | Reason code if error (e.g., `TXID_ALREADY_EXISTS`). |

**transferId**: This is an ID to distinguish asset transfer transactions in all APIs

***

**result**: This is the result of receiving originating information.

-`normal`: normal processing

-`error`: If status change is not possible

***

**reasonType**: If the result value is error, a value which identifies the detailed reason.

-`TXID_ALREADY_EXISTS`: You are trying to store a different TXID for an asset transfer that already has a TXID stored. Once a TXID is created, it may fail, but it cannot be changed.

-`TRANSFER_ALREADY_FAILED`: You cannot send a TXID if the blockchain transaction status of corresponding to the TransferId, already failed.

-`UNKNOWN_TRANSFER_ID`: TransferID cannot be found.

-`UNKNOWN`: Unkown error.

Examples [#examples]

Request [#request]

```bash
curl --request POST \
     --url https://trapi-dev.codevasp.com/v1/code/transfer/codexchange/txid \
     --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 '
{
  "transferId": "b09c8d00-8da9-11ec-b909-0242ac120002",
  "txid": "311BFF73D9B7969CCF1042186180159C724FAB59013A7A034A93E5FB9D6BAFE6"
}'
```

Response [#response-1]

```json
{
  "transferId": "b09c8d00-8da9-11ec-b909-0242ac120002",
  "result": "error",
  "reasonType": "TRANSFER_ALREADY_FAILED"
}
```
