---
title: "Create Swap Session"
method: POST
path: "/api/v1/sessions/swap"
tags: ["DeX Swap"]
---

# Create Swap Session

`POST /api/v1/sessions/swap`

This API is used to create DeX swap session for token swap transaction.

## Request body

- CreateSessionDexDto
  - `successURL` string — URL to redirect user after completing a transaction
  - `cancelURL` string — URL to redirect user after cancelling a transaction
  - `userEmail` string, required — An existing user email needs to be provided when creating a transaction session
  - `tokenIn` string, required — Symbol of token used for swap from
  - `tokenOut` string, required — Symbol of token used for swap to
  - `slippagePercentage` string — Slippage tolerance percentage
  - `amount` number, required — Amount of tokens to swap
  - `chain` string, required — Blockchain to which the transaction will be sent. See https://thirdfi.readme.io/reference/dexswap-overview#list-of-chains-we-supported for more information.
  - `isNative` boolean — If true, native token will be used. If false, wrapped tokens (E.g. WETH) will be used. defaults to false
  - `exactIn` boolean — If true, the exact amount entered will be considered as input token amount. If false, the entered amount will be considered as required output amount. Default to true

## Response `201`

Session is created.

- object
  - `statusCode` number
  - `message` string
  - `data` object — Session object. See https://thirdfi.readme.io/reference/the-session-object for more information.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden Resources

---

[API](https://skmtc.net/thirdfi/apis/thirdfi-api.md) · [All operations](https://skmtc.net/thirdfi/apis/thirdfi-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thirdfi/thirdfi-api/versions/4d70807293f6/schema)
