merce.STACK
merce.STACK
Skip to content
PricingWhat's new
Log inGet started
{}Developers
GuidesAPI referenceChangelogGet API keys →
  • Get started

    • Quickstart
    • Keys & authentication
  • Storefront

    • Products & catalog
    • Carts
    • Checkout & payment
    • Customer accounts
    • Digital products
    • Without a build step
    • Bookings
    • Courses
    • Drop-in components
  • Server API

    • Server API
    • Customers
    • Payment links & transactions
    • Balance & payouts
    • Classes & students
    • Node SDK
  • Email API

    • Email API
    • Sending email
    • Delivery events
  • Events & errors

    • Webhooks
    • Errors
  • Reference

    • API reference
    • Changelog

Storefront

Digital products

Sell files, licences and downloads. Delivered the moment payment clears.

A digital product needs no stock, no shipping and no fulfilment step. When the payment clears, entitlements are granted inside the same transaction that records it — so there is no window where money has been taken and nothing is owed.

TypeScript
const result = await mercestack.checkout({ email });

if (result.library) {
  const library = await mercestack.getLibrary(result.library.accessToken);

  for (const item of library.items) {
    item.name;               // "Handbook.pdf"
    item.version;            // "2026 edition"
    item.licenseKey;         // "MSTK-A3F9-K2MN-7PQR", or null
    item.downloadsRemaining; // null means unlimited
    item.available;          // one flag, decided server-side
    item.unavailableReason;  // why not, when not
  }

  const { url, expiresIn } = await mercestack.getDownloadUrl(
    result.library.accessToken,
    library.items[0].entitlementId,
  );
}

How delivery is protected

  • —A download link is single use and lives for ten minutes. Forwarded to a group chat, it is dead before anyone else clicks it.
  • —The download count is spent when the link is *followed*, not when it is created — a link your customer never clicked costs them nothing.
  • —Files are never served from a permanent storage URL. There is nothing to leak that keeps working.
  • —Refunding an order withdraws access, and the customer is told why rather than meeting a silent failure.

Keep the accessToken — put it in the receipt

Most storefront buyers never create an account. That token is their library, and the link in their email is the only credential they have.

← PreviousCustomer accountsNext →Without a build step
Create a workspaceTalk to usPricing

One workspace for everything your business runs on — your team, customers, store, marketing and payouts in one place.

Get started

Product

  • All products
  • Pricing
  • What's new
  • Security

Resources

  • Documentation
  • Guides
  • Use cases
  • Blog
  • Get support

Company

  • About
  • Careers
  • Contact us
  • Talk to the team

Legal

  • Privacy
  • Terms
  • Cookie policy
  • GDPR
  • Report a vulnerability

© 2026 Mercestack. All rights reserved.

Mercestack StructureOS

mercestack