> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Print-on-demand fulfilment - manage images, virtual inventory products, framing options, pricing, shipping rates and orders.

Use **FinerWorks** through Corsair: one client, typed API calls, local DB sync.

FinerWorks signs every request with two keys: the account's `web_api_key` and an `app_key` for the calling app (create one under Account > API in FinerWorks). Corsair stores the web API key as the tenant's API key and the app key as the account's `app_key` field; you can also pass `appKey` to `finerworks()` to use one app key for every tenant.

**What you get:**

* 33 typed API operations
* 3 synced entities (`images`, `orders`, `virtualInventoryProducts`) for fast `.search()` / `.list()`

## Setup

**1. Install**

```bash npm theme={null}
npm install corsair @corsair-dev/finerworks
```

```bash yarn theme={null}
yarn add corsair @corsair-dev/finerworks
```

```bash pnpm theme={null}
pnpm install corsair @corsair-dev/finerworks
```

```bash bun theme={null}
bun add corsair @corsair-dev/finerworks
```

**2. Add the plugin**

```ts corsair.ts theme={null}
import Database from 'better-sqlite3';
import { createCorsair } from 'corsair';
import { finerworks } from '@corsair-dev/finerworks';

export const corsair = createCorsair({
	plugins: [
		finerworks(),
	],
	database: new Database('corsair.db'),
	kek: process.env.CORSAIR_KEK!,
	hub: {
		projectApiKey: process.env.CORSAIR_API_KEY!,
		signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
	},
});
```

Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](https://docs.corsair.dev/quick-start.md) for KEK + Hub keys, and [Multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md) for account isolation.

**3. Choose authentication**

> [tab] API Key (Recommended)
>
> No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.
>
> ```ts theme={null}
> finerworks()
> ```
>
> More: [API Key](https://docs.corsair.dev/concepts/api-key)

**4. Connect a tenant**

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see [Connect / OAuth](https://docs.corsair.dev/management/connect).

```ts theme={null}
const { connectUrl } = await corsair.manage.connect.createLink({
	plugin: 'finerworks',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**List images in the inventory library**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.finerworks.api.images.list({
	library: { name: 'inventory' },
	per_page: 20,
});
```

**Change a product's asking price**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.finerworks.api.inventory.update({
	virtual_inventory: [{ sku: 'AP1556P79511', asking_price: 200 }],
});
```

See the full list on the [API](https://docs.corsair.dev/plugins/finerworks/api.md) page.

## Query synced data

`orders.fetchStatus` stores each order by `order_id`. `images.list`, `images.add` and `images.update` store images by `guid`, and `inventory.list` and `inventory.update` store products by `sku`.

```ts theme={null}
const tenant = corsair.withTenant('acme');
const rows = await tenant.finerworks.db.orders.search({
	data: { order_status_label: 'In Production' },
	limit: 50,
});
```

Synced entities: `images`, `orders`, `virtualInventoryProducts`. See [Database](https://docs.corsair.dev/plugins/finerworks/database.md) for filters and operators.

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/finerworks/api.md)
>
> Every `finerworks.api.*` operation with input and output types.

> [card] [Database](https://docs.corsair.dev/plugins/finerworks/database.md)
>
> Synced entities, search filters, and operators.

> [card] [Connect / OAuth](https://docs.corsair.dev/management/connect)
>
> createLink, Hub delivery, and tenant connect flows.

> [card] [Use with agents](https://docs.corsair.dev/mcp-adapters/mcp-adapters)
>
> Expose this plugin's operations as MCP tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.