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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/ecosystem/api/toncenter/v2/transactions/try-locate-source-transaction",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Try locate source transaction

> Finds the transaction that sent a specific message. Given message parameters, returns the transaction on the source account that created this outgoing message. Useful for tracing where a message originated from.



## OpenAPI

````yaml get /api/v2/tryLocateSourceTx
openapi: 3.1.1
info:
  title: TON HTTP API C++
  description: >
    This API enables HTTP access to TON blockchain - getting accounts and
    wallets information, looking up blocks and transactions, sending messages to
    the blockchain, calling get methods of smart contracts, and more.


    In addition to REST API, all methods are available through a JSON-RPC
    endpoint  with `method` equal to method name and `params` passed as a
    dictionary.


    The response contains a JSON object, which always has a boolean field `ok`
    and either `error` or `result`. If `ok` equals true, the request was
    successful and the result of the query can be found in the `result` field.
    In case of an unsuccessful request, `ok` equals false and the error is
    explained in the `error`.


    API Key should be sent either as `api_key` query parameter or `X-API-Key`
    header
  version: 2.1.1
servers:
  - url: https://toncenter.com
    description: TON Mainnet
  - url: https://testnet.toncenter.com
    description: TON Testnet
security: []
tags:
  - name: Accounts
    description: Information about accounts
  - name: Transactions
    description: Fetching and locating transactions
  - name: Blocks
    description: Information about blocks
  - name: Run method
    description: Run get-method of smart contracts
  - name: Send
    description: Send data to blockchain
  - name: Utils
    description: Some useful methods
  - name: Configuration
    description: Information about blockchain config
  - name: RPC
    description: JSON-RPC and POST endpoints
paths:
  /api/v2/tryLocateSourceTx:
    get:
      tags:
        - Transactions
      summary: Try locate source transaction
      description: >-
        Finds the transaction that sent a specific message. Given message
        parameters, returns the transaction on the source account that created
        this outgoing message. Useful for tracing where a message originated
        from.
      operationId: tryLocateSourceTx_get
      parameters:
        - $ref: '#/components/parameters/sourceAddress'
        - $ref: '#/components/parameters/destinationAddress'
        - $ref: '#/components/parameters/createdLt'
      responses:
        '200':
          description: >-
            Returns the originating transaction on the source account for the
            given message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocateSourceTxResponse'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422_locate'
        '429':
          $ref: '#/components/responses/429'
        '504':
          $ref: '#/components/responses/504'
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
components:
  parameters:
    sourceAddress:
      name: source
      in: query
      required: true
      schema:
        $ref: '#/components/schemas/TonAddr'
      description: Source account address.
    destinationAddress:
      name: destination
      in: query
      required: true
      schema:
        $ref: '#/components/schemas/TonAddr'
      description: Destination account address.
    createdLt:
      name: created_lt
      in: query
      description: >-
        The logical time when the message was created. Available in the
        `created_lt` field of message objects.
      required: true
      schema:
        type: string
        x-usrv-cpp-type: std::int64_t
  schemas:
    LocateSourceTxResponse:
      type: object
      additionalProperties: false
      required:
        - ok
        - result
      properties:
        ok:
          type: boolean
          default: true
          description: >-
            Returns `true` if the request succeeded; otherwise `false`. See the
            `error` field for details.
        result:
          $ref: '#/components/schemas/Transaction'
          description: Response data. Present only when `ok` is `true`.
        '@extra':
          type: string
          description: >-
            Optional request ID that can be passed in the request and received
            back in the response. Useful for matching async responses.
    TonAddr:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_addr
      description: >-
        Account address in [raw](/foundations/addresses/formats#raw-format)
        format (e.g., `0:ca6e321c...`) or
        [user-friendly](/foundations/addresses/formats#user-friendly-format)
        format (e.g., `EQDKbjIcfM...`). All formats are automatically detected.
    Transaction:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - ext.transaction
          default: ext.transaction
          description: >-
            TonLib type identifier for extended transaction objects with decoded
            messages. Refer to the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        address:
          $ref: '#/components/schemas/AccountAddress'
          description: Account address object for this transaction.
        account:
          $ref: '#/components/schemas/TonAddr'
          description: Account address in raw format.
        utime:
          type: integer
          description: Unix timestamp when this transaction was executed.
        data:
          $ref: '#/components/schemas/Bytes'
          description: Full transaction data serialized as BoC, base64 encoded.
        transaction_id:
          $ref: '#/components/schemas/InternalTransactionId'
          description: >-
            The transaction identifier, represented by logical time and
            transaction hash.
        fee:
          $ref: '#/components/schemas/Int256'
          description: Total fees paid for this transaction, in nanotons.
        storage_fee:
          $ref: '#/components/schemas/Int256'
          description: >-
            Storage fees in nanotons deducted from the account balance during
            the storage phase of this transaction. Covers the cost of storing
            the contract state on-chain since the last transaction.
        other_fee:
          $ref: '#/components/schemas/Int256'
          description: >-
            Fees in nanotons deducted from the account balance during the
            computation and action phases of this transaction. Covers the cost
            of TVM execution and processing outgoing messages.
        in_msg:
          $ref: '#/components/schemas/Message'
          description: The inbound message that triggered this transaction.
        out_msgs:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          description: >-
            Array of outbound messages produced by this transaction. Each
            message contains sender, recipient, TON amount (nanotons as string),
            forwarding fee, message body, and optional decoded text comment.
      required:
        - '@type'
        - address
        - account
        - utime
        - data
        - transaction_id
        - fee
        - storage_fee
        - other_fee
        - out_msgs
    AccountAddress:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - accountAddress
          default: accountAddress
          description: >-
            TonLib type identifier for account address objects. Refer to the
            [TonLib type reference](/ecosystem/api/toncenter/v2-tonlib-types)
            for a full list.
        account_address:
          type: string
          x-usrv-cpp-type: ton_http::types::ton_addr
          description: >-
            The account address in raw format (`workchain:hex`), e.g.
            `0:abc123...`. Use the [pack
            address](/ecosystem/api/toncenter/v2/utils/pack-address) endpoint to
            convert to user-friendly base64 format.
    Bytes:
      type: string
      x-usrv-cpp-type: ton_http::types::bytes
      description: >-
        Binary data encoded as base64. Used for serialized cells (BoC format),
        message bodies, and smart contract code/data.
    InternalTransactionId:
      type: object
      additionalProperties: false
      description: >-
        A reference to a specific transaction. The combination of `lt` (logical
        time) and `hash` uniquely identifies any transaction. Use these values
        for pagination and lookups.
      properties:
        '@type':
          type: string
          enum:
            - internal.transactionId
          default: internal.transactionId
          description: >-
            TonLib type identifier for transaction ID references. Refer to the
            [TonLib type reference](/ecosystem/api/toncenter/v2-tonlib-types)
            for a full list.
        lt:
          type: string
          description: >-
            Logical time of this transaction. A globally unique counter that
            orders all events on the blockchain.
          x-usrv-cpp-type: std::int64_t
        hash:
          $ref: '#/components/schemas/TonHash'
          description: SHA-256 hash of this transaction, encoded in base64.
      required:
        - '@type'
        - lt
        - hash
    Int256:
      type: string
      x-usrv-cpp-type: ton_http::types::int256
      description: >-
        A large integer represented as a string to avoid precision loss. Used
        for balances and other values that may exceed JavaScript's safe integer
        limit.
    Message:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - ext.message
          default: ext.message
          description: >-
            TonLib type identifier for extended message objects with decoded
            comments. Refer to the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        hash:
          $ref: '#/components/schemas/TonHash'
          description: SHA-256 hash of this message, encoded in base64.
        source:
          $ref: '#/components/schemas/TonAddr'
          description: Sender address. Empty for external inbound messages.
        destination:
          $ref: '#/components/schemas/TonAddr'
          description: Recipient address.
        value:
          $ref: '#/components/schemas/Int256'
          description: TON amount transferred with this message, in nanotons.
        extra_currencies:
          type: array
          items:
            $ref: '#/components/schemas/ExtraCurrencyBalance'
          description: >-
            Array of extra currencies (native blockchain-level tokens, distinct
            from Jettons) transferred in this message. Each entry contains a
            currency ID (integer) and amount (decimal string). Empty array if no
            extra currencies were transferred.
        fwd_fee:
          $ref: '#/components/schemas/Int256'
          description: Forwarding fee deducted from the message value, in nanotons.
        ihr_fee:
          $ref: '#/components/schemas/Int256'
          description: >-
            Instant Hypercube Routing (IHR) fee in nanotons. Always `0`. This is
            hardcoded at the protocol level and cannot be changed.
        created_lt:
          type: string
          description: Logical time when this message was created.
          x-usrv-cpp-type: std::int64_t
        body_hash:
          $ref: '#/components/schemas/TonHash'
          description: >-
            Hash of the message body. Useful for verifying content without the
            full payload.
        msg_data:
          $ref: '#/components/schemas/MsgData'
          description: Message body payload (raw, text comment, or encrypted).
        message:
          type: string
          description: >-
            Decoded UTF-8 text comment from the message body. Present only when
            the message body is a plain text comment (opcode `0x00000000`).
            Empty string otherwise.
        message_decode_error:
          type: string
          description: >-
            Error description if the message body could not be decoded as a text
            comment.
      required:
        - '@type'
        - hash
        - source
        - destination
        - value
        - extra_currencies
        - fwd_fee
        - ihr_fee
        - created_lt
        - body_hash
        - msg_data
      description: >-
        A message between accounts. Contains sender, recipient, TON amount
        transferred, and the message body. The `created_lt` field orders
        messages globally.
    TonHash:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_hash
      description: >-
        A 256-bit hash value. Accepts either hex format (64 characters) or
        base64 format (44 characters). Used for block hashes, transaction
        hashes, and cryptographic proofs.
    ExtraCurrencyBalance:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - extraCurrency
          default: extraCurrency
          description: >-
            TonLib type identifier for extra currency balance entries. Refer to
            the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        id:
          type: integer
          format: int32
          description: >-
            A 32-bit integer identifying the extra currency. Currency IDs are
            defined at the blockchain configuration level and stored in
            `ConfigParam 7` of the masterchain. Refer to the [extra currency
            minting
            documentation](https://docs.ton.org/v3/documentation/infra/minter-flow)
            for details.
        amount:
          $ref: '#/components/schemas/Int256'
          description: Currency balance amount as a decimal string.
      required:
        - '@type'
        - id
        - amount
    MsgData:
      oneOf:
        - $ref: '#/components/schemas/MsgDataRaw'
        - $ref: '#/components/schemas/MsgDataText'
        - $ref: '#/components/schemas/MsgDataDecryptedText'
        - $ref: '#/components/schemas/MsgDataEncryptedText'
      discriminator:
        propertyName: '@type'
        mapping:
          msg.dataRaw:
            $ref: '#/components/schemas/MsgDataRaw'
          msg.dataText:
            $ref: '#/components/schemas/MsgDataText'
          msg.dataDecryptedText:
            $ref: '#/components/schemas/MsgDataDecryptedText'
          msg.dataEncryptedText:
            $ref: '#/components/schemas/MsgDataEncryptedText'
    MsgDataRaw:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - msg.dataRaw
          default: msg.dataRaw
          description: >-
            TonLib type identifier for raw (binary) message bodies. Refer to the
            [TonLib type reference](/ecosystem/api/toncenter/v2-tonlib-types)
            for a full list.
        body:
          $ref: '#/components/schemas/Bytes'
          description: Raw message body in BoC format, base64 encoded.
        init_state:
          $ref: '#/components/schemas/Bytes'
          description: >-
            Contract init state (code + data) attached to this message, base64
            encoded. Present only for deploy messages.
    MsgDataText:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - msg.dataText
          default: msg.dataText
          description: >-
            TonLib type identifier for plain text comment message bodies. Refer
            to the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        text:
          $ref: '#/components/schemas/Bytes'
          description: UTF-8 text comment, base64 encoded.
    MsgDataDecryptedText:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - msg.dataDecryptedText
          default: msg.dataDecryptedText
          description: >-
            TonLib type identifier for decrypted text message bodies. Refer to
            the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        text:
          $ref: '#/components/schemas/Bytes'
          description: Decrypted UTF-8 text content, base64 encoded.
    MsgDataEncryptedText:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - msg.dataEncryptedText
          default: msg.dataEncryptedText
          description: >-
            TonLib type identifier for encrypted text message bodies. Refer to
            the [TonLib type
            reference](/ecosystem/api/toncenter/v2-tonlib-types) for a full
            list.
        text:
          $ref: '#/components/schemas/Bytes'
          description: Encrypted message payload, base64 encoded.
  responses:
    '401':
      description: API key does not exist. Check for typos or generate a new key.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 401
                description: HTTP status code `401`.
              error:
                type: string
                enum:
                  - API key does not exist
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 401
            error: API key does not exist
    '403':
      description: >-
        API key is not allowed for this network (e.g. testnet key used on
        mainnet).
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 403
                description: HTTP status code `403`.
              error:
                type: string
                enum:
                  - Network not allowed
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 403
            error: Network not allowed
    '404':
      description: Requested data not found.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 404
                description: HTTP status code `404`.
              error:
                type: string
                enum:
                  - transaction not found
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 404
            error: transaction not found
    '429':
      description: >-
        Rate limit exceeded. Back off and retry, or use an API key for higher
        limits.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 429
                description: HTTP status code `429`.
              error:
                type: string
                enum:
                  - Ratelimit exceeded
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 429
            error: Ratelimit exceeded
    '504':
      description: Timeout waiting for liteserver response.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 504
                description: HTTP status code `504`.
              error:
                type: string
                enum:
                  - LITE_SERVER_NETWORK timeout
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 504
            error: LITE_SERVER_NETWORK timeout
    422_locate:
      description: Invalid locate transaction parameters.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 422
                description: HTTP status code `422`.
              error:
                type: string
                enum:
                  - empty source address
                  - empty destination address
                  - failed to parse created_lt
                  - created_lt should be non-negative
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 422
            error: empty source address
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key header of the form `X-API-Key: <token>`, where `<token>` is the
        API key. Requests without a key are limited to 1 RPS. Refer to the
        [authentication guide](/ecosystem/api/toncenter/v2-authentication) for
        details.
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: >-
        API key query parameter of the form `?api_key=<token>`, where `<token>`
        is the API key. Equivalent to the header method. Refer to the
        [authentication guide](/ecosystem/api/toncenter/v2-authentication) for
        details.

````