API Reference

API Reference

Base URL: http://localhost:8293.

/stakeholder, /stock-class, and /transactions pass through contract middleware. Include issuerId in the JSON body, even on GET requests.

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 }
{
    "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/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 }

Cap table

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

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 10000) before calling CapTable.sol. See the Controllers Reference for per-function detail.

Stock transactions

All require issuerId.

⚠️

API examples use human share_price.amount or sharePrice values. Raw contract values are scaled by 10000; divide before comparing.

RouteBehaviorHistoryRequestReturns
POST /transactions/issuance/stockOnchainYesissuerId, data.{ stockIssuance }
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.