> For the complete documentation index, see [llms.txt](https://learn.layerswap.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.layerswap.io/api/api-integration/deprecated-v1-api-reference/prepare-source-transaction.md).

# Prepare Source Transaction

This endpoint return all the neccessary information to execute source transaction.&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.layerswap.io/api/swaps/{id}/prepare_src_transaction`

Prepare swap deposit for execution

#### Path Parameters

| Name                                 | Type   | Description                                                    |
| ------------------------------------ | ------ | -------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | String | The Swap response data.id received in the create swap endpoint |

#### Query Parameters

| Name          | Type   | Description                                                |
| ------------- | ------ | ---------------------------------------------------------- |
| from\_address | String | Address from which the transaction is going to be executed |

#### Headers

| Name                                          | Type | Description                                                   |
| --------------------------------------------- | ---- | ------------------------------------------------------------- |
| X-LS-APIKEY<mark style="color:red;">\*</mark> |      | API Key retrieved from [Partner Setup](/api/partner-setup.md) |

{% tabs %}
{% tab title="200: OK Prepared transaction to execute" %}

```json
{
  "data": {
    "to_address": "0x5dA5C2a98e26FD28914b91212b1232D58eb9bbab",
    "data": "0xba2",
    "value": 0.009,
    "base_units": "9000000000000000",
    "chain_id": "5",
    "network": "ETHEREUM_GOERLI"
  },
  "error": null
}
```

{% endtab %}
{% endtabs %}

#### Raw Request

```bash
curl -X 'GET' \
  'https://api.layerswap.io/api/swaps/{ID}/prepare_src_transaction?from_address=0xBaF6dC2E647aeb6F510f9e318856A1BCd66C5e19' \
  -H 'X-LS-APIKEY: {YOUR_APP_APIKEY}'
```

### Raw Response

```json
{
  "data": {
    "to_address": "0x5dA5C2a98e26FD28914b91212b1232D58eb9bbab",
    "data": "0xba2",
    "value": 0.009,
    "base_units": "9000000000000000",
    "chain_id": "5",
    "network": "ETHEREUM_GOERLI"
  },
  "error": null
}

```

{% hint style="info" %}
Note that you should execute this transaction manually. You should compose it based on the response and send to your wallet for execution. (Ex. User's Metamask, wallet managed by Fireblocks)
{% endhint %}
