> ## 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 the new [Transaction](/api-basics/data-models#transaction). Its `status` is the lifecycle source of truth.

<ResponseField name="id" type="string">
  Transaction ID. Use it with [Retrieve Transaction](/transactions/retrieve-transaction) to track status.
</ResponseField>

<ResponseField name="orgId" type="string">
  Organization that owns the transaction.
</ResponseField>

<ResponseField name="vaultId" type="string">
  Vault the transaction runs from.
</ResponseField>

<ResponseField name="status" type="string">
  Lifecycle status. Track it until `COMPLETED`, `FAILED`, or `DECLINED`. See [TransactionStatus](/api-basics/data-models#transactionstatus).
</ResponseField>

<ResponseField name="transactionType" type="string">
  See [TransactionType](/api-basics/data-models#transactiontype).
</ResponseField>

<ResponseField name="category" type="string">
  For example `TRANSFER` or `CONTRACT_CALL`. See [TransactionCategory](/api-basics/data-models#transactioncategory).
</ResponseField>

<ResponseField name="subCategory" type="string">
  See [TransactionSubCategory](/api-basics/data-models#transactionsubcategory).
</ResponseField>

<ResponseField name="createdAt" type="string">
  Creation timestamp (ISO 8601).
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp (ISO 8601).
</ResponseField>

<ResponseField name="isDeleted" type="boolean">
  Whether the transaction is deleted.
</ResponseField>

<ResponseField name="externalId" type="string">
  Your own reference, if you set one.
</ResponseField>

<ResponseField name="memo" type="string">
  Memo you attached, if any.
</ResponseField>

<ResponseField name="source" type="TransferPartyData">
  Where the funds come from. Which fields are present depends on `type`. See [TransferPartyData](/api-basics/data-models#transferpartydata).

  <Expandable title="Properties">
    <ResponseField name="type" type="string">
      `VAULT`, `BANK_ACCOUNT`, `CONTACT`, `EXTERNAL_ADDRESS`, or `EXTERNAL_BANK_ACCOUNT`.
    </ResponseField>

    <ResponseField name="id" type="string">
      ID of the vault, bank account, or contact.
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name.
    </ResponseField>

    <ResponseField name="address" type="string">
      Wallet address, for crypto parties.
    </ResponseField>

    <ResponseField name="chain" type="string">
      Blockchain, for crypto parties.
    </ResponseField>

    <ResponseField name="paymentRail" type="string">
      Payment rail, for bank parties, such as `ACH`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="blockChain" type="string">
  Chain the transaction runs on.
</ResponseField>

<ResponseField name="asset" type="string">
  Asset moved.
</ResponseField>

<ResponseField name="amount" type="string">
  Amount as a decimal string.
</ResponseField>

## 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 dropdown>
  ```json Response 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"
  }
  ```

  ```typescript JavaScript SDK theme={null}
  interface Transaction {
    id: string;
    orgId: string;
    vaultId: string;
    status: TransactionStatus | string;
    transactionType: TransactionType | string;
    category: TransactionCategory | string;
    subCategory: TransactionSubCategory | string;
    createdAt: string;
    updatedAt: string;
    isDeleted: boolean;
    amount: string;

    txHash?: string;
    error?: string;
    externalId?: string;
    createdById?: string;
    fees?: Fees;
    memo?: string;
    txnSignature?: string;
    txnSignatureData?: Record<string, unknown>;
    output?: TransactionOutput;
    amountInUSD?: string;
    nonce?: number;
    dAppId?: string;
    source?: TransferPartyData;
    destination?: TransferPartyData;
    quoteResponse?: QuoteResponseItem;
    depositInstructions?: DepositInstructions;
    operations?: TransactionOperation[];
    balanceChanges?: TransactionOperationBalanceChanges | null;
    blockChain?: string;
    asset?: string;

    /** Deprecated: use destination.address. */
    toAddress?: string;
    /** Deprecated: use destination.name. */
    toAddressName?: string;
    /** Deprecated: use destination.id. */
    toVaultId?: string;
    /** Deprecated: use source.address. */
    sourceAddress?: string;
  }
  ```
</ResponseExample>


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