This section describes how typical web site code running on a web server uses the JSON-RPC API to keep track of customers' accounts.
Customer creates an account on the website: web server either assigns them a unique customer id number or uses their email address or other unique identifier, calls getaccountaddress “userid” and tells the customer to send to that address to fund their account.
Customer receives coins to fund their account: web server isn't involved.
Customer is shown their current balance: getbalance “userid” 6 to get their 'confirmed' balance, and subtracts it from getbalance “userid” 0 to get their 'unconfirmed' balance.
Show the customer an itemized list of transactions: listtransactions “userid”
Customer sends coins to another bitcoin address: sendfrom “userid” <address> <amount>
Customer transfers coins to another customer: move “userid1” “userid2” <amount>
You make a sale, paid for with bitcoins in the customer's account: move “userid” “” <amount> 6 “purchased item”, and if it succeeds, send them the product.
Customer is charged a fee for use of the service: move “userid” “FEES” <amount> (using special accounts like “FEES” can make your application's logic much simpler)
Customer purchases bitcoins from you: move “AVAILABLE” “userid” <amount> (assuming the bitcoins you are selling are kept track of in an “AVAILABLE” account)