---
title: "POST /v2/build-tx"
method: POST
path: "/v2/build-tx"
tags: ["Server"]
---

# POST /v2/build-tx

`POST /v2/build-tx`

## Request

- The document declares no server URL.
- Auth: none declared
- TypeScript: <https://skmtc.dev/swaprhq/apis/movr-aggregator-api/docs/v2/build-tx/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `API-KEY` string

## Request body

- SingleTxDTO
  - `route` Route, required
    - `routeId` string, required: Unique id for each route.
    - `fromAmount` string, required: Sending token amount.
    - `chainGasBalances` ChainGasBalances, required
    - `toAmount` string, required: Approximate receiving token amount.
    - `usedBridgeNames` string[], required: Array of bridges used in the route
    - `totalUserTx` number, required: Total number of transactions for the route.
    - `totalGasFeesInUsd` number, required: Combined USD gas fees for all transactions in the route.
    - `sender` string, required: Address of user making the transactions.
    - `userTxs` object[], required: Array of user transactions.
    - `serviceTime` number, required: Estimate of total time in seconds, excluding the transaction time.

## Response `200`

Get the tx details for the route.

- SingleTxOutputDTO
  - `success` boolean, required: Status of API.
  - `result` SingleTxResponse, required
    - `userTxType` 'approve' | 'fund-movr' | 'claim' | 'dex-swap' | 'sign', required: Type of user transaction.
    - `txTarget` string, required: Address to which transaction has to be sent.
    - `chainId` 'ETHEREUM' | 'OPTIMISM' | 'BSC' | 'XDAI' | 'POLYGON' | 'FANTOM' | 'ARBITRUM' | 'AVALANCHE', required: Id of chain where transaction has to be sent.
    - `txData` string, required: Calldata for transaction.
    - `txType` 'eth_sendTransaction' | 'eth_signMessage', required: Type of transaction.
    - `value` string, required: Native token amount to be sent with transaction.
    - `totalUserTx` number, required: Total number of transactions in Active Route.
    - `approvalData` ApprovalData, required
      - `minimumApprovalAmount` string, required: Minimum amount of approval needed.
      - `approvalTokenAddress` string, required: Address of token for which approval is required.
      - `allowanceTarget` string, required: Contract address that needs approval.
      - `owner` string, required: Address of owner.

## Other responses

- `201`

---

[API](https://skmtc.dev/swaprhq/apis/movr-aggregator-api.md) - [All operations](https://skmtc.dev/swaprhq/apis/movr-aggregator-api/llms.txt) - [OpenAPI document](https://skmtc.dev/swaprhq/apis/movr-aggregator-api/revisions/8b1957cc0e8f?raw)
