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

# Set a reference ID

<Warning>
  The following functionality exists for [wallets reconstituted
  server-side](/wallets/wallets/create/create-a-wallet). More on [Privy architecture
  here](/security/wallet-infrastructure/architecture)
</Warning>

A `reference_id` is an optional, developer-provided identifier that can be attached to a transaction for reconciliation
with your own internal records. It must be unique per transaction and can be up to 64 characters.

The `reference_id` is included in all transaction payloads, including [webhook events](/wallets/gas-and-asset-management/assets/transaction-event-webhooks), and can be used to [fetch a transaction by its reference ID](/api-reference/transactions/external-id).

## Supported methods

The `reference_id` parameter is supported on the following RPC methods:

* [`eth_sendTransaction`](/api-reference/wallets/ethereum/eth-send-transaction) for EVM chains
* [`signAndSendTransaction`](/api-reference/wallets/solana/sign-and-send-transaction) for Solana

Pass the `reference_id` field in the request body when calling either method.

<Tabs>
  <Tab title="EVM">
    ```bash theme={"system"}
    curl --request POST \
      --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
      --header 'Authorization: Basic <encoded-value>' \
      --header 'Content-Type: application/json' \
      --header 'privy-app-id: <privy-app-id>' \
      --data '{
      "method": "eth_sendTransaction",
      "caip2": "eip155:8453",
      "chain_type": "ethereum",
      "reference_id": "order-abc-123",
      "params": {
        "transaction": {
          "to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
          "value": "0x2386F26FC10000"
        }
      }
    }'
    ```
  </Tab>

  <Tab title="Solana">
    ```bash theme={"system"}
    curl --request POST \
      --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
      --header 'Authorization: Basic <encoded-value>' \
      --header 'Content-Type: application/json' \
      --header 'privy-app-id: <privy-app-id>' \
      --data '{
      "method": "signAndSendTransaction",
      "caip2": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "reference_id": "order-abc-123",
      "params": {
        "transaction": "<base64-encoded-transaction>",
        "encoding": "base64"
      }
    }'
    ```
  </Tab>
</Tabs>

## Looking up transactions by reference ID

Once a `reference_id` has been set, your app can look up the associated transaction using the
[get transaction by reference ID](/api-reference/transactions/external-id) endpoint:

```bash theme={"system"}
curl --request GET \
  --url 'https://api.privy.io/v1/transactions?reference_id=order-abc-123' \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'privy-app-id: <privy-app-id>'
```

Your app can also retrieve the transaction directly by its Privy-assigned ID using the
[get transaction](/api-reference/transactions/get) endpoint. The `reference_id` is included in the response.

## Webhooks

All [transaction webhook events](/wallets/gas-and-asset-management/assets/transaction-event-webhooks) include the `reference_id` field
in their payload when one was provided. See the individual webhook event references for the full payload schema:

* [Transaction broadcasted](/api-reference/webhooks/transaction/broadcasted)
* [Transaction confirmed](/api-reference/webhooks/transaction/confirmed)
* [Transaction still pending](/api-reference/webhooks/transaction/still_pending)
* [Transaction execution reverted](/api-reference/webhooks/transaction/execution_reverted)
* [Transaction replaced](/api-reference/webhooks/transaction/replaced)
* [Transaction failed](/api-reference/webhooks/transaction/failed)
* [Transaction provider error](/api-reference/webhooks/transaction/provider_error)

This allows your app to match incoming webhook notifications to your internal records without an additional API call.
