---
title: "Record an executed swap transaction"
method: POST
path: "/swaps"
tags: ["Swaps"]
---

# Record an executed swap transaction

`POST /swaps`

## Request body

- SwapCreateRequest
  - `tokenIn` string, required
  - `tokenOut` string, required
  - `amountIn` string, required
  - `amountOutEstimated` string, required
  - `amountOutMin` string, required
  - `amountOutActual` string
  - `slippageBps` integer, required
  - `routeTokens` string[], required
  - `encodedPath` string, required
  - `walletAddress` string, required
  - `txHash` string

## Response `201`

Swap recorded

- Swap
  - `id` string, required
  - `userId` string, required
  - `tokenIn` string, required
  - `tokenOut` string, required
  - `amountIn` string, required
  - `amountOutEstimated` string, required
  - `amountOutMin` string, required
  - `amountOutActual` string
  - `slippageBps` integer, required
  - `routeTokens` string[], required
  - `encodedPath` string, required
  - `walletAddress` string, required
  - `txHash` string
  - `status` 'initiated' | 'completed' | 'failed' | 'unknown', required
  - `failureReason` string
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized — missing or invalid credentials

---

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