API Reference

API Reference

Base URL: http://localhost:8293.

Use the page outline to jump directly to a route family. Start with Behavior if you are deciding whether a route writes onchain, writes only to MongoDB, or appears in poller-backed history.

This reference covers the server-signed API and automation surface. The product UI under /app is wallet-first: the connected issuer ADMIN writes directly onchain, then registers class, stakeholder, and issuance metadata with the corresponding register-onchain route. Transfers are mirrored by the poller and have no registration route.

⚠️

/stakeholder, /stock-class, and /transactions pass through contract middleware. Server-signed write requests include issuerId in the JSON body. Onchain GET routes currently also resolve the issuer through middleware and therefore require a JSON body; prefer the product read endpoints where available.

Behavior

LabelMeaning
Onchain + DBSends a contract transaction and stores, or later syncs, the OCF record.
Onchain readReads the cap table contract.
DB-onlyReads or writes MongoDB.
HistoryAppears in GET /historical-transactions/issuer-id/:issuerId after polling.

Health routes

Each router mounts a GET that returns text so you can confirm it’s up: GET /, /factory, /issuer, /stakeholder, /stock-class, /cap-table, /stock-legend, /stock-plan, /valuation, /vesting-terms.

Root, factory, issuer

MethodRouteBehaviorRequestReturns
POST/mint-cap-tableOnchain + DBOCF manifest zip as multipart/form-data field file.{ issuer }
POST/factory/registerDB-onlyfactory_address, implementation_address{ factory }
GET/issuer/id/:idDB-onlyPath id.Small issuer lookup.
GET/issuer/total-numberDB-onlyNone.Count.
POST/issuer/createOnchain + DBOCF issuer fields.{ issuer }
POST/issuer/registerDB-onlyOCF issuer fields plus deployed_to, tx_hash, optional bytes16 id.{ issuer }
GET/issuer/full/:idDB-onlyPath id.Full issuer document.
GET/issuer/by-deployer/:addressDB-onlyAdmin wallet address.{ issuers, count }
POST/issuer/summariesDB-only{ ids: string[] }Readiness summaries keyed by issuer ID.
POST/issuer/reconcileDB + onchain readissuerId.Reconciled class/person sync state and transaction hashes.
POST/issuer/poller-catchupPoller controlissuerId, mode.Updated poller cursor state.
{
    "factory_address": "<FACTORY_ADDRESS>",
    "implementation_address": "<IMPLEMENTATION_ADDRESS>"
}

Stakeholder

MethodRouteBehaviorRequestReturns
GET/stakeholder/id/:idOnchain readissuerId, path id.stakeholderId, type, role.
GET/stakeholder/issuer_assigned_id/:idDB-onlyissuerId, path id.Stakeholder document.
GET/stakeholder/issuer/:issuerId/issuer_assigned_id/:idDB-onlyBody issuerId, path issuerId and id.Stakeholder documents.
GET/stakeholder/wallet/:addressOnchain readissuerId, path address.Stakeholder ID.
GET/stakeholder/total-numberOnchain readissuerId.Count.
POST/stakeholder/createOnchain + DBissuerId, data.{ stakeholder }
POST/stakeholder/register-onchainDB metadataWallet-created UUID id, issuerId, data, optional tx_hash.{ stakeholder }
POST/stakeholder/add-walletOnchainissuerId, id, wallet."Success" or "Wallet already added".
POST/stakeholder/remove-walletOnchainissuerId, id, wallet."Success"

Stock class

MethodRouteBehaviorRequestReturns
GET/stock-class/id/:idOnchain readissuerId, path id.stockClassId, classType, pricePerShare, initialSharesAuthorized.
GET/stock-class/total-numberOnchain readissuerId.Count.
POST/stock-class/createOnchain + DBissuerId, data.{ stockClass }
POST/stock-class/register-onchainDB metadataWallet-created UUID id, issuerId, data, optional tx_hash.{ stockClass }

Cap table

MethodRouteBehaviorRequestReturns
GET/cap-table/holdings/stockDB + onchain readQuery issuerId.{ holdings, stockClasses, stakeholders, issuer, meta }

Supporting records

These are DB-only and do not create history rows.

GroupReadCountCreateCreate requestCreate returns
Stock legendGET /stock-legend/id/:idGET /stock-legend/total-numberPOST /stock-legend/createissuerId, data{ stockLegend }
Stock planGET /stock-plan/id/:idGET /stock-plan/total-numberPOST /stock-plan/createissuerId, data{ stockPlan }
ValuationGET /valuation/id/:idGET /valuation/total-numberPOST /valuation/createissuerId, data{ valuation }
Vesting termsGET /vesting-terms/id/:idGET /vesting-terms/total-numberPOST /vesting-terms/createissuerId, data{ vestingTerms }

Historical transactions

MethodRouteBehaviorRequestReturns
GET/historical-transactions/issuer-id/:issuerIdDB-onlyPath issuerId.Populated transaction history.

Controllers

Routes hand off to controllers, which convert OCF data into onchain parameters (UUID → bytes16, prices and quantities scaled by 1e10) before calling CapTable.sol. See the Controllers Reference for per-function detail.

Stock transactions

These are the server-signed transaction routes and require issuerId. The /app UI does not call them: it submits through the connected ADMIN wallet. In particular, UI transfers call CapTable.transferStock directly and rely on the poller for Mongo history.

⚠️

API examples use human share_price.amount or sharePrice values. Raw contract values are scaled by 1e10 (10,000,000,000); divide by 1e10 before comparing. The server and poller handle this automatically — you only need to divide if reading raw contract bytes directly.

RouteBehaviorHistoryRequestReturns
POST /transactions/issuance/stockOnchainYesissuerId, data.{ stockIssuance }
POST /transactions/issuance/stock/register-onchainValidation onlyPoller writes itWallet-issued issuerId, data.Prepared optimistic { stockIssuance }; chain event supplies canonical IDs.
POST /transactions/transfer/stockOnchainYesissuerId, data."success"
POST /transactions/cancel/stockOnchainYesissuerId, data.{ stockCancellation }
POST /transactions/retract/stockOnchainYesissuerId, data.{ stockRetraction }
POST /transactions/reissue/stockOnchainYesissuerId, data.{ stockReissuance }
POST /transactions/repurchase/stockOnchainYesissuerId, data.{ stockRepurchase }
POST /transactions/accept/stockOnchainYesissuerId, data.{ stockAcceptance }
POST /transactions/adjust/issuer/authorized-sharesOnchainYesissuerId, data.new_shares_authorized.{ issuerAuthorizedSharesAdj }
POST /transactions/adjust/stock-class/authorized-sharesOnchainYesissuerId, data.stock_class_id, data.new_shares_authorized.{ stockClassAdjustment }

Offchain issuance records

These are mounted under /transactions, so they need issuerId. They save MongoDB records and do not create history rows.

RouteBehaviorRequestReturns
POST /transactions/issuance/equity-compensationDB-onlyissuerId, data.{ equityCompensationIssuance }
POST /transactions/issuance/convertibleDB-onlyissuerId, data.{ convertibleIssuance }

Request wrapper

Most create routes use:

{
    "issuerId": "<YOUR_ISSUER_ID>",
    "data": {}
}

POST /issuer/create is the exception. Send issuer fields directly.