Withdrawal

The withdrawal process in the SUI network using the Staking API can be done following these steps:

  1. Get the list of stakes for your wallet.
  2. Use the stakeId from the active or pending stake to initiate withdrawal.
  3. Sign and send the transaction to the SUI network.
  4. Confirm completion via explorer.

After each operation, you need to sign and send the transaction to the SUI network.

You can withdraw at any time while the stake status is either Pending or Active.
The withdrawal is immediate and processed within seconds.

1. Get Stake ID

Before withdrawing, identify which stake you want to withdraw.

See: Getting Started → Get Stake Status

The response will include one or more objects like:

{
  "stakeId": "0x5d920b8fca6a6043d898ab1a9a8ab167d8aa323fe2b9e76a27312f7f16e20a67",
  "amount": 1000000000,
  "status": "Pending"
}

Copy the stakeId to use in the next step.

2. Create Withdrawal Transaction

Send a POST request to /api/v1/sui/<network>/staking/withdraw

Example response:

curl --request
	 	 --url 'https://api-test.p2p.org/api/v1/sui/testnet/staking/withdraw' \
 		 --header 'Authorization: Bearer <token>' \
		 --header 'Content-Type: application/json' \
		 --data '{
  		 "sender": "0x696f4402d7151fb49e52b629de3ce3098f3dda7721a7425c000b4f26653709e3",
  		 "gasPrice": 1000,
  		 "gasBudget": 10000000,
  		 "stakeId": "0x5d920b8fca6a6043d898ab1a9a8ab167d8aa323fe2b9e76a27312f7f16e20a67"
		 }'
  • sender — your SUI wallet address.
  • gasPrice — gas price in MIST.
  • gasBudget — maximum gas budget.
  • stakeId — identifier of the stake to withdraw (retrieved from stake-list).

Example response:

{
  "error": null,
  "result": {
    "unsignedTransaction": "0x00000201010000000000000000000000000000..."
  }
}

You will receive a serialized unsigned transaction in the unsignedTransaction field. This must be signed and sent to the SUI network.

3. Sign and Send Transaction

Sign and broadcast the transaction using your local signer or SDK.

See: Sign and Send Transaction

Example broadcasted transaction:
https://suiscan.xyz/testnet/tx/DiXajfAeTLVhiQZuW8aH2UD1XsCEoZVH4twRC5PjeK5

What's Next?