> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-sync-security-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# broadcast_tx_commit

> Returns with the responses from CheckTx and DeliverTx.

IMPORTANT: use only for testing and development. In production, use
BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction
result using JSONRPC via a websocket. See
https://docs.cosmos.network/cometbft/v0.38/docs/core/Subscribing-to-events-via-Websocket

CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout
waiting for tx to commit.

If CheckTx or DeliverTx fail, no error will be returned, but the returned result
will contain a non-OK ABCI code.

Please refer to [formatting/encoding rules](https://docs.cosmos.network/cometbft/v0.38/docs/core/Using-CometBFT#formatting)
for additional details



## OpenAPI

````yaml /cometbft/latest/api-reference/rpc/openapi.yaml get /broadcast_tx_commit
openapi: 3.0.0
info:
  title: CometBFT RPC
  contact:
    name: CometBFT
    url: https://docs.cosmos.network/cometbft
  description: >
    CometBFT supports the following RPC protocols:


    * URI over HTTP

    * JSONRPC over HTTP

    * JSONRPC over websockets


    ## Configuration


    RPC can be configured by tuning parameters under `[rpc]` table in the

    `$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line

    flags.


    The default RPC listen address is `tcp://127.0.0.1:26657`.

    To set another address, set the `laddr` config parameter to desired value.

    CORS (Cross-Origin Resource Sharing) can be enabled by setting

    `cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`

    config parameters.


    If testing using a local RPC node, under the `[rpc]`

    section change the `cors_allowed_origins` property, please add the URL of

    the site where this OpenAPI document is running, for example:

      `cors_allowed_origins = ["http://localhost:8088"]`

    or if testing from the official documentation site:

      `cors_allowed_origins = ["https://docs.cosmos.network"]`

    ## Arguments


    Arguments which expect strings or byte arrays may be passed as quoted

    strings, like `"abc"` or as `0x`-prefixed strings, like `0x616263`.


    ## URI/HTTP


    A REST like interface.

        curl localhost:26657/block?height=5

    ## JSONRPC/HTTP


    JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.

        curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657

    ## JSONRPC/websockets


    JSONRPC requests can be also made via websocket.

    The websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.

    Asynchronous RPC functions like event `subscribe` and `unsubscribe` are

    only available via websockets.


    For example using the [websocat](https://github.com/vi/websocat) tool, you
    can subscribe for 'NewBlock` events

    with the following command:

        echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket
  version: v0.38.x
  license:
    name: Apache 2.0
    url: https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE
servers:
  - url: https://rpc.cosmos.directory/cosmoshub
    description: Interact with the CometBFT RPC from a public node in the Cosmos registry
  - url: http://localhost:26657
    description: Interact with CometBFT RPC node running locally
security: []
tags:
  - name: Info
    description: Informations about the node APIs
  - name: Tx
    description: Transactions broadcast APIs
  - name: ABCI
    description: ABCI APIs
  - name: Evidence
    description: Evidence APIs
  - name: Unsafe
    description: Unsafe APIs
paths:
  /broadcast_tx_commit:
    get:
      tags:
        - Tx
      summary: broadcast_tx_commit
      description: >-
        Returns with the responses from CheckTx and DeliverTx.


        IMPORTANT: use only for testing and development. In production, use

        BroadcastTxSync or BroadcastTxAsync. You can subscribe for the
        transaction

        result using JSONRPC via a websocket. See

        https://docs.cosmos.network/cometbft/v0.38/docs/core/Subscribing-to-events-via-Websocket


        CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout

        waiting for tx to commit.


        If CheckTx or DeliverTx fail, no error will be returned, but the
        returned result

        will contain a non-OK ABCI code.


        Please refer to [formatting/encoding
        rules](https://docs.cosmos.network/cometbft/v0.38/docs/core/Using-CometBFT#formatting)

        for additional details
      operationId: broadcast_tx_commit
      parameters:
        - in: query
          name: tx
          required: true
          schema:
            type: string
            example: '785'
          description: The transaction
      responses:
        '200':
          description: empty answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BroadcastTxCommitResponse'
        '500':
          description: empty error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BroadcastTxCommitResponse:
      type: object
      required:
        - error
        - result
        - id
        - jsonrpc
      properties:
        error:
          type: string
          example: ''
        result:
          required:
            - height
            - hash
            - deliver_tx
            - check_tx
          properties:
            height:
              type: string
              example: '26682'
            hash:
              type: string
              example: 75CA0F856A4DA078FC4911580360E70CEFB2EBEE
            deliver_tx:
              required:
                - log
                - data
                - code
              properties:
                log:
                  type: string
                  example: ''
                data:
                  type: string
                  example: ''
                code:
                  type: string
                  example: '0'
              type: object
            check_tx:
              required:
                - log
                - data
                - code
              properties:
                log:
                  type: string
                  example: ''
                data:
                  type: string
                  example: ''
                code:
                  type: string
                  example: '0'
              type: object
          type: object
        id:
          type: integer
          example: 0
        jsonrpc:
          type: string
          example: '2.0'
    ErrorResponse:
      description: Error Response
      allOf:
        - $ref: '#/components/schemas/JSONRPC'
        - type: object
          properties:
            error:
              type: string
              example: Description of failure
    JSONRPC:
      type: object
      properties:
        id:
          type: integer
          example: 0
        jsonrpc:
          type: string
          example: '2.0'

````