How dual mapping works
File mappings and license-key mappings are independent join tables — ProductFileMap attaches files to a product, and ProductLicenseKeyTagMap attaches license-key tags. Neither table knows about the other. At order time, Alva Digital Downloads looks up both maps for the purchased product and assembles a single email containing every download link and every assigned key. Adding a key never removes the file; removing the file never affects the key pool.
Set up a product with both
1. Open the product in Alva
In the Alva admin, click Products in the sidebar and choose the Shopify product you want to sell as a file plus key. The detail page opens with tabs for Files, Packs, Links, and License keys.
Product detail page in the Alva admin. Highlight the four tabs (Files, Packs, Links, License keys). Show one sample software product title at the top. No real customer data visible.
2. Attach the file
On the Files tab, click Add file, pick the installer or asset, and click Save. The file is now mapped through ProductFileMap and applies to all variants by default.
3. Switch to the License keys tab
Open the License keys tab on the same product. The empty state shows a Link tag button — license keys are linked at the tag level, not key by key, so the same product can draw from a fresh pool of keys forever.
4. Link a license-key tag
Click Link tag, choose the tag that holds the keys for this product, and click Save. The link is stored in ProductLicenseKeyTagMap. Each paid order pulls the next available key from that tag's pool.
The License keys tab on a product with one tag linked. Show the tag name, current available-key count (e.g. "47 available"), and an unlink icon. Highlight the available count.
5. Confirm both mappings
Return to the Files tab — the attached file is listed. Switch back to License keys — the linked tag is listed. Both mappings now fire on every paid order for this product.
What customers see
The order email contains the download link for the file directly above an inline Your License Keys block listing the assigned key. The customer-account downloads page shows both: the file as a download row, the license key as a copyable code beneath the product. One purchase, one email, both deliverables.
License key timing reminder
If the shop has fraud checks enabled, license keys are not assigned until the order is approved — see Why license keys are assigned only after fraud approval. The file download link, however, is generated as soon as the email is sent. On a fraud-checked order this means the customer may receive the email with only the download link, then a follow-up email with the key after approval.
Frequently asked questions
Yes. Skip the Files tab and link only a license-key tag. The customer email lists the key on its own.
Alva creates a PendingLicenseKeyAssignment row and emails the file download immediately. Once the tag is restocked, the key is auto-assigned and the customer receives a follow-up email.
No. The key is sent in the email body and shown on the customer-account downloads page. The zip contains only the mapped files.
See also
Was this helpful?
Last updated 2026-05-06