Concepts
Product Instances (developer)
Technical reference for the ProductInstance entity - schema, on-chain sync, and ownership model.
A ProductInstance is a numbered, ownable copy of a SmartProduct. It is created on-chain when someone mints the product.
Schema
BigInt fields (instanceId, instanceNumber, feePaid) are serialized to strings over the wire per the SDK convention.
interface ProductInstance {
id: number;
productId: number;
instanceId: string; // on-chain token id (BigInt as string)
instanceNumber: string; // 1-based on-chain serial number (BigInt as string)
ownerAddress: string; // Current owner address
minterAddress: string | null; // Who minted it; unchanged by a transfer
status: InstanceTransactionStatus;
currencyType: InstanceCurrencyType;
feePaid: string; // BigInt as string
txId: string;
mintTxId: string | null;
burnTxId: string | null;
burnedAt: string | null;
tokenUri: string;
detachedTokenUri: string | null; // permanent URL once the owner detaches (detachable capability)
detachedLocked?: boolean; // owner froze the override permanently (lock-detached)
isFeatured: boolean;
instanceConfig: { version: number } & Record<string, unknown>; // per-edition capability data
archival?: { state: string; reason?: string }; // saved / archiving / archived ...; see Storage
bracketEntryDetails?: BracketEntryDetails | null; // PREDICTION entries
gameMatchDetails?: GameMatchDetails | null; // GAME matches
createdAt: string;
updatedAt: string;
product?: SmartProduct; // populated with ?include=page
}
type InstanceTransactionStatus = "PENDING" | "CONFIRMED" | "FAILED";
type InstanceCurrencyType = "STX" | "SBTC";On-chain sync
The protocol API does not create instances directly. Instance creation is triggered by the blockchain:
- User signs a mint transaction via the SDK
- Transaction confirms on the blockchain
- The MINT Chainhook fires
- The API creates the
ProductInstancerow
API endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/smart-products/:id/instances | List instances for a product |
GET | /api/smart-products/:id/instances/:instanceId | Get a specific instance |
GET | /api/users/address/:address/instances | List instances owned by a user |
Rendering
Each instance renders using the parent SmartProduct's StyleSet. The instanceNumber is a data binding in the SVG template. See Style Sets.