Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Digital Product Delivery is the Digital Files entitlement type. You upload your files once to a Digital Files entitlement, attach the entitlement to a product, and Dodo Payments delivers presigned download links to every paying customer through email and the customer portal. The entitlement supports:
  • Hosted file uploads: store files on Dodo Payments and serve them via short-lived presigned URLs.
  • External download links: link to files hosted on Dropbox, Google Drive, S3, or any URL.
  • Download instructions: free-form text shown to the customer on their order page and in the delivery email.
You can mix all three on a single entitlement.

Key Features

File Upload

Upload files (PDF, ZIP, images, videos, etc.) up to 100 MB. Files are streamed and stored efficiently.

Multiple Files

Attach as many files as you need to a single entitlement.

External Links

Provide external download links (Dropbox, Google Drive, signed S3 URLs) as an alternative or addition.

Presigned URLs

Hosted files are served via short-lived presigned URLs. Each download URL expires automatically after roughly 15 minutes.

Set up Digital Product Delivery

1

Open Entitlements

Go to Entitlements in your Dodo Payments dashboard and click + to create a new entitlement.
2

Choose Digital Files

Select Digital Product Delivery as the integration.
3

Add files, links, and instructions

Configure any combination of:
  • Files: upload one or more files. Each upload returns a file_id that’s appended to the entitlement.
  • External URL: a publicly reachable HTTPS link delivered alongside hosted files.
  • Instructions: free-form text shown to the customer (e.g., “Unzip and run setup.sh”).
Digital Files entitlement with file upload, external URL, and instructions fields
4

Save the entitlement

Save. The entitlement is now available to attach to any product.

Attach to Products

Open a product, expand Advanced Settings → Entitlements & Credits, and select your Digital Files entitlement. The entitlement is delivered on every successful purchase or active subscription tied to that product.
Product entitlements panel showing Digital Product Delivery selected

How Delivery Works

Digital Files delivery follows the standard grant lifecycle:
EventBehavior
payment.succeeded (one-time)Issue a grant. The grant carries presigned download URLs valid for ~15 minutes; customers can refresh them by reopening the email link or the customer portal page.
subscription.activeIssue a grant. Files remain accessible while the subscription is active.
subscription.renewedNo-op. The same grant continues; new presigned URLs are minted on every fetch.
subscription.on_hold / cancelled / expiredRevoke the grant. New presigned URLs are no longer issued.
subscription.plan_changedRevoke the old grant; issue a new one for the new plan’s entitlement.
refund.succeeded (one-time)Revoke the grant.
Manual revokeRevoke with revocation_reason: manual.
Revocation stops Dodo Payments from issuing new download URLs, but it does not invalidate copies a customer has already downloaded. Treat hosted file downloads as “delivered once read.”

Customer Experience

Purchase Confirmation

After a successful transaction, the customer receives an email with download links and any instructions you configured.
Purchase confirmation email showing download links for digital products

Customer Portal Access

Customers can re-fetch download links anytime from the Customer Portal. The portal page generates fresh presigned URLs on demand, so the same purchase keeps working even after the email’s links have expired.
Customer portal interface showing available digital products for download
Customers can download files directly from confirmation emails or access them anytime through their portal.

Manage Files Programmatically

Upload a file to an entitlement

import DodoPayments from 'dodopayments';
import fs from 'node:fs';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'],
  environment: 'test_mode',
});

await client.entitlements.files.upload('ent_files_abc', {
  file: fs.createReadStream('./pro-bundle.zip'),
  filename: 'pro-bundle.zip',
});

List grants and resolve download URLs

const grants = await client.entitlements.grants.list('ent_files_abc', {
  customer_id: 'cus_abc123',
});

for (const grant of grants.items) {
  for (const file of grant.digital_product_delivery.files) {
    console.log(file.filename, file.download_url, `expires in ${file.expires_in}s`);
  }
}

Remove a file from an entitlement

await client.entitlements.files.delete('ent_files_abc', 'df_a4f6c1de');

Important Considerations

  • Presigned URLs expire quickly. Download URLs returned in grant payloads or webhook events are valid for ~15 minutes. Don’t store them; re-fetch them when the customer needs to download again.
  • Updating files affects future purchases only. Replacing or removing a file does not retroactively change downloads already issued. Past customers can still re-fetch the version that was current when their grant was created.
  • Refunds don’t invalidate downloaded copies. A customer who already downloaded a file keeps that copy. For revocable content (license-restricted media, time-limited access), pair Digital Files with License Keys and validate at runtime.
  • For sensitive content, prefer external URLs with their own auth. Dodo Payments’ presigned URLs are short-lived but unauthenticated within their window; anyone with the URL can download in that window. Externally hosted, account-gated content provides stronger guarantees.

API Management

Create Entitlement

Create a Digital Files entitlement with optional external URL and instructions.

Upload File

Upload a file (up to 100 MB) and append it to the entitlement.

Delete File

Remove a file from the entitlement.

List Grants

List grants and read the resolved download URLs.

Update Entitlement

Update instructions, external URL, or replace files.

Revoke Grant

Manually revoke a customer’s access.

Webhooks

Digital file delivery and revocation fire the four entitlement_grant.* webhook events. For Digital Files grants, the payload includes a digital_product_delivery object with the resolved file list (presigned URLs, filenames, sizes), the optional instructions, and the optional external_url.
"digital_product_delivery": {
  "files": [
    {
      "file_id": "df_a4f6c1de",
      "download_url": "https://files.dodopayments.com/.../pro-bundle.zip?Signature=...",
      "filename": "pro-bundle.zip",
      "content_type": "application/zip",
      "file_size": 18742390,
      "expires_in": 900
    }
  ],
  "instructions": "Unzip and run setup.sh from the project root.",
  "external_url": null
}

Legacy Digital Product Delivery

Products configured with the older digital_product_delivery block on the product itself have been automatically migrated to a Digital Files entitlement. Existing files uploaded under the legacy product file API are preserved; they continue to be downloadable and appear in grant payloads tagged with source: "legacy". Future updates (adding files, changing instructions, replacing the external URL) should be made by editing the migrated Digital Files entitlement under Entitlements.The legacy product-level fields (digital_product_delivery.external_url, digital_product_delivery.instructions) continue to be populated on product responses for backwards compatibility, but the entitlement is the source of truth going forward.

Best Practices

  • Treat downloads as one-shot. Customers will share or lose links, so design your product around the assumption that anything they download is theirs to keep.
  • Use instructions to set expectations. For multi-file bundles, add an instructions line explaining what to install first or how to combine the files.
  • Watch the 100 MB cap. Larger artifacts (multi-GB datasets, video courses) should be hosted externally and linked via external_url instead of uploaded.
  • Combine with License Keys for revocable access. If you need to revoke access to in-product features after a refund, pair the Digital Files entitlement with a License Key entitlement and validate the key at runtime.
  • Test the customer-portal refresh flow. Confirm a customer can return to the portal a week later and still get a working download link. This is the primary recovery path when email links expire.
Last modified on May 6, 2026