REST API · OpenAPI 3.1 · OAuth 2.0

API-first, not API-eventually.

Every wholesale-specific entity in Mercantyl is a first-class REST resource: buyer accounts, contract pricing, NET terms, RFQs, the pricing engine, webhooks. If you can do it in the admin panel, you can do it from a script.

Quickstart

Authenticate with your API key, fetch your products, list a buyer account, submit an order. Five requests.

Authenticate

curl https://api.mercantyl.co/v1/auth/whoami \
  -H "Authorization: Bearer mck_live_..."

# {"account_id":"acc_01HF...","plan":"professional","api_version":"v1"}

List products

curl https://api.mercantyl.co/v1/products?limit=20 \
  -H "Authorization: Bearer mck_live_..."

# {
#   "data": [
#     {
#       "id": "prd_01HF...",
#       "sku": "TRAY-AL-001",
#       "name": "Aluminum Rolling Tray",
#       "variants": [...],
#       "tier_pricing": [{"min_qty": 1, "price_cents": 4200}, ...]
#     }
#   ],
#   "has_more": true,
#   "next_cursor": "..."
# }

Create a buyer account

curl https://api.mercantyl.co/v1/buyers \
  -H "Authorization: Bearer mck_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Northline Supply Co.",
    "primary_contact": {"email": "buyer@pacificmerchants.com"},
    "credit_limit_cents": 5000000,
    "net_terms": "net_60",
    "tier": "premium"
  }'

Submit an order on behalf of a buyer

curl https://api.mercantyl.co/v1/orders \
  -H "Authorization: Bearer mck_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "buyer_id": "buy_01HF...",
    "line_items": [
      {"product_id": "prd_01HF...", "variant_id": "var_01HF...", "quantity": 500}
    ],
    "shipping_address_id": "adr_01HF...",
    "payment_method": "net_60"
  }'

Subscribe to a webhook

curl https://api.mercantyl.co/v1/webhooks \
  -H "Authorization: Bearer mck_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourapp.example/webhooks/mercantyl",
    "events": ["order.created", "order.paid", "quote.requested"],
    "signing_secret": "whsec_..."
  }'

API resources

Products & variants

CRUD products, variants, inventory, pricing tiers. Bulk import via CSV or stream.

Buyers & accounts

Buyer accounts, members, RBAC, contract pricing assignments, credit limits.

Orders & POs

Submit orders, fetch POs, manage approvals, track fulfillment status.

Quotes & RFQs

Create quotes, convert to orders, fetch RFQ history, send buyer-ready PDFs.

Webhooks

Subscribe to lifecycle events: order.created, order.paid, order.shipped, quote.requested, lock.expired.

Reports & exports

GMV reports, buyer activity, pricing override audit, scheduled CSV exports.

Rate limits & guarantees

Throughput

  • 10,000 requests/minute on Professional+
  • Bulk endpoints accept arrays of up to 1,000 records
  • Streaming exports for catalogs > 50K SKUs
  • Webhook fanout: ≤200ms p99 from event to delivery

Stability

  • API versioned via URL (/v1); breaking changes only on major bumps
  • OpenAPI 3.1 spec for codegen pipelines
  • Webhook signing secret on every event for verification
  • Automated daily backups with point-in-time recovery

Authentication

API keys

Issue scoped keys per integration. Restrict by resource (read-only products), by IP, by environment (test vs live). Rotate from the dashboard with zero downtime.

OAuth 2.0

For partner integrations and apps acting on behalf of merchants. Authorization code + refresh token flow. Scopes match API resource permissions.

Build something great.

Get an API key in your free trial. No approval, no sales call, no rate-limit handshake. Build, ship, scale.