Server only. Import from
@quickshops/sdk/merchant. Never call useMerchant() from a "use client" file or the browser. Requires a trial or Pro API key (HEADLESS_API_KEY).useMerchant() (alias of createMerchantClient) is the merchant-ops counterpart to useStore(). Use it when an agent or backend needs to mutate catalog or fulfill orders without opening the dashboard.
Install
Requires@quickshops/sdk@1.3.0+ (includes the @quickshops/sdk/merchant export):
Create a client
lib/merchant.ts
HEADLESS_API_KEY and optional HEADLESS_API_URL (default https://api.quickshops.app).
Methods
Example: create a digital product
Example: ship and refund
Errors
Failed calls throwQuickshopsMerchantError with statusCode, message, and the API code (for example VALIDATION_ERROR).
When to use what
Interactive HTTP details live under API → Catalog and the Orders pages in the sidebar (generated from OpenAPI).