> 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/create-swap.md).

# Create Swap

In order to initiate the process of bridging assets across blockchains, CEXes, and fiat, a Swap should be created. Swap has all the necessary information required to be able to process transfers from the source to the destination.

<mark style="color:green;">`POST`</mark> `https://api.layerswap.io/api/swaps`

Create swap

#### Headers

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

#### Request Body

| Name                                                   | Type   | Description                                                                                                                                                     |
| ------------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| destination<mark style="color:red;">\*</mark>          | String | The supported blockchain network name, where the funds should be sent by the user.[ See available values.](/api/data/supported-platforms/supported-networks.md) |
| source<mark style="color:red;">\*</mark>               | String | The supported blockchain network name, where the funds should be sent by the user.[ See available values.](/api/data/supported-platforms/supported-networks.md) |
| amount<mark style="color:red;">\*</mark>               | Number | The predefined amount. Note that this is **NOT** the final amount sent by the user since the user can specify another amount while transferring.                |
| source\_asset<mark style="color:red;">\*</mark>        | String | The swap currency name. [See available assets](broken://pages/OP5GKjebwv1aQjx1fVNx).                                                                            |
| destination\_address<mark style="color:red;">\*</mark> | String | The destination network address, where the user will receive the funds.                                                                                         |
| refuel<mark style="color:red;">\*</mark>               | Bool   | If set to true, the user will receive an additional refuel transaction in the native currency to the specified `destination_address.`                           |
| reference\_id                                          | String | Partner specified ID that could be used for the future reference to retrieve the swap.                                                                          |
| destination\_asset                                     | String | The swap currency name. [See available assets](broken://pages/OP5GKjebwv1aQjx1fVNx).                                                                            |

{% tabs %}
{% tab title="201: Created Newly created swap Id" %}

```json
{
  "data": {
    "swap_id": "28996c7d-ee95-4727-8efe-ba0006aa16d4"
    }
  "error": null
}
```

{% endtab %}
{% endtabs %}

#### Raw request

<pre class="language-bash"><code class="lang-bash">curl -X 'POST' \
'https://api.layerswap.io/api/swaps' \
<strong>  -H 'X-LS-APIKEY: {YOUR_APP_APIKEY}' \
</strong>  -H 'Content-Type: application/json' \
  -d '{
      "source": "ETHEREUM_MAINNET",
      "destination": "ARBITRUM_MAINNET",
      "amount": 0.007,
      "source_asset": "ETH",
      "destination_asset": "ETH",
      "destination_address": "0xe688b84b23f322a994A53dbF8E15FA82CDB71127",
      "refuel": false,
      "reference_id": "1"
  }'
</code></pre>

#### Raw response

```json
{
  "data": {
    "swap_id": "28996c7d-ee95-4727-8efe-ba0006aa16d4"
    }  
  "error": null
}
```
