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

# Stake a Resource

> Stake an asset from a vault to obtain a chain resource, such as staking TRX on TRON for energy or bandwidth.

**POST** `/api/external/transactions/`

Use staking for chain-level protocol actions. These transactions can have chain-specific data requirements and may require approval before broadcast.

## Request body

<ParamField body="source" type="TransferPartyData" required>
  Vault that stakes the asset.
</ParamField>

<ParamField body="asset" type="string" required>
  Asset symbol.
</ParamField>

<ParamField body="blockChain" type="string" required>
  Blockchain identifier.
</ParamField>

<ParamField body="amount" type="string" required>
  Decimal amount to stake.
</ParamField>

<ParamField body="resourceType" type="string">
  One of `TRON_ENERGY` or `TRON_BANDWIDTH`.
</ParamField>

<ParamField body="category" type="string" required>
  Must be `"STAKE"`.
</ParamField>

<ParamField body="externalId" type="string">
  Client reference.
</ParamField>

<ParamField body="memo" type="string">
  Human-readable note.
</ParamField>

<Note>
  The SDK accepts `chain` and serializes it as `blockChain`. It injects `category: "STAKE"`.
</Note>

## Response

Returns a [Transaction](/api-basics/data-models#transaction). Its `status` is the lifecycle source of truth.

## Approve the transaction

New transactions return `status: "PENDING"` and wait for approval. [Get the approval message](/approvals/get-approval-message) for the transaction `id`, sign it with your API user's key, then [submit the approval](/approvals/submit-approval-action). See [Approvals](/approvals/overview).

With the SDK, call `approveChangeRequest({ entityId: transaction.id, action: "approve" })` after this call.

<RequestExample dropdown>
  ```json Request example theme={null}
  {
    "source": {
      "type": "VAULT",
      "id": "vault_123"
    },
    "asset": "TRX",
    "blockChain": "TRON",
    "amount": "1000",
    "resourceType": "TRON_ENERGY",
    "category": "STAKE",
    "externalId": "stake-1001",
    "memo": "Stake TRX for energy"
  }
  ```

  ```bash cURL theme={null}
  # Sample only. Generate a new signed token for each request
  # (see Authentication). Tokens expire after 120 seconds.
  curl --request POST \
    --url "https://api.primevault.com/api/external/transactions/" \
    --header "Authorization: Bearer <signed JWT>" \
    --header "Api-Key: <API key>" \
    --header "Content-Type: application/json" \
    --data '{
      "source": { "type": "VAULT", "id": "vault_123" },
      "asset": "TRX",
      "blockChain": "TRON",
      "amount": "1000",
      "resourceType": "TRON_ENERGY",
      "category": "STAKE",
      "externalId": "stake-1001",
      "memo": "Stake TRX for energy"
    }'
  ```

  ```typescript JavaScript SDK theme={null}
  const tx = await apiClient.stakeResource({
    source: { type: "VAULT", id: "vault_123" },
    asset: "TRX",
    chain: "TRON",
    amount: "1000",
    resourceType: "TRON_ENERGY",
    externalId: "stake-1001",
    memo: "Stake TRX for energy",
  });
  console.log(tx.id, tx.status);
  ```
</RequestExample>

<ResponseExample>
  ```json JSON example theme={null}
  {
    "id": "transaction_stake_123",
    "orgId": "org_456",
    "vaultId": "vault_123",
    "status": "PENDING",
    "transactionType": "OUTGOING",
    "category": "STAKE",
    "subCategory": "STAKE",
    "createdAt": "2026-08-04T11:40:00Z",
    "updatedAt": "2026-08-04T11:40:00Z",
    "isDeleted": false,
    "externalId": "stake-1001",
    "memo": "Stake TRX for energy",
    "source": {
      "type": "VAULT",
      "id": "vault_123",
      "name": "Treasury Vault"
    },
    "blockChain": "TRON",
    "asset": "TRX",
    "amount": "1000"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.