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

# get_transaction

> <RpcMethod

`SEP-6` `SEP-24` `SEP-31`

Retrieve a transaction by its ID.

## Params (1)

> [!TIP]
>
> Please note that parameter structure within the request must contain named parameters as a by-name object, and not as positional arguments in a by-position array

**id** `string` *required*

The unique identifier of this transaction.

A unique transaction identifier.

## Result

*(get\_transactionResponse)*

**id** `string`

A unique transaction identifier.

**sep** `integer`

Protocol of the transaction.

Available options: `6`, `24`, `31`

**kind** `string`

The kind of transaction that is desired.

Available options: `undefined`, `receive`, `deposit`, `deposit-exchange`, `withdrawal`, `withdrawal-exchange`

**status** `string`

Processing status of the transaction.

Available options: `pending_anchor`, `pending_trust`, `pending_user`, `pending_user_transfer_start`, `pending_user_transfer_complete`, `incomplete`, `no_market`, `too_small`, `too_large`, `pending_sender`, `pending_receiver`, `pending_transaction_info_update`, `pending_customer_info_update`, `completed`, `refunded`, `expired`, `error`, `pending_external`, `pending_stellar`

**funding\_method** `string`

Funding method used for transferring or settling assets.

**type** `string`

DEPRECATED in favor of funding\_method. Type of deposit, withdrawal or receive.

**amount\_expected** `object`

The amount expected in the payment.

**properties**

**amount** `string`

A stringified amount of an asset.

**asset** `string`

An asset.

**amount\_in** `object`

Amount expected/received by anchor.

**properties**

**amount** `string`

A stringified amount of an asset.

**asset** `string`

An asset.

**amount\_out** `object`

The amount expected to be sent by anchor to user at end of transaction.

**properties**

**amount** `string`

A stringified amount of an asset.

**asset** `string`

An asset.

**fee\_details** `object`

Description of fee charged by the anchor.

**properties**

**total** `number` *required*

**asset** `string` *required*

**details** `object[]`

Details about fee charged.

**items**

**name** `string`

**description** `string`

**amount** `number`

**quote\_id** `string`

The id returned from a SEP-38 POST /quote response

**started\_at** `string`

Start date and time of transaction.

**updated\_at** `string`

The date and time of transaction reaching the current status.

**completed\_at** `string`

The date and time of transaction reaching completed or refunded status.

**transfer\_received\_at** `string`

The date and time of receiving transfer.

**user\_action\_required\_by** `string`

Time and date by which user action is required.

**message** `string`

Human readable explanation of transaction status

**refunds** `object`

An object describing any on or offchain refund associated with this transaction.

**properties**

**amount\_refunded** `object`

The total amount refunded in units of amount\_in\_asset.

**properties**

**amount** `string`

A numerical representation of an amount of some asset.

**asset** `string`

An asset.

**amount\_fee** `object`

The total amount charged in fees for processing all refund payments, in units of amount\_in\_asset.

**properties**

**amount** `string`

A numerical representation of an amount of some asset.

**asset** `string`

An asset.

**payments** `object[]`

A list of objects containing information on the individual payments made back as refunds.

**items**

**id** `string`

The Stellar transaction hash.

**id\_type** `string`

**amount** `object`

The amount sent back for the payment identified by id, in units of amount\_in\_asset.

**properties**

**amount** `string`

A numerical representation of an amount of some asset.

**asset** `string`

An asset.

**fee** `object`

The amount charged as a fee for processing the refund, in units of amount\_in\_asset.

**properties**

**amount** `string`

A numerical representation of an amount of some asset.

**asset** `string`

An asset.

**requested\_at** `string`

The date and time of requesting refund.

**refunded\_at** `string`

The date and time of making refund.

**stellar\_transactions** `object[]`

**items**

**id** `string` *required*

The Stellar transaction hash.

**memo** `string`

**memo\_type** `string`

The memo type of the transaction in the Stellar network. Should be present if memo is not null.

Available options: `id`, `hash`, `text`

**created\_at** `string` *required*

The date and time when the transaction is created.

**envelop** `string`

The transaction envelope, containing all the transaction information.

**payments** `object[]` *required*

**items**

**id** `string` *required*

The ID of the payment in the Stellar Network.

**payment\_type** `string` *required*

The ID of the payment in the Stellar Network.

Available options: `payment`, `path_payment`

Default: `"payment"`

**source\_account** `string` *required*

The account being debited in the Stellar Network.

**destination\_account** `string` *required*

The account being credited in the Stellar Network.

**amount** `object` *required*

**properties**

**amount** `string`

A stringified amount of an asset.

**asset** `string`

An asset.

**source\_account** `string`

The account being debited in the Stellar Network.

**destination\_account** `string`

The account being credited in the Stellar Network.

**external\_transaction\_id** `string`

A unique transaction identifier.

**memo** `string`

**memo\_type** `string`

The memo type of the transaction in the Stellar network. Should be present if memo is not null.

Available options: `id`, `hash`, `text`

**refund\_memo** `string`

**refund\_memo\_type** `string`

The memo type of the transaction in the Stellar network. Should be present if memo is not null.

Available options: `id`, `hash`, `text`

**client\_domain** `string`

The domain of the client.

**request\_client\_ip\_address** `string`

The IP address of the client requesting the transaction.

**customers** `object`

The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md), this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.

**properties**

**sender** `object`

A object that identify end-user.
For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.
For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.
For a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.

**properties**

**id** `string`

The `id` of the customer registered through SEP-12.

**account** `string`

Either the Stellar account or Muxed account address of the on-chain entity.

**memo** `string`

The memo value identifying a customer with a shared account, where the shared account is `account`.

**receiver** `object`

A object that identify end-user.
For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.
For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.
For a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.

**properties**

**id** `string`

The `id` of the customer registered through SEP-12.

**account** `string`

Either the Stellar account or Muxed account address of the on-chain entity.

**memo** `string`

The memo value identifying a customer with a shared account, where the shared account is `account`.

**creator** `object`

A object that identify end-user. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. For a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.

**properties**

**id** `string`

The `id` of the customer registered through SEP-12.

**account** `string`

Either the Stellar account or Muxed account address of the on-chain entity.

**memo** `string`

The memo value identifying a customer with a shared account, where the shared account is `account`.

## Example

Example request to the `get_transaction` method.

**Request**

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "get_transaction",
  "params": {
    "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d"
  }
}' \
https://platform-server.exampleanchor.com | jq
```

```js JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
let requestBody = {
  jsonrpc: "2.0",
  id: 8675309,
  method: "get_transaction",
  params: {
    id: "1c186184-09ee-486c-82a7-aa7a0ab1119d",
  },
};
let res = await fetch("https://platform-server.exampleanchor.com", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify(requestBody),
});
let json = await res.json();
console.log(json);
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import json, requests
res = requests.post("https://platform-server.exampleanchor.com", json={
    "jsonrpc": "2.0",
    "id": 8675309,
    "method": "get_transaction",
    "params": {
        "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d"
    }
})
print(json.dumps(res.json(), indent=4))
```

```json JSON theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "get_transaction",
  "params": {
    "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d"
  }
}
```

**Result**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "jsonrpc": "2.0",
  "id": 8675309,
  "result": {
    "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d",
    "sep": "31",
    "kind": "receive",
    "status": "completed",
    "funding_method": "SWIFT",
    "amount_expected": {
      "amount": "100",
      "asset": "iso4217:USD"
    },
    "amount_in": {
      "amount": "100.0000",
      "asset": "iso4217:USD"
    },
    "amount_out": {
      "amount": "98.0000000",
      "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
    },
    "fee_details": {
      "total": "2.0000",
      "asset": "iso4217:USD"
    },
    "quote_id": "quote-id",
    "message": "Please don't forget to foo bar",
    "refunds": {
      "amount_refunded": {
        "amount": "90.0000",
        "asset": "iso4217:USD"
      },
      "amount_fee": {
        "amount": "8.0000",
        "asset": "iso4217:USD"
      },
      "payments": [
        {
          "id": "1111",
          "id_type": "stellar",
          "amount": {
            "amount": "50.0000",
            "asset": "iso4217:USD"
          },
          "fee": {
            "amount": "4.0000",
            "asset": "iso4217:USD"
          }
        },
        {
          "id": "2222",
          "id_type": "stellar",
          "amount": {
            "amount": "40.0000",
            "asset": "iso4217:USD"
          },
          "fee": {
            "amount": "4.0000",
            "asset": "iso4217:USD"
          }
        }
      ]
    },
    "stellar_transactions": [
      {
        "id": "stellar-tx-id",
        "memo": "my-memo",
        "memo_type": "text",
        "envelope": "here_comes_the_envelope",
        "payments": [
          {
            "id": "payment-id",
            "amount": {
              "amount": "100.0000",
              "asset": "iso4217:USD"
            },
            "payment_type": "payment",
            "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL",
            "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC"
          }
        ]
      }
    ],
    "external_transaction_id": "external-tx-id",
    "customers": {
      "sender": {
        "id": "sender-id"
      },
      "receiver": {
        "id": "receiver-id"
      }
    },
    "creator": {
      "id": "creator-id"
    }
  }
}
```
