Skip to main content

UnDelegate Resource

You need to start Delegate Resource $TRX before you can UnDelegate Resource BANDWIDTH or ENERGY from other accounts.

warning

You need to complete signing tx in 1 minute after tx generated

In the following guide we will illustrate how to undelegate bandwidth $TRX.

Step 1 - Initiate Flow

Endpoint : flow

Method : POST

Request

Body

  • service_code* - string : Service code, use service endpoint to get the service code.
  • flow* - string : The operation to perform undelegate.
  • callback_url - string : Your callback url endpoint to get update of state from our systems.
Request Sample
{
"service_code": "staking-tron",
"flow": "undelegate"
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • inquiry_id - string : ID For next Request Step Inquiry.
  • inquiry_identifier - string : Next step identifier name.
    • create-undelegate-tx : Next you need to assign the undelegate data within the tx creation.
  • state - string : Current state of your flow.
  • inputs - Array<Object> : Next step inputs.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success",
"data": {
"id": "9fc8c5f4-33d9-4ffc-96a5-83c13a84f934",
"service_code": "staking-tron",
"flow": "undelegate",
"inquiry_id": "57c967e6-c515-4df5-b441-8704374771ff",
"inquiry_identifier": "create-undelegate-tx",
"state": "initialized",
"inputs": [
{
"type": "string",
"name": "from_address",
"display": "From Address",
"description": "",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "string",
"name": "to_address",
"display": "To Address",
"description": "",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "string",
"name": "resource",
"display": "Resource",
"description": "",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "decimal",
"name": "amount",
"display": "Amount",
"description": "",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "numericality",
"options": {
"greater_than": "0"
}
}
],
"array": 0,
"default_val": null,
"visibility": 1
}
],
"data": {
"amount": "",
"callback_url": "",
"from_address": "",
"resource": "",
"signed_undelegate_tx": "",
"to_address": "",
"undelegate_tx": ""
},
"created_at": "2025-03-20T03:30:18Z",
"updated_at": "2025-03-20T03:30:18Z",
"expired_at": "2025-03-21T03:30:18Z"
}
}

Step 2 - Create UnDelegate Tx

Endpoint : flow/{:id}/next

Method : POST

Request

Body

  • inquiry_id* - string : Your inquiry id from step 1
  • data - object* : Wrapped data object
    • from_address* - string : Address which you want to use to undelegate resource.
    • to_address* - string : Recipient Address of resource.
    • amount* - float64 : Amount of $TRX resource you want to undelegate.
    • resource - string : The resource to undelegate $TRX, you can choose between BANDWIDTH or ENERGY.

Sample Endpoint Request : flow/9fc8c5f4-33d9-4ffc-96a5-83c13a84f934/next

Request Sample
{
"inquiry_id": "57c967e6-c515-4df5-b441-8704374771ff",
"data": {
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi",
"resource": "bandwidth",
"amount": 50
}
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • inquiry_id - string : ID For next Request Step Inquiry.
  • inquiry_identifier - string : Next step identifier name.
    • undelegate-sign : Signing and broadcast the undelegate tx.
  • state - string : Current state of your flow.
  • inputs - Array<Object> : Next step inputs.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success create data",
"data": {
"id": "ca89a5ed-22ff-41cc-aa35-1de63a3c7146",
"service_code": "staking-tron",
"flow": "undelegate",
"inquiry_id": "5dc8e84b-b373-480b-8162-9f5655305465",
"inquiry_identifier": "undelegate-sign",
"state": "initialized",
"inputs": [
{
"type": "string",
"name": "signed_undelegate_tx",
"display": "Signed Delegate Tx",
"description": "",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "signed_transaction",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
}
],
"data": {
"amount": "50",
"callback_url": "",
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"resource": "bandwidth",
"signed_undelegate_tx": "",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi",
"undelegate_tx": "0b30a9ce0406debcbd5f279c97ddcfdfc5a7e2c340161ce9e2d67aab1db2cf7c"
},
"created_at": "2025-03-20T06:08:19Z",
"updated_at": "2025-03-20T06:08:49Z",
"expired_at": "2025-03-21T06:08:49Z"
}
}

Step 3 - Submit Signed UnDelegate Transaction

Endpoint : flow/{:id}/next

Method : POST

Request

Body

  • inquiry_id* - string : Your inquiry id from step 1
  • data* - object : Wrapped data object
    • signed_delegate_tx* - string : Signed transaction payload

Sample Endpoint Request : flow/ca89a5ed-22ff-41cc-aa35-1de63a3c7146/next

Request Sample
{
"inquiry_id": "5dc8e84b-b373-480b-8162-9f5655305465",
"data": {
"signed_delegate_tx": "999d0eb2fbd4caa88db7de284bc633d5398f41ae2df3b116ee9adac77a918f516cdedd4cb725f60239df5479ed7d4f6ad08add52148a30c964c55956f5ea65d900"
}
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • state - string : Current state of your flow.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success create data",
"data": {
"id": "6fa80f69-e62b-489d-a570-197bb5ce4360",
"service_code": "staking-tron",
"flow": "undelegate",
"state": "initialized",
"data": {
"amount": "50",
"callback_url": "",
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"resource": "bandwidth",
"signed_undelegate_tx": "",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi",
"undelegate_tx": "32c34244365e455fec377cf85f971df5e2f7a1993260772d20fe7bbab91445ba"
},
"created_at": "2025-03-20T06:11:37Z",
"updated_at": "2025-03-20T06:11:41Z",
"expired_at": "2025-03-21T06:11:41Z"
}
}

After success undelegate to other accounts, You can check your detail resource at Get Delegated Resources