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

Products & catalog

Reading the shop: products, variants, collections, search.

TypeScript
const { products, total } = await mercestack.getProducts({
  limit: 24,
  collection: "new-arrivals",
  sort: "newest",
});

const product = await mercestack.getProduct("air-force-1");

const results = await mercestack.search("running shoes");

const collections = await mercestack.getCollections();
const categories = await mercestack.getCategories();

Products are addressed by handle — the URL-safe name, like air-force-1 — or by id. Storefront routes should carry the handle; it is stable, readable and what a customer sees.

Variants and options

A product varies along options (Colour, Size) and each combination is a variant with its own SKU, price, barcode and stock. You add a variant to a cart, never a product.

TypeScript
product.options;
// [{ name: "Colour", values: [{ value: "Black", swatch: "#000" }, …] },
//  { name: "Size",   values: [{ value: "42" }, …] }]

product.variants[0];
// {
//   id: "…",
//   sku: "AF1-BLK-42",
//   priceMinor: "4500000",
//   compareAtMinor: "5000000",   the "was" price, or null
//   currency: "NGN",
//   available: 7,                null when stock is not tracked
//   availableForSale: true,      what your button should read
//   selectedOptions: [{ name: "Colour", value: "Black" }, { name: "Size", value: "42" }],
// }

product.priceRange;
// { minMinor: "4500000", maxMinor: "6200000", currency: "NGN" }
// For "from ₦45,000" on a card, without loading every variant.

Money is always minor units, as a string

Kobo, cents, pence — never a float, because 0.1 + 0.2 is not 0.3 and a total that is a fraction out is a number nobody trusts again. Never a pre-formatted string either: how to display ₦45,000 is your locale's decision, not ours.

Availability

availableForSale is the flag to render against. It already accounts for whether stock is tracked at all and whether the merchant allows backorders, so your button does not have to combine three fields and get it wrong differently from us.

available is advisory. Stock is only truly held at checkout — it tells a shopper what to expect without promising it.

← PreviousKeys & authenticationNext →Carts

On this page

  • Variants and options
  • Availability
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