Skip to main content
Send your API key on every call. Each endpoint needs one scope on that key. Anyone who holds the key can read your prices and create orders in your name, so it lives on your server only.

Send the key

Use either header; Authorization is preferred:
Keys are mk_test_… for the sandbox and mk_live_… for production, and each works only in its own environment. A key prices the catalogue for your own account, so another partner can see a different group_price for the same product.

Scopes

A key without the scope an endpoint needs gets 403 insufficient_scope, with error.details.required_scope. The check runs before the rate limit, so the refusal uses none of your budget. Retrying does not help: ask Mart to add the scope. GET /account needs no scope. Each operation in the API reference names its scope in x-required-scope. Keys made before scopes existed keep exactly their old access. On order writes they still get 422 orders_not_enabled, never a 403, and a card order without card payment gets 422 card_not_enabled. Where withdrawals are off, their money writes get 403 withdrawals_disabled.

Read what your account may do

Call GET /api/v1/account at startup instead of learning from refusals. A closed account’s key can still read your money and ask to withdraw, but cannot change the payout method or place orders.

Keep the key safe

  1. Keep it in a secrets manager or a server-side environment variable.
  2. Never put it in client-side code, a mobile app, a repository or a URL.
  3. Call the API from your server only, never from a browser.
  4. If a key is exposed, tell Mart: Mart issues a replacement.
Treat every 401 as “stop and alert a person”, never as something to retry. A paused or revoked key answers exactly like an unknown one.

Troubleshooting