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

Products & catalog

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

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.

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 & authenticationNextCarts
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