Getting started

Authentication

Every request carries an API key in the Authorization header. The key identifies your business and decides what the request may touch.

curl "https://api.malla.fun/orders" \
-H "Authorization: Bearer mk_live_..."

API keys

Owners create keys in Settings → Developers → API keys.

  • Format: mk_live_<id>_<secret>. Malla stores only a hash of the secret, so the full key is shown once, when you create or regenerate it.
  • Expiration: 7, 30, 90 or 365 days, or never. An expired key answers 401 like an invalid one.
  • Limit: up to 25 active keys per business. Use one key per integration so you can revoke them independently.
  • Notifications: owners get an email whenever a key is created or regenerated.
  • Propagation: revoking, regenerating or changing a key's permissions takes effect everywhere within 30 seconds.

The key decides the business: there's no business id to send. If a request carries both a dashboard session and a key, the key wins.

Scopes

Keys are scoped per resource, like GitHub's fine-grained tokens. Each resource gets no access, read or read & write; write includes read. GET requests need read; POST, PUT, PATCH and DELETE need write.

Scope Resource Routes Max access
products Products: Products, variants, options, images and inventory. /products, /media Read & write
collections Collections: Collections and their products. /collections Read & write
categories Categories: Category tree and product assignment. /categories Read & write
orders Orders: Orders: create, quote, change status. /orders Read & write
payment_links Payment links: Create and look up payment links. /payment-links Read & write
customers Customers: Customers (CRM), notes and tags. /customers Read & write
discounts Discounts: Discount codes. /discounts Read & write
conversations Conversations: WhatsApp conversations and sending messages. /conversations Read & write
payouts Payouts: Balance and settlement history. /settlements Read only
webhooks Webhooks: Webhook endpoints and their deliveries. /webhook-endpoints Read & write
business Business: Business details and dashboard summary. /dashboard Read only

Routes not listed (team members, payout account, API keys, the WhatsApp bot settings...) can't be reached with a key at all: they answer 403 forbidden_for_api_keys.

Plan

The developer API is included from the Business plan. Below it, every key request answers 403 plan_required.

Auth errors

Status error Meaning
401 invalid_api_key Missing, malformed, unknown, revoked or expired key (always the same error, on purpose).
403 insufficient_scope The key lacks a scope. The body says which: { "error": "insufficient_scope", "required": "orders:write" }.
403 forbidden_for_api_keys The route can't be used with API keys.
403 plan_required The business's plan doesn't include the developer API.
429 rate_limited Over 300 requests per minute for this key. See Rate limits.