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

# Submit Gasless Transaction

> Submits signed executions obtained from a gasless `GET /getAction` response for relay broadcast. The backend validates each signature, simulates the transactions, then broadcasts them via the configured relay provider.

Call this endpoint only when `executionsType` is `GASLESS` in the `getAction` response. Sign all items in the `executions` array in order before submitting.



## OpenAPI

````yaml /swap-api-reference/openapi.json post /submitTx
openapi: 3.1.0
info:
  title: Swaps API
  description: >-
    The Swaps API provides instant cross-chain swap and bridge functionality for
    decentralized applications.

    It supports multiple virtual machines (EVM, Solana, Bitcoin) and various DEX
    protocols and bridge solutions.
  version: 3.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /submitTx:
    post:
      summary: Submit Gasless Transaction
      description: >-
        Submits signed executions obtained from a gasless `GET /getAction`
        response for relay broadcast. The backend validates each signature,
        simulates the transactions, then broadcasts them via the configured
        relay provider.


        Call this endpoint only when `executionsType` is `GASLESS` in the
        `getAction` response. Sign all items in the `executions` array in order
        before submitting.
      operationId: submitTx
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitTxRequest'
      responses:
        '200':
          description: Transaction accepted for relay broadcast
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitTxResponse'
        '400':
          description: >-
            Bad request — invalid signature, unknown txId, or malformed
            executions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      servers:
        - url: https://api-v2.swaps.xyz/api
          description: Core Swap API server
components:
  schemas:
    SubmitTxRequest:
      type: object
      required:
        - txId
        - chainId
        - executions
      properties:
        txId:
          type: string
          description: >-
            The `txId` from the `GET /getAction` quote response. Used to
            correlate the signed executions with the original action on the
            relay.
        chainId:
          $ref: '#/components/schemas/ChainId'
          description: Source chain ID of the swap.
        executions:
          type: array
          description: >-
            All execution steps from the `getAction` response, each with a
            `signature` field populated by the user's wallet. Must be in the
            same order as returned by `getAction`.
          items:
            $ref: '#/components/schemas/Execution'
    SubmitTxResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: Whether the relay broadcast was accepted.
        txId:
          type: string
          description: >-
            Internal transaction ID. Pass this to `GET /getStatus` to poll for
            completion — the status endpoint will return the on-chain
            transaction hash once the relay broadcast confirms.
        error:
          type: string
          description: Error message when `success` is `false`.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Always false for error responses
          enum:
            - false
          example: false
        error:
          type: object
          required:
            - code
            - name
            - message
            - title
            - statusCode
            - timestamp
          properties:
            code:
              type: string
              description: Error type code for programmatic handling
            name:
              type: string
              description: Error class name
            message:
              type: string
              description: Detailed error message
            title:
              type: string
              description: Short, user-friendly error title
            statusCode:
              type: integer
              description: HTTP status code
            details:
              type: object
              description: Additional error details
              additionalProperties: true
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
    ChainId:
      type: integer
      description: Chain ID. Find in the list of supported networks.
    Execution:
      description: >-
        A single signing step returned in the `executions` array of a gasless
        `getAction` response. Only available for Tron same-chain swaps. The
        client must sign each item in order and include the signatures when
        calling `POST /submitTx`.
      oneOf:
        - $ref: '#/components/schemas/EvmTransactionSignExecution'
        - $ref: '#/components/schemas/EvmSignTypedDataExecution'
      discriminator:
        propertyName: txType
        mapping:
          evmTransactionSign:
            $ref: '#/components/schemas/EvmTransactionSignExecution'
          evmSignTypedData:
            $ref: '#/components/schemas/EvmSignTypedDataExecution'
    EvmTransactionSignExecution:
      type: object
      required:
        - txType
        - data
        - signature
      properties:
        txType:
          type: string
          enum:
            - evmTransactionSign
        data:
          type: string
          description: >-
            JSON string of an unsigned Tron transaction (TronWeb `raw_data`
            shape)
        signature:
          type: string
          description: Hex-encoded signature from TronLink or compatible Tron wallet
    EvmSignTypedDataExecution:
      type: object
      required:
        - txType
        - data
        - signature
      properties:
        txType:
          type: string
          enum:
            - evmSignTypedData
        data:
          description: >-
            EIP-712 typed data to sign. Accepted as either a JSON string (same
            format returned by `GET /getAction`) or a parsed object — both are
            equivalent.
          oneOf:
            - type: string
              description: JSON-encoded EIP-712 typed data
            - $ref: '#/components/schemas/Eip712Data'
        signature:
          type: string
          description: Hex-encoded EIP-712 signature
    Eip712Data:
      type: object
      required:
        - domain
        - types
        - message
      properties:
        domain:
          $ref: '#/components/schemas/Eip712Domain'
        types:
          type: object
          description: EIP-712 type definitions (field name → array of {name, type} pairs)
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                type:
                  type: string
        message:
          type: object
          description: The typed data message payload
          additionalProperties: true
    Eip712Domain:
      type: object
      required:
        - name
        - version
        - chainId
        - verifyingContract
      properties:
        name:
          type: string
          description: EIP-712 domain name
        version:
          type: string
          description: EIP-712 domain version
        chainId:
          type: integer
          description: Chain ID the typed data is bound to
        verifyingContract:
          type: string
          description: Address of the contract verifying the signature
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````