> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swap.coffee/llms.txt
> Use this file to discover all available pages before exploring further.

# Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet



## OpenAPI

````yaml https://backend.swap.coffee/openapi post /v2/route/transactions
openapi: 3.0.3
info:
  title: Swap Coffee API
  version: 1.0.0
servers:
  - url: https://backend.swap.coffee/
  - url: http://localhost:8080/
security:
  - {}
  - ApiKey: []
tags:
  - name: Entity
    description: Tokens, pools, DEXes, etc.
  - name: Routing
    description: >-
      Core functionality of the aggregation service. Build routes, get
      transactions, etc.
  - name: Strategies
    description: Limit orders, DCA, VCA, etc.
  - name: Yield
    description: >-
      Yield aggregator functionality. Provides and handles routes to pools with
      the best yield.
  - name: Referral
    description: Everything related to the referral program of swap.coffee.
  - name: Cashback
    description: Cashback programs conducted on swap.coffee.
  - name: Claim
    description: Claiming various rewards available on swap.coffee.
  - name: Contests
    description: Timed contests based on trading volumes for certain token-pairs.
  - name: Staking
    description: Responsible of managing staked funds, corresponding rewards, etc.
  - name: DEX
    description: Core functionality of the Coffee DEX service.
  - name: LiquidityProvisioning
    description: Everything related to liquidity provisioning in DEXes.
  - name: Boosts
    description: >-
      Functionality to support incentives and rewards for liquidity providers
      among all DEXes.
  - name: Profile
    description: Retrieve information about user profiles.
  - name: Partnership
    description: Various functionality for our partners.
  - name: Statistics
    description: Retrieve information about dex aggregation stats.
  - name: Ton
    description: Retrieve information about TON entities.
  - name: Auth
    description: Auth operations. For internal usage only.
paths:
  /v2/route/transactions:
    post:
      tags:
        - Routing
      summary: >-
        Returns pre-built transactions for the given route. It is assumed that
        transactions will be signed and sent by the sender via wallet
      operationId: buildTransactionsV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiTransactionsRequest'
      responses:
        '200':
          description: transactions for the route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionsResponse'
        default:
          $ref: '#/components/responses/ApiError'
components:
  schemas:
    ApiTransactionsRequest:
      type: object
      required:
        - sender_address
        - paths
      properties:
        sender_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        slippage:
          type: number
          format: double
          description: >-
            If the slippage is exceeded, the transaction will not be executed
            and intermediate tokens will be returned to the sender.
          minimum: 0
          maximum: 1
          example: 0.05
        dynamic_slippage:
          type: boolean
          description: If set to true, slippage will be calculated dynamically.
          default: false
          example: true
        referral_name:
          type: string
          description: >-
            May be set whilst building transactions from B2B partnership
            products
          example: tonkeeper
        custom_fee:
          $ref: '#/components/schemas/ApiTransactionsCustomFee'
        mev_protection:
          type: boolean
          description: Whether a MEV protection should be enabled
          example: true
        paths:
          type: array
          description: Value of this field is a response from route building endpoint
          items:
            $ref: '#/components/schemas/ApiRoutingStep'
    ApiTransactionsResponse:
      type: object
      required:
        - route_id
        - transactions
      properties:
        route_id:
          type: integer
          description: Unique identifier of the route used for tracking.
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/ApiSwapTransaction'
    ApiTransactionsCustomFee:
      type: object
      description: >-
        If present, additional transaction for fees collection will be
        generated. Because of that, be careful with max_splits to not exceed
        wallet contract limits
      properties:
        fixed_fee:
          type: string
          description: Value in nanotons
        percentage_fee:
          type: integer
          description: >-
            Value in 1/1000000: 1 is 0.0001%, 1000000 is 100%. If present, can
            not be less than 10000000 (0.01 TON)
        min_percentage_fee_fixed:
          type: string
          description: >-
            Value in nanotons. No less than this value may be withdrawn as a
            percentage_fee. Must be set if percentage_fee is present. Can not be
            less than 10000000 (0.01 TON)
        max_percentage_fee_fixed:
          type: string
          description: >-
            Value in nanotons. If set, no more than this value may be withdrawn
            as a percentage_fee. Taken into account only if percentage_fee is
            present
    ApiRoutingStep:
      type: object
      required:
        - blockchain
        - dex
        - pool_address
        - input_token
        - output_token
        - swap
        - recommended_gas
        - average_gas
      properties:
        blockchain:
          type: string
          example: ton
        dex:
          type: string
          example: stonfi
        pool_address:
          type: string
        input_token:
          $ref: '#/components/schemas/ApiToken'
        output_token:
          $ref: '#/components/schemas/ApiToken'
        swap:
          $ref: '#/components/schemas/ApiSwap'
        recommended_gas:
          type: number
          format: double
        average_gas:
          type: number
          format: double
        next:
          type: array
          items:
            $ref: '#/components/schemas/ApiRoutingStep'
    ApiSwapTransaction:
      type: object
      required:
        - address
        - value
        - cell
        - send_mode
        - query_id
      properties:
        address:
          type: string
          example: EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez
        value:
          type: string
          format: int128
          description: >-
            Amount of nanotons to be sent. Can be passed to TonConnect
            transaction.
        cell:
          type: string
          description: >-
            Base64-encoded cell. Treated as a payload field in TonConnect
            transaction.
          format: base64
        stateInit:
          type: string
          description: Base64-encoded stateInit cell. Used to deploy a contract
          format: base64
        send_mode:
          type: integer
          format: int32
          description: >-
            Internal message send mode. More:
            https://docs.ton.org/develop/smart-contracts/messages#message-modes
        query_id:
          type: integer
          format: int64
          description: >-
            Unique identifier of the query used for tracking swap.coffee
            transactions among others
    ApiToken:
      type: object
      required:
        - address
        - metadata
      properties:
        address:
          $ref: '#/components/schemas/ApiTokenAddress'
        metadata:
          $ref: '#/components/schemas/ApiTokenMetadata'
    ApiSwap:
      type: object
      required:
        - result
        - input_amount
        - output_amount
        - before_reserves
        - after_reserves
      properties:
        result:
          $ref: '#/components/schemas/ApiSwapResult'
        input_amount:
          type: number
          format: double
        output_amount:
          type: number
          format: double
        before_reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        after_reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        reason:
          type: string
        left_amount:
          type: number
          format: double
    ApiTokenAddress:
      type: object
      required:
        - blockchain
        - address
      properties:
        blockchain:
          type: string
          example: ton
        address:
          type: string
          example: native
    ApiTokenMetadata:
      type: object
      required:
        - name
        - symbol
        - decimals
        - listed
        - verification
      properties:
        name:
          type: string
          example: ARBUZ
        symbol:
          type: string
          example: ARBUZ
        decimals:
          type: integer
          format: int32
        image_url:
          type: string
        listed:
          type: boolean
        verification:
          $ref: '#/components/schemas/ApiTokenVerification'
    ApiSwapResult:
      type: string
      description: Result of the swap
      enum:
        - fully_fulfilled
        - partially_fulfilled
        - unavailable
    ApiPoolReserves:
      type: array
      items:
        type: number
        format: double
    ApiTokenVerification:
      type: string
      enum:
        - whitelisted
        - blacklisted
        - community
        - unknown
  responses:
    ApiError:
      description: Some error during request processing
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      name: X-Api-Key
      in: header

````