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

Server API

Server API

Customers, payments, payouts and classes from your backend, with a secret key.

The storefront API is what a shop front calls from the browser. The server API is for your backend: an ERP sync, an accounting export, a school's own sign-up flow. It uses a secret key with only the scopes you grant, and refuses publishable keys outright.

Base URL

Shell
https://api.mercestack.com/v1

# Self-hosted: your API's /api path
https://mercestack.example.com/api/v1

Scopes

ScopeGrants
customers:read / customers:writeCRM customers
payments:readPayment links and transactions
payments:writeCreate and deactivate payment links
payouts:readYour balance and payout history
classrooms:readClasses, sessions and their students
classrooms:writeCreate classes and sessions; enrol and remove people
classrooms:joinJoin links into live classes; end a live class
recordings:readRecordings of live classes
products:* inventory:* orders:* …The commerce Management API — see Keys & authentication

Responses

Every response is an envelope: { "success": true, "statusCode": 200, "message": "…", "data": … }. The examples on these pages show data. The SDKs unwrap it for you. Errors have success: false, a human message, and an HTTP status — see Errors.

Pagination

Lists are newest first and page by cursor. Pass limit (1–100) and, for the next page, the nextCursor you were given. A cursor stays valid while rows are being added — you will not see an item twice or skip one.

JSON
{
  "object": "list",
  "data": [ … ],
  "hasMore": true,
  "nextCursor": "MjAyNi0wOS0yN1QxMDowMDowMC4wMDBafDBiMWQ…"
}

Idempotency

Creates accept an Idempotency-Key header. Send a unique value — an order id, a UUID — and a retry with the same key returns the first result instead of creating a second payment link. Keys are remembered for 24 hours per API key. Reusing a key for a different request is a 409.

Secret keys never go in a browser

A secret key sent from a page (with an Origin header) is refused, and so is a publishable key on any server route. If a secret key leaks, revoke it in Developers — the old one stops working immediately.

← PreviousDrop-in componentsNext →Customers

On this page

  • Base URL
  • Scopes
  • Responses
  • Pagination
  • Idempotency
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