For products where you simply hand over a file in exchange for payment -- template packs, prompt collections, e-books, course materials -- use a download product: you attach a file to the product, and buyers get the download link by email and in their account after paying. Anyone who hasn't bought it doesn't get a link.
Where to find it
- Admin -> Business -> Products & Pricing: create the product, upload the file
- Where buyers download it: Account -> My Orders -> "My downloads"
- For your AI:
upsert_product,set_product_file,get_product_file
1. Create the product
From the admin panel:
- Admin -> Business -> Products & Pricing, click "+ New product"
- Set "Type" to "Download"
- Fill in the name, price (in cents), and description, then save
From your AI: tell it "Create a download product: AI Prompt Collection, priced at $49." It calls upsert_product with type set to download, plus a name, price, and currency.
2. Attach the file
One file per product. Uploading again replaces the old one. Maximum file size is 200MB, both from the admin panel and via the AI.
Uploading from the admin panel:
- Open this product's edit window under Products & Pricing (save the product first before uploading -- a new product will prompt you to "save the product first, then come back to upload the file for sale")
- "Download" type products have a "The file you are selling" section in the window
- Click "Upload file (PDF / ZIP etc., <=200MB)" and choose a file
- Once uploaded, the filename and size are shown; click "Try another" to replace it or "Delete" to remove it
Attaching via your AI: set_product_file, which accepts any of these:
- A file URL in
url: an external URL is downloaded by the server and stored on your site; a/storage/URL on your own site is read directly from your site's storage - File content in
base64plus a filename infileName(with the extension included): for a PDF or ZIP sitting on your own computer - An empty string for
url: removes the attached file
After attaching it, have the AI call get_product_file to read it back and confirm: filename, size, type, upload time.
3. How buyers get the file
- Buyers who check out through the store (via "Buy now" on the product page, or the cart) get the download link directly in their order confirmation email after payment succeeds
- The download link is valid for 7 days. Once it expires, the buyer can log into Account -> My Orders -> "My downloads," and each time that page loads, it generates a fresh link (the page itself also notes "download links are valid for 7 days -- refresh this page after it expires to get a new one"). "My Orders" in the email refers to this page
- You can also put download links into your own email templates:
{{ downloadUrl }}(the link) and{{ downloadFileName }}(the filename). These two variables only have a value for someone who actually owns this product
Who can download it
The system checks, at the moment of download, whether this person still owns this product -- any one of these conditions qualifies:
- They have access to this product that hasn't expired or been revoked
- They have a paid order that includes this product
So:
- After a full refund, the old link stops working right away, and it disappears from "My downloads" too
- A partial refund (a partial price adjustment) still counts as a paid order -- it can still be downloaded
- If you manually grant someone access with
grant_customer_access(when the product has an access type set), they can download it too
Security
- The file has no public URL -- it's kept in your site's private storage, and direct access to the storage address is always refused
- It can only be downloaded through a signed link, which is tied to a specific person, a specific product, and a specific expiry date
- Even if the link gets forwarded to someone else, it only works for up to 7 days -- and if the original buyer gets refunded, it stops working immediately
Replacing a version / deleting the file
- Updating to a new version: call
set_product_fileagain, or click "Try another" in the admin panel to re-upload. Existing buyers get the new file next time they download -- no need to notify them of a new link - Deleting the file: clicking "Delete" in the admin panel warns you that "customers who already bought this will no longer be able to download it until you upload a new one." Think it through before you delete
Watch out for / FAQ
- Q: A buyer says they never got the download link?A: Have them check their order confirmation email (it might be in spam), or log into Account -> My Orders -> My downloads directly.
- Q: "My downloads" is empty?A: Check in order: does this product have a file attached (
get_product_file); is their order actually paid; have they already been fully refunded.
- Q: What if my file is bigger than 200MB?A: 200MB is the limit both from the admin panel and via the AI. Compress it, or split it across multiple products.
- Q: Bought through a funnel page -- does the confirmation email have a download link?A: Only store orders automatically include the link in their confirmation. Buyers through other channels can still download it from "My downloads" -- you can also add
{{ downloadUrl }}to the funnel's access-granted email template.
Related articles
- "Store products and shipping" (shop-products-shipping)
- "Orders & Refunds" (orders-and-refunds)
- "Email Templates: Writing Them, Reading Them Back to Check, and Seeing What Actually Went Out" (email-templates)