Easy Life Agents
Account

Sell E-books

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

  1. Before you start
  2. Make a private bucket for your books
  3. Let your key reach the new bucket
  4. Save the bucket on your account page
  5. Turn on the Stripe webhook
  6. Add a book for sale
  7. What a buyer sees
  8. Refunds, new versions and removing a book
  9. Good to know

1. Before you start

Two things have to be working already, because selling a book uses both of them.

  1. Your Stripe key is saved.

    Follow Configure Stripe to take orders first. The money goes straight to your own Stripe account.

  2. Your storage for pictures is saved.

    Follow Create S3 Bucket first. The book bucket uses the same Amazon account, region and key as that one.

2. Make a private bucket for your books

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.

  1. Open S3 and click Create bucket.
  2. Give it a name ending in something like -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.

  3. Pick the same region as your picture bucket.

    For example, if your picture bucket is in us-east-1, this one must be in us-east-1 too.

  4. Leave "Block all public access" ticked on.

    This is the most important step: it is what makes the bucket private.

  5. Leave everything else as it is and click Create bucket.

    Do not add a bucket policy to this bucket and do not put a delivery service (CloudFront) in front of it.

3. Let your key reach the new bucket

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.

  1. Open IAM, choose Policies, and open easy-life-sites-media.

    That is the permission you made in Create S3 Bucket.

  2. Click Edit and switch to the JSON tab.
  3. Replace everything there with this, putting your picture bucket's name in the two lines that say 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"
          ]
        }
      ]
    }
  4. Click Next, then Save changes.

    The change works straight away. You do not need a new key.

4. Save the bucket on your account page

Your own account page here → Private storage for e-books

  1. Type the book bucket's name into "E-book bucket name".
  2. Click Save e-book storage.

    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.

  3. If it says the bucket lets anybody read its files, go back to step 2.

    Turn "Block all public access" back on for that bucket and remove any bucket policy, then save again.

  4. If it says a signed download link did not work, go back to step 3.

    The usual cause is a book bucket name in the permission that does not match the real bucket name letter for letter.

5. Turn on the Stripe webhook

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.

  1. Copy your webhook address from your account page.

    It is shown in the "Stripe webhook" part of the "Get paid" card and ends in /stripe-webhook.

  2. In the Stripe Dashboard, make sure the mode switch says Live, then open Developers and choose Webhooks.

    In newer Stripe dashboards this is under Workbench, Webhooks, Create an event destination.

  3. Click Add endpoint (or Add destination) and paste your webhook address as the endpoint URL.
  4. Choose these two events: checkout.session.completed and charge.refunded.

    Nothing else is needed.

  5. Click Add endpoint to save it.
  6. On the new endpoint's page, find Signing secret and click Reveal, then copy it.

    It starts with whsec_.

  7. Paste it into "Webhook signing secret" on your account page and click Save webhook secret.

    Every message from Stripe is checked against this secret, so a fake message pretending to be a payment is refused.

Your Stripe Restricted key does not need any new permission for this. Without a webhook, an order is only recorded when the buyer comes back to your page after paying.

6. Add a book for sale

Your own Site Builder here → Products

  1. Export your book as an EPUB file from your writing program.

    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.

  2. Under Products, fill in Name, Price and Author, then click Add product.

    Write the book's title as the name and a price in dollars and cents, like 9.99.

  3. In the new product, add a description and a cover picture.

    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.

  4. Under "E-book file (EPUB)", choose your EPUB file and click Upload e-book.

    The file goes into your private book bucket. The product now says "E-book attached" with the file's name and size.

  5. Make sure "On (shown on your page)" is ticked and click Save.
  6. Make sure your page shows products and a cart.

    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.

On your page the book shows an "E-book (EPUB)" tag and its author, and only one copy of it can go in a cart.

7. What a buyer sees

  1. They add the book to their cart and pay on Stripe's own payment page.
  2. Back on your page, the thank-you message has a "Download your e-book" button.
  3. They also get an email with the same download link.

    It is sent from your own support email if you set one up on your account page, and from ours otherwise.

  4. The download link opens a page on your own site listing every book in that order, each with a Download button.

    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.

Every order shows on your account page under Orders, with how many times each book was downloaded and the buyer's download link, so you can send it again if they lose the email.

8. Refunds, new versions and removing a book

  1. To refund a buyer, refund the payment in your Stripe Dashboard.

    With the webhook turned on, the order shows as refunded and its download link stops working.

  2. To put up a new version, choose the new EPUB on the product and click Replace e-book.

    New buyers get the new file; people who already bought keep the version they paid for.

  3. To stop selling a book, untick "On" and save, or click Remove e-book.

    People who already bought it can still download it.

  4. Files that somebody bought are never deleted from your bucket by the site builder.

    A file nobody bought is deleted when you replace it, remove it or delete its product.

9. Good to know

  • 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.

EASY LIFE AGENTS — A GLOBAL WEB METHODS PRODUCT · ALL RIGHTS RESERVED