How can I send bitcoins with Bitcoin-QT using the API? I'm making a bitcoin-based online marketplace. I've been reading/studying the Bitcoin API commands, and some of the commands need "unlocked wallet". Does this mean a wallet without a passphrase?
I think it's vital that the wallet be encrypted at all times. Still, if I've understood everything correctly, I need to decrypt the wallet (at least for a while) to be able to send bitcoins to another wallet.
So how should I proceed? If someone on the website wants to take his/her coins on to another wallet, do I need to make it so the API removes the PIN or encryption from the wallet, sends the bitcoins and encrypts it again?
Is it secure to do so?

Oh, and I'm using Bitcoin-QT to handle the coins.
To send bitcoins using the API:

It is recommended to have some knowledge of AJAX if using this method

WORD OF WARNING: Using this method can cause large amounts of inputs being set as miners fees. I suggest you continue with caution and start by using small inputs.

That being said...

Using the commands listunspent, createrawtransaction, signrawtransaction and submitrawtransaction.

To access the Bitcoin-qt console:

launch your bitcoin client as usual and wait for it to load the blockchain and start up
click on 'help' in the menu bar (top right)
click on 'debug window'
select the 'console' tab



Use listunspent to get an array of you spendable inputs in your wallet
This is where you set you transaction fee: Use createrawtransaction to generate a transaction in the form createrawtransaction [{\"txid\":\"[txid of the input transaction]\",\"vout\":[vout that relates to the txid of the input transaction]},...] {\"[address to send your bitcoins to]\":[amount of bitcoins to send to this address],...} All inputs that are not spent in a transaction are used as miners fees.
Use signrawtransaction [the output of createrawtransaction] to sign your generated transaction Note: Your wallet must be unlocked to perform this command. If not type walletpassphrase [your passphrase] 21600
Use submitrawtransaction [the output of signrawtransaction] to send your signed transaction to the network to be included into a block


You can see your transaction by going to http://blockchain.info/tx/[txid output from submitrawtrasaction]