Site Builder Documentation
How to sell EPUB e-books on your own page, so each buyer pays you through Stripe and then downloads the book from a private bucket in your own Amazon account.
Jump to a section
Two things have to be working already, because selling a book uses both of them.
Follow Configure Stripe to take orders first. The money goes straight to your own Stripe account.
Follow Create S3 Bucket first. The book bucket uses the same Amazon account, region and key as that one.
console.aws.amazon.com → S3
Your picture bucket has to let every browser read it, so a book kept there could be taken without paying; a second bucket that nobody can read keeps your books safe.
-ebooks, for example your-business-ebooks-4417.Bucket names are shared by everybody on Amazon, so add a few numbers if your first choice is taken.
For example, if your picture bucket is in us-east-1, this one must be in us-east-1 too.
This is the most important step: it is what makes the bucket private.
Do not add a bucket policy to this bucket and do not put a delivery service (CloudFront) in front of it.
console.aws.amazon.com → IAM → Policies → easy-life-sites-media
The key you made for pictures can only touch your picture bucket, so its permission needs the book bucket added.
easy-life-sites-media.That is the permission you made in Create S3 Bucket.
your-bucket-name and your book bucket's name in the two lines that say your-ebook-bucket-name.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::your-bucket-name/*",
"arn:aws:s3:::your-ebook-bucket-name/*"
]
},
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-ebook-bucket-name"
]
}
]
}The change works straight away. You do not need a new key.
Your own account page here → Private storage for e-books
The site builder writes a small test file, checks that a stranger is refused it, checks that a signed download link opens it, and deletes it again.
Turn "Block all public access" back on for that bucket and remove any bucket policy, then save again.
The usual cause is a book bucket name in the permission that does not match the real bucket name letter for letter.
On dashboard.stripe.com, then on your own account page here
The webhook makes Stripe tell your site about each payment and refund itself, so a buyer who closes the page straight after paying still gets their book, and a refunded book stops downloading.
It is shown in the "Stripe webhook" part of the "Get paid" card and ends in /stripe-webhook.
In newer Stripe dashboards this is under Workbench, Webhooks, Create an event destination.
checkout.session.completed and charge.refunded.Nothing else is needed.
It starts with whsec_.
Every message from Stripe is checked against this secret, so a fake message pretending to be a payment is refused.
Your own Site Builder here → Products
Only EPUB files are accepted, and each must be 25 MB or smaller; a book with many large pictures can usually be brought under that by shrinking the pictures.
Write the book's title as the name and a price in dollars and cents, like 9.99.
Upload the cover, or press Choose from library to reuse one you already uploaded. The cover picture is 800 by 800 pixels, like every product picture, and it is shown to everybody, so use the cover and never a page from inside the book.
The file goes into your private book bucket. The product now says "E-book attached" with the file's name and size.
On a one-page site, add an "Everything you have for sale" element and a "Cart and checkout" element to a section; on a multi-page site, add the Product Listing, Cart and Checkout pages.
It is sent from your own support email if you set one up on your account page, and from ours otherwise.
Each press makes a link that works for 15 minutes, and each book can be downloaded 10 times from one order, which covers a phone, a tablet and a computer with room to spare.
With the webhook turned on, the order shows as refunded and its download link stops working.
New buyers get the new file; people who already bought keep the version they paid for.
People who already bought it can still download it.
A file nobody bought is deleted when you replace it, remove it or delete its product.
There is no copy protection on the file: once a buyer has downloaded it, they can copy it like any EPUB.
Sales tax is not added to the price automatically, so check what applies to you with your own accountant or Stripe Tax.
Paper books are not supported, because the checkout does not ask for a delivery address.
You pay Amazon a few cents a month for the storage and downloads; your books and buyers' payments never pass through this service's own accounts.