# Error in sending future transactions with Algorand Python SDK

**URL:** <https://forum.algorand.co/t/error-in-sending-future-transactions-with-algorand-python-sdk/4405>\
**Category:** General\
**Tags:** testnet, mainnet, general\
**Created:** [September 29, 2021, 10:13pm UTC](https://forum.algorand.co/t/error-in-sending-future-transactions-with-algorand-python-sdk/4405 "2021-09-29T22:13:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Obi](https://avatars.discourse-cdn.com/v4/letter/o/e9a140/32.png) [@Obi](https://forum.algorand.co/u/Obi)\
**Post date:** [September 30, 2021, 8:15am UTC](https://forum.algorand.co/t/error-in-sending-future-transactions-with-algorand-python-sdk/4405/4 "2021-09-30T08:15:06Z")

</div>

Hello @fabrice i have attached the code for your review, thanks.

```auto
import json
from algosdk.v2client import algod
from algosdk import transaction

algod_address = "https://mainnet-algorand.api.purestake.io/ps2" # network address
algod_token = "🔑" # api key
headers = {
    "X-API-Key": algod_token,
}

# initiate a new client with the given parameters
algod_client = algod.AlgodClient(algod_token, algod_address, headers)

params = algod_client.suggested_params()
params.flat_fee = True
params.fee = 1000
fee = params.fee
gh = params.gh

# check node status
status = algod_client.status()
# to read json data
node_stat = json.dumps(status, indent=4)
node_stat = json.loads(node_stat)

current_round = int(node_stat["last-round"])
avg_block_time = 4.5
target_submission_time_in_seconds = 1200
avg_number_of_block_produced_within_time = int(target_submission_time_in_seconds/avg_block_time)
first_round = int(current_round + avg_number_of_block_produced_within_time)
last_round = int(first_round + 1000)

sender = 'I76WK5LC6JDKOIQ4AZ2BKGENET37AUR57V4NRKKDY3UARDTJ534LGPPVCE'
sender_key = '🔑'
reciever = '7WEP4COP42SO6XPCIUIEXYPBYWL2K3QNEV73FPNSU5WC26JYTXMNSC6QJI'
amount = 100000

payit = transaction.PaymentTxn(sender, fee, first_round, last_round, gh, reciever, amount)
signed_txn = payit.sign(sender_key)
# submit the transaction
txid = algod_client.send_transaction(signed_txn) # send the transaction
print(f"Successfully sent transaction with txID: {txid}") # prints the transaction id

```

---

_[View the full topic](https://forum.algorand.co/t/error-in-sending-future-transactions-with-algorand-python-sdk/4405)._
