1

I want to create a counter in my store displaying the number of units sold.

I'm not using a shopping cart, but simply placing a bitpay button. I'm wondering if there is a way to query the blockchain, that will return the number of transactions sent to an address, over a given time period.

3

You can see the number of transactions for a Bitcoin address. That's easy. Either through a desktop wallet(Like Bitcoin QT) or using services like blockchain.info. Just search for an address there.

You can't do this for your site thought because you're using Bitpay and they provide a unique address for each payment to your site.

Even if you weren't using Bitpay, you would need to generate a unique address for each purchase on your site to be able to figure out which customer paid how much and when.

You could take an aggregate of the transactions and display them along with each unique address you used but I would strongly advise against it. Because then people could easily trace where you spend the Bitcoins that your customers paid you.

Try getting the number from your accounting records instead of trying to get it from Bitcoin payments ;)

  • Thanks, this was informative. The thing I'm looking to do though, is create a dynamically generated sales counter. Short of installing a 3rd party shopping cart, do you have any suggestions for that? – mardlin Jul 26 '13 at 18:46
  • You must be keeping records of sales somewhere. Just need to get it from there and display it on your site. Perhaps talk to the person managing your site? But definitely don't use Bitcoin transactions for this. Don't forget to upvote and/or mark as accepted answer if you are satisfied with the answer ;) – Emre Kenci Jul 27 '13 at 21:54
  • Other methods are not within the scope of this stack exchange. – Emre Kenci Jul 27 '13 at 21:57
2

Assuming you have Bitcoin-Qt in use:

  • open the debug window and go to its 'console' view
  • issue the command listaccounts and from the output select an account name
  • use that name to issue a listtransactions your_account_name command
  • in the output count the occurances of "category" : "receive"

These same commands are available through the RPC interface of Bitcoin-Qt, so that is how you can script the above.

  • Nope, he said he's using bitpay. – Emre Kenci Jul 25 '13 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.