# Transfer

<mark style="color:green;">`POST`</mark> `/transfer`

This endpoint generates an unsigned transaction for transferring tokens between wallets. It is designed specifically for transferring ENSC tokens only. The service validates both the sender and recipient addresses, confirms that the asset type is ENSC. It also checks that the sender has sufficient token [balance](/integrations/publish-your-docs-2/publish-your-docs-1.md) and [allowance](/integrations/publish-your-docs-2/token-approval.md) (pass the sender parameter to approve the token allowance).

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <api_key>` |

**Body**

<table><thead><tr><th width="173">Name</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>from</code></td><td>string</td><td>The wallet address that holds the tokens (sender).</td></tr><tr><td><code>recipient</code></td><td>string</td><td>The wallet address that will receive the tokens.</td></tr><tr><td><code>assetType</code></td><td>string</td><td>The asset type for the transfer. <strong>Must be</strong> <code>ENSC</code>.</td></tr><tr><td><code>amount</code></td><td>number</td><td>The number of tokens to transfer.</td></tr></tbody></table>

**Example**

{% tabs %}
{% tab title="Mint Allocation Check" %}

```json
{
  "from": "0xsenderaddress",
  "recipient": "0xrecipientaddress",
  "assetType": "ENSC",
  "amount": 5
}
```

{% endtab %}

{% tab title="Response (200) Ok" %}

```json
{
  "status": 200,
  "message": "Transfer transaction generated successfully",
  "data": {
    "to": "0xTokenContractAddressXYZ",
    "nonce": "12",
    "gasLimit": "0x186a0",
    "gasPrice": "20000000000",
    "data": "0xEncodedTransferFunctionCall",
    "fromAddress": "0xsenderaddress",
    "toAddress": "0xrecipientaddress",
    "value": "5000000000000000000"  // Amount in Wei (for 5 tokens with 18 decimals)
  }
}

```

{% endtab %}
{% endtabs %}

**Common Error Responses**

{% tabs %}
{% tab title="Invalid Sender Address:" %}

```json
{
  "status": 400,
  "error": "Invalid Request",
  "message": "Invalid sender address",
  "details": { "receivedAddress": "0xInvalidSender" }
}
```

{% endtab %}

{% tab title="Invalid Recipient Address:" %}

```json
{
  "status": 400,
  "error": "Invalid Request",
  "message": "Invalid recipient address",
  "details": { "receivedAddress": "0xInvalidRecipient" }
}
```

{% endtab %}

{% tab title="Unsupported Asset Type:" %}

```json
{
  "status": 400,
  "error": "Invalid Asset",
  "message": "Only ENSC transfers are allowed",
  "details": { "supportedAssets": ["ENSC"] }
}
```

{% endtab %}

{% tab title="Insufficient Balance:" %}

```json
// ENSC has 18 decimals, requiredBalance is 5 and currentBalance is 3
{
  "status": 400,
  "error": "Insufficient Balance",
  "message": "Sender does not have enough ENSC balance",
  "details": {
    "requiredBalance": "5000000000000000000",
    "currentBalance": "3000000000000000000"
  }
}
```

{% endtab %}

{% tab title="Insufficient Allowance:" %}

```json
{
  "status": 400,
  "error": "Insufficient Allowance",
  "message": "Sender has not approved enough tokens for transfer",
  "details": {
    "requiredAllowance": "5000000000000000000",
    "currentAllowance": "2000000000000000000"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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.prosperavest.com/integrations/publish-your-docs-2/transfer.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.
