Sell digital goods with Bitcoin and deliver them by email.

This post is also available in: German

Sell digital goods with Bitcoin and deliver them by email.

Do you want to sell digital goods such as software keys, memberships, download links or files to be sent to the customer via email?

In this article we show how you can create a shop with the help of the Point of Sale app. With the help of BTC Transmuter, the buyer receives after payment the digital goods automatically delivered by email.

The article “Email notification upon receipt of a Bitcoin payment” showed how merchants are notified by email when a Bitcoin payment is received on their Bitcoin Wallet.

This service can be extended to send customers a download link, attachment or software key via email.

Any form of digital data can be sold via Lightning and Bitcoin and, after successful payment, automatically sent to customers by email.

Sale of an admission ticket

We show this function using the example of a ticket shop where a ticket is sold and the paid ticket is sent by email.

To try it out yourself, you can use this link to go to the Demo Ticket Shop and place an order yourself. Your payment will be processed successfully and you will receive a demo link to the event. This example should illustrate how the purchase of a digital product can take place. We use the payment as a donation.

Coincharge Ticket Shop

The following example deals with the sale of an admission ticket, which is sent in digital form to the payer by email.

This email contains the confirmation of the successful payment in form of a QR Code. This QC Code will be presented at the entrance control during the event, thus proving that you have a valid ticket.

To implement a Ticket Sale System we need a BTCPay Shop, the Point of Sale App, BTC Transmuter and QR Code Generator.

The project was implemented by Kukks for a BTCPay meetup.

You can find the description under: https://github.com/btcpayserver/btcTransmuter/blob/master/docs/EmailReceiptsPreset.md

We have rebuilt it again to adapt it for further applications afterwards.

We go to the BTCPay server and create a shop called Ticket Shop.

In the shop settings (General Settings) we create an internal BTCPay Wallet. How to create an internal BTCPay Wallet you will find out in the article: https://coincharge.io/btcpay-wallet/

You can also use an external wallet and store the corresponding Xpub key.

For a detailed description of how you can set up and administrate the shop, you can find out in BTCPay shop administration.

When creating the shop for the sale of digital products it is necessary that we receive the email address of the customer. Therefore you must make sure under Checkout Experience that “Requires a refund email” is activated.

Email required for digital products

The buyer must provide his email address, otherwise we cannot send the email with the event ticket to this address.

After we have set up the store, we create a Ticket App based on the Point of Sale App.

Create a New App

The Point of Sale App is preset for restaurants. We customize this app for the sale of a single product. In this case an admission ticket.

We deactivate all functions we do not need and change the text on the button.

If we deactivate the “Enable shopping cart” function, the customer can only buy one product at a time. In this case also only one ticket. If the customer should be able to buy several tickets or for different categories, the shopping cart function must be activated.

Update Point of Sale

Then we add the product Ticket:

Product Management

We have stored the product image on a web server and link to the image.

The inventory is set at a maximum of 30 tickets and the price is fixed.

The store can be accessed via the Url https://btcpay.coincharge.io/apps/CZ2gpX1Cb81D8f2L5YaDdh23oTE/pos

and looks like this as a single-product shop, for example:

One product shop

If the customer wants to buy the ticket, the first step is to ask for the email address:

Enter email address

In the next step the payment window opens and you can pay by Bitcoin or Lightning.

Delivery of the event ticket

If the customer has successfully paid the ticket, we as the organizer would like to be informed by email about the successful payment.

In addition, the customer should receive a digital ticket with which he can prove his payment on the day of the event.

With the help of BTC Transmuter we can be informed about the successful payment and the delivery of the digital ticket can be organized.

You will need a shop set up at BTCPay, such as our Ticket Shop created above. Additionally an account with BTC Transmuter. How to extend your own BTCPay server with BTC Transmuter, you can read in the article BTC Transmuter.

You can also create a Transmuter account for your BTCPay Store at https://btcpay.coincharge.io/btctransmuter/ and use the functions.

Your BTCPay shop can run on your own server or with another third-party provider. So it is not mandatory that the store must run at https://btcpay.coincharge.io

BTC Transmuter Presets

If you have registered on BTC Transmuter, you will find a pre-selection of different templates under the menu item Presets. One of the templates is BTCPay Email Receipts.

email notification

If we select this template (Preset), in the first step we have to define for which shop (Choose your BTCPay store) we want to use Transmuter and with which email address we want to send the order (Choose your email sending service).

If you are using Transmuter for the first time, you can set up these two External Services using the link shown. How this works in detail, you can read in the article: Email notification on receipt of a Bitcoin payment

If you have already created another shop, you will get an overview of the already available stores. If you would like to create another store, you must first do this via the menu item External Services.

There we click on Create New.

Create External Service

Then we have to connect transmitters to our store on the corresponding BTCPay server (pairing).

In the field BTCPay Host Url we enter the url of the BTCPay server.

Sell digital goods with Bitcoin and deliver them by email. 1

We leave the second line empty and click Save.

Then the message “Cannot proceed until paired” appears.

Additionally a link that we can click on.

Digital goods

If we click on the link, we will be connected to the specified BTCPay server and give permission for the pairing.

We select the appropriate shop. In our case the Ticket Shop, which we have created as described above.

Pairing Permission

We confirm this with Approve and then receive the message that the pairing was successful.

Access token for digital goods

We don’t have to do anything more at this point and switch back to BTC Transmuter and click Save twice. After that it looks like this:

Edit External Service

Then we switch back to Presets and then to BTCPay Email Receipts.

In the selection Coose your BTCPay store we choose our ticket shop and as email sending service our created email address.

We then specify that the goods should be delivered when the invoice has reached the status Complete.

Create_BTCPay_Email_Receipts_-_BtcTransmuter

Then we specify that the message should be sent to the email address entered in the payment window during payment.

Therefore we had activated the field “”Requires a refund email” in the Checkout experiences when we created the store.

In addition, we provide our own email address, so that we as the operator of the ticket shop are also informed about the order.

Then you can define which information should be displayed in the email message.

This includes the email sender address and the email subject.

Create_BTCPay_Email_Receipts_-_BtcTransmuter

In the email message you can use data generated by the system during the ordering process.

We would like to inform the customer about the Invoice ID and take over the corresponding call: {{TriggerData.Invoice.Id}}

We can design the email body with normal HTML according to our wishes and ideas.

Then you click on Save.

A template for the email text is already available in the Action Groups section. This template can be edited accordingly.

To do this you should click on Edit and twice on Next. We then have two actions to choose from. One action is the email message to the buyer and the second message goes to the shop operator.

These two email messages can be customized via Edit. After we clicked on Edit, the following view appears.

Edit Send Email Action

You can now make appropriate changes in the Body section.

For the Event Ticket application, a QR Code is to be sent to the customer, which he should present on the day of the event.

Therefore the following link is included:

<img src='https://api.qrserver.com/v1/create-qr-code/?size=150x150&amp;data={{TriggerData.Invoice.Url}}'><br> Invoice Id: <a target='_blank' href='{{TriggerData.Invoice.Url}}'>{{TriggerData.Invoice.Id}}</a>

 

The external service provider qrserver.com offers a QR Code Generator, which is called with this link and displays our invoice number as a QR Code.

 

With any QR Code Reader, the invoice url can then be called up via the successful payment.

 

Then we click on Save.

 

Instead of a QR Code we can also transfer any other product with the email.

 

One could transmit a download link, a software key, an access authorization or an attachment in the form of a PDF or any other file.

 

The second action group is the message to the shop owner.

Here we can have other information communicated to us, if desired.

 

For example, we have deposited the following text to the shop owner:

<div style='text-align:center; width:100%'>
You got a new Ticket Order for {{TriggerData.Invoice.ItemDesc> <br>
<p>The order comes from the customer: {{TriggerData.Invoice.Buyer.email}}</p>
<p> The Invoice status is: {{TriggerData.Invoice.Status}} </p>
<p>You can read the status here: {{TriggerData.Invoice.Url}}</p>
<p>The amount paid in BTC is: {{TriggerData.Invoice.BtcPaid}}</p>
<p> The amount paid in {{TriggerData.Invoice.Currency}} is: {{TriggerData.Invoice.Price}} {{TriggerData.Invoice.Currency}}
</div>

Do not forget to save your changes. We also renamed and enabled the Recipe accordingly.

Under the menu item Recipes we find all created Recipes.

Edit_Recipe_-_BtcTransmuter

Now we can try out with a live test whether everything works as we imagine it. Under the item Logs we can later check if everything worked out and if the emails have been sent properly to the customers.

For trying out we go to the shop under the Url:

https://btcpay.coincharge.io/apps/CZ2gpX1Cb81D8f2L5YaDdh23oTE/pos

Shop for digital goods

There we place an order for a ticket and pay by Bitcoin or Lightning.

As a customer we then receive an email that looks something like this:

Email to the customer

The shop owner receives an email with this content:

Email to the shop operator for digital goods

This example application is intended to illustrate how easy it is to sell digital content using Bitcoin.

Any digital content, files, access data or software keys can be sold.

You don’t need any special shop software for this, but can implement this with the PointofSale app, which is already implemented on the BTCPay server. If you do not want to run your own BTCPay server, you can create a demo store at https://btcpay.coincharge.io.

Additionally you connect the service BTC Transmuter with this shop and you can sell digital content for Bitcoin.

This post is also available in: German

Leave a reply