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

Get started

Keys & authentication

Two kinds of key, with different rules — and the rules are enforced, not advised.

Every request carries a key. Send it as Authorization: Bearer <key>, or as X-Mercestack-Key: <key> where the Authorization header is already spoken for by a proxy or framework.

Publishable `pk_…`Secret `sk_…`
Where it goesBrowser code, mobile apps, anywhereYour server, and nowhere else
Stored by us asA hash and the key itself, so you can read it backA hash only — shown once, at creation
CanRead the published catalog, create and edit carts, start checkoutWhatever scopes you granted it
CannotRead orders or customers, edit a product, adjust stock, refundBe used from a browser — we refuse the request

Two rules worth knowing

A publishable key's capabilities are fixed in our code, not read from your key's record. Whatever a key row says, a publishable key gets the storefront set and nothing else — so a misconfiguration cannot hand a browser the ability to read orders.

A secret key sent with an `Origin` header is rejected. An Origin means a browser, which means the key is in a front-end bundle. Serving that request would let the leak continue quietly, so we refuse it instead. The SDK also throws if you pass an sk_ key to it, before any request is sent.

Scopes

Secret keys carry explicit scopes. Grant the narrowest set that does the job — a key that syncs stock has no business reading customers.

Shell
products:read     products:write
inventory:read    inventory:write
orders:read       orders:write
customers:read    customers:write
carts:write       checkout:write
discounts:read    discounts:write
giftcards:read    giftcards:write
refunds:create    webhooks:manage
payments:read     payments:write
payouts:read
classrooms:read   classrooms:write

A secret key is shown exactly once

We store only a digest, so there is no endpoint that could show it to you again — not even to you, not even to us. If you lose it, revoke it and make another. Revoking keeps the key's request history intact.

Test mode

pk_test_ and sk_test_ keys create carts and orders marked livemode: false. They are excluded from revenue, analytics and abandoned-cart automation, so your experiments never appear in a merchant's numbers.

← PreviousQuickstartNext →Products & catalog

On this page

  • Two rules worth knowing
  • Scopes
  • Test mode
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