Skip to main content
V2 Preview — This authentication flow is part of the V2 API preview. Breaking changes may occur.

Overview

All V2 Merchant API endpoints require a JWT token passed via the x-access-token header. You obtain the token by exchanging your merchant API key at POST /authenticate. Merchant API keys start with mk_live_ (or mk_test_ for test mode) and are created in the PuppetVendors admin under Settings → API Access. The full key is revealed once at creation.

Authenticating

200
  • scope is "merchant" for merchant tokens — vendor keys (vk_) authenticate at the same endpoint but return "vendor" scope
  • The key’s prefix determines the token scope: mk_ keys mint merchant-scoped tokens with the admin:users, admin:vendors, and admin:payouts permissions

Using the Token

Include the token in all subsequent requests via the x-access-token header. Send the token value directly, with no Bearer prefix:

Token Expiry & Refresh

Merchant tokens expire after 14 days (1209600 seconds). Use POST /refresh-token with a valid (non-expired) token to get a new one without re-authenticating:
Revoking the key refuses the next request made with any token minted from it.

Verifying a Key

POST /verify is a side-effect-free probe: it confirms the key is valid and reachable and returns the scope, mode, and identity it carries, but does not issue a JWT or count as a use (lastUsedAt is unchanged). Any key that passes /verify will also pass /authenticate.

Key Rotation & Revocation

  • Rotate a key in Settings → API Access — the previous key keeps working for a 24-hour grace window, so a rotation is an overlap rather than a cutover
  • Revoke a key to immediately refuse any token minted from it

Scope Behaviour

Merchant tokens administer the whole shop: vendor management, user management, and payout adjustments across all vendors. Endpoints outside the merchant surface (orders, products, payouts, fulfillments, documents) return HTTP 403 — those stay on the V1 API token.