merce.STACK
merce.STACK
Skip to content
PricingDevelopersSecurityAbout
Log inGet started

Commerce API

  • Quickstart
  • Keys & authentication
  • Products & catalog
  • Carts
  • Checkout & payment
  • Digital products
  • Webhooks
  • Errors
  • Without a build step
  • API reference

Commerce API

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.

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.

PreviousCheckout & paymentNextWebhooks
Create a workspaceTalk to usPricing

The business operating system. One workspace for structure, customers, communication, money and the automation between them.

Create your workspace

Platform

  • Overview
  • Structure & work
  • Customers & communication
  • Finance & commerce
  • Flow & AI Workforce
  • Analytics & files

Developers

  • Documentation
  • Quickstart
  • Keys & authentication
  • Carts & checkout
  • Webhooks
  • API reference

Company

  • About
  • Pricing
  • Security
  • Contact
  • Report a vulnerability

Legal

  • Privacy
  • Terms
  • Cookie policy
  • GDPR
  • Privacy contact

© 2026 Mercestack. All rights reserved.

Mercestack StructureOS