TRON - Error: Cannot send TRC-20 callback is not defined

The TRC-20 error "callback is not defined" usually means the amount has more decimal places than the token supports; USDT on TRON has 6 decimals.

The TRC-20 error callback is not defined usually means the amount in your transfer has more decimal places than the token supports. Tether USDT on TRON (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t) supports 6 decimals, so an amount such as 10.00448335 fails. Cut the amount to the token's decimals and send the transfer again.

Symptom

When you send TRC-20 tokens with Send TRC-20 tokens (POST /v3/tron/trc20/transaction), you get an error like this:

{
  "statusCode": 403,
  "errorCode": "tron.trc20.tx.send.error",
  "message": "Cannot send TRC-20 transaction.",
  "cause": "callback is not defined"
}

Cause

This error is usually related to a malformed payload where the amount has more decimals than a TRC-20 token supports. Every TRC-20 contract sets its own number of decimals.

For example, this request sends 10.00448335 USDT, an amount with 8 decimals, but the USDT contract TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t supports 6:

curl --location 'https://api.tatum.io/v3/tron/trc20/transaction' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{
    "to": "TLY7qkYdFaskWaWaMASdp6XJFqqvA18Bhz",
    "tokenAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "amount": "10.00448335",
    "feeLimit": 1000,
    "fromPrivateKey": "{SENDER_PRIVATE_KEY}"
  }'

Solution

  1. Find the token's decimals. Check the tokenAddress on the Tronscan explorer, which confirms that USDT supports six (6) decimals, not eight (8):

    Tronscan showing 6 decimals for the USDT TRC-20 token

    Or call the contract's decimals() function through the TRON RPC:

    curl --location 'https://tron-mainnet.gateway.tatum.io/wallet/triggerconstantcontract' \
      --header 'Content-Type: application/json' \
      --header 'x-api-key: {YOUR_API_KEY}' \
      --data '{
        "owner_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "function_selector": "decimals()",
        "visible": true
      }'

    constant_result holds the decimals as a hex number; ...06 means 6 decimals (response trimmed):

    {
      "constant_result": [
        "0000000000000000000000000000000000000000000000000000000000000006"
      ]
    }
  2. Cut the amount to at most that many decimal places, for example 10.004483 instead of 10.00448335.

  3. Send the transfer again. The response contains the transaction ID (txId).

    curl --location 'https://api.tatum.io/v3/tron/trc20/transaction' \
      --header 'Content-Type: application/json' \
      --header 'x-api-key: {YOUR_API_KEY}' \
      --data '{
        "to": "TLY7qkYdFaskWaWaMASdp6XJFqqvA18Bhz",
        "tokenAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "amount": "10.004483",
        "feeLimit": 1000,
        "fromPrivateKey": "{SENDER_PRIVATE_KEY}"
      }'

Use fromPrivateKey only on testnet. On mainnet, sign with Tatum KMS and send its signatureId instead. For the full flow, see Transferring TRC-10 and TRC-20 tokens.

FAQ

How many decimals does USDT TRC-20 have?

USDT on TRON (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t) has 6 decimals, so the smallest amount you can send is 0.000001 USDT. For other chains, see Token decimals.

How much TRX does a USDT TRC-20 transfer need?

The sender pays energy and bandwidth in TRX. A USDT transfer usually consumes about 65,000 energy to an address that already holds USDT and about 130,000 to one that doesn't. See TRON fee and feeLimit estimates.

Still stuck?

Report the issue to support with the request (without the private key) and the full error response.


Did this page help you?