# Transfer SRR Ownership By RevealHash

### Transfer With Default Collection

<mark style="color:green;">`POST`</mark> `<base_url>/startrail/api/v1/srr/{tokenId}/transferByReveal`

### Transfer With Custom Collection

<mark style="color:green;">`POST`</mark> `<base_url>/startrail/api/v1/srr/{contractAddress}/{tokenId}/transferByReveal`

Please replace `<base_url>` as explained [here](https://docs.startrail.io/readme/url-per-environment).&#x20;

Transfer SRR to a new owner providing a reveal hash, the hash of matches the commitment given in the approval stage.

{% hint style="info" %}
Default collection address is not supported in `Transfer With Custom Collection`. Please use `Transfer With Default Collection` instead.&#x20;
{% endhint %}

#### Path Parameters

| Name                                      | Type   | Description                        |
| ----------------------------------------- | ------ | ---------------------------------- |
| tokenId<mark style="color:red;">\*</mark> | String | Startrail Registry Record Token ID |
| contractAddress                           | String | The address of collection contract |

#### Request Body

| Name                                         | Type    | Description                                                                                         |
| -------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- |
| revealHash<mark style="color:red;">\*</mark> | String  | The key generated on Port Dashboard in advance for future transfer                                  |
| to<mark style="color:red;">\*</mark>         | String  | Next owner's EOA address. Both lowercase and mixed case which is compatible with EIP55 are accepted |
| isIntermediary                               | Boolean |                                                                                                     |

{% tabs %}
{% tab title="201: Created " %}

```json
{
  "txReceiptId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "statusCode":400,
<strong>    "message":"hash of revealHash does not match the SRR transferCommitment"
</strong>}
</code></pre>

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "statusCode":400,
    "message":"metadata is invalid. Check it against the metadata JSON schema. Details: should NOT have additional properties ({"additionalProperty":"unknownField"})."
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "statusCode":404,
    "message":"Token 41052230 not found"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Transaction Sending Errors - these errors occur after validation but before the transaction is sent to Ethereum." %}

```json
{
    "statusCode":500,
    "message":"API account is out of funds"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Transaction Sending Errors - these errors occur after validation but before the transaction is sent to Ethereum." %}

```json
{
    "statusCode":500,
    "message":"failed to send transaction toEthereum - internal error"
}
```

{% endtab %}
{% endtabs %}

## Request Body Example

```json
{
  "revealHash": "0x335929a4e59b0860ec04c620c1284dace74c00f7eadaadce7a18d6deba6c544e",
  "to": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
  "isIntermediary": false
}
```

## Swagger Endpoint (Test Environment)

[Swagger to test](https://api-stg.startrail.startbahn.jp/api/#/default/SRRController_transferByReveal)

## Required Permissions

* You need to have a Licensed User

{% hint style="info" %}
You must pass the `revealHash which you generated at` [`approveSRRByCommitment()`](https://docs.startrail.io/startrail-sdk-js/startrail-api-methods/approvesrrbycommitment) `via Startrail-Sdk-Js in order to complate transfer`
{% endhint %}
