Using Python-SDK could not create new transaction

I am using Latest fireblock Python SDK to integrate with fireblocks api. With some trial and error i successfully created new vault account and BTC_TEST asset wallet.
But when i tried to create a Transfer transaction from one wallet to another i could not do it. Documentation did not help.

When tried code on this link it gives error that this function does not even exist.
Tried to follow this second link that gives different function and parameters to create transaction:

After looking at core library functions of the python SDK this is the code i have for create transaction:

from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.base_path import BasePath
from fireblocks.models.create_vault_account_request import CreateVaultAccountRequest
from fireblocks.models.transaction_request_amount import TransactionRequestAmount
from fireblocks.models.source_transfer_peer_path import SourceTransferPeerPath
from fireblocks.models.destination_transfer_peer_path import DestinationTransferPeerPath
from fireblocks.models.transfer_peer_path_type import TransferPeerPathType
from fireblocks.models.transfer_peer_path_sub_type import TransferPeerPathSubType

my_api_key="correct-api-key"
with open('./fireblocks_secret.key', 'r') as file:
    secret_key_value = file.read()

configuration = ClientConfiguration(
    api_key=my_api_key,
    secret_key=secret_key_value,
    base_path=BasePath.Sandbox
)

with Fireblocks(configuration) as fireblocks:
        
        assetId = "BTC_TEST"
        amount = TransactionRequestAmount("0.00001")
        src_id = "1"
        dest_id = "2"

        transaction_request = {
            "asset_id": assetId,
            "amount": amount,
            "source": {"type": TransferPeerPathType.VAULT_ACCOUNT, "name": "My First Vault Account", "id": src_id},
            "source_address": "tb1qlfpgs37anpa4w6l2jkhtklpdz700gt6k9e00j9",
            "destination_address": "tb1qc4mxszs9kv8whxdsfj4xyzt534r77qz8apyrdz",
            "destination": {"type": TransferPeerPathType.VAULT_ACCOUNT, "name": "Default", "id": dest_id},
        }
        x_end_user_wallet_id = "tb1qc4mxszs9kv8whxdsfj4xyzt534r77qz8apyrdz"
        future = fireblocks.transactions.create_transaction(transaction_request=transaction_request, x_end_user_wallet_id=x_end_user_wallet_id)
        api_response = future.result()  # Wait for the response
        print("The response of VaultsApi->create_transaction:\n")
        pprint(api_response.data)

But this gives me unauthorised error :

fireblocks.exceptions.UnauthorizedException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Thu, 08 May 2025 12:42:52 GMT’, ‘Content-Type’: ‘application/json; charset=utf-8’, ‘Content-Length’: ‘61’, ‘Connection’: ‘keep-alive’, ‘X-Powered-By’: ‘Express’, ‘X-Request-ID’: ‘fe1cda63b5c4d611c0b37f6f62483932’, ‘x-reason’: ‘{“message”:“Unauthorized: Token was not accepted.”,“code”:-7}’, ‘ETag’: ‘W/“3d-zomXnAy0H/hxycUcfr0PgHC7HLw”’, ‘Strict-Transport-Security’: ‘max-age=31536000; includeSubDomains’, ‘cf-cache-status’: ‘DYNAMIC’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘93c90a1bbb75421d-EWR’})
HTTP response body: message=‘Unauthorized: Token was not accepted.’ code=-7

I checked the error code “-7” which is for incorrect Api Key if you are using SDK, but i double check that Api Key is correct. I can still create Vault accounts and Asset wallets, just create transaction is failing.

Hi!,

It seems that you are initiating this API request from an API user who is an editor but in your TAP you do not have a designated signer for those transactions.
This is expected as Editors do not have signing capabilities and to create a transaction the user who is initiating the transactions needs to have signing capabilities or you need to have a TAP rule designating a signer for that request initiated by that editor.

One issue I am noticing with with your API request.
You are using the x_end_user_wallet id which you do not need to use since your not an EW (Embedded Wallet) user.

Your request would be:

with Fireblocks(configuration) as fireblocks:

        assetId = "BTC_TEST"
        amount = TransactionRequestAmount("0.00001")
        src_id = "2"
        dest_id = "1"

        transaction_request = {
            "asset_id": assetId,
            "amount": amount,
            "source": {"type": TransferPeerPathType.VAULT_ACCOUNT, "id": src_id},
            "destination": {"type": TransferPeerPathType.VAULT_ACCOUNT,"id": dest_id},
        }
        future = fireblocks.transactions.create_transaction(transaction_request=transaction_request)
        api_response = future.result()  # Wait for the response
        print("The response of VaultsApi->create_transaction:\n")
        pprint.pprint(api_response.data)

(I have removed a few things that where optional and not needed).
Please just make sure that you have enough tBTC balance in your sourceVault.
Thank you

Hey thanks for the answer. I am very new to this so need more understanding.
Can you tell me what is TAP ? And how can i have a designated signer for transactions ?
I just have api key and secret key file from fireblock account, do i need to create a new user or enable some permission for existing one ?