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


---

# 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://learn.layerswap.io/api/api-integration/deprecated-v1-api-reference/create-swap.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.
