Skip to Content
DevelopmentTransfer Stock

Transfer Stock

A transfer moves shares of one stock class from one stakeholder to another. Both stakeholders must already exist on the cap table.

In the app

Open the company and choose Transfer (/app/companies/<issuerId>?view=transfer-stock). Your wallet calls transferStock on the cap table. There is no registration step: the poller writes the transfer to MongoDB from the onchain events.

With the API

POST /transactions/transfer/stock transfers with the server key. The server key needs OPERATOR or ADMIN on the cap table; see Server-signed routes. This route takes camelCase fields and skips OCF validation.

curl -s -X POST "$API/transactions/transfer/stock" \ -H "Content-Type: application/json" \ -d @- <<JSON { "issuerId": "$ISSUER_ID", "data": { "transferorId": "$STAKEHOLDER_ID", "transfereeId": "$TO_STAKEHOLDER_ID", "stockClassId": "$STOCK_CLASS_ID", "quantity": "25000", "sharePrice": "5.00", "isBuyerVerified": true } } JSON

The response is "success" once the transaction confirms.

Send human values. The contract stores quantity and sharePrice ×1e10, and the server does the scaling. See Scaling.

Fields

FieldRequiredNotes
transferorIdYesStakeholder giving up the shares. No securities in this class reverts with No active security ids found. A short total reverts with InsufficientShares.
transfereeIdYesStakeholder receiving the shares. Both stakeholders must exist onchain (NoStakeholder) and in MongoDB, or the poller can’t record the transfer.
stockClassIdYesThe class being transferred.
quantityYesNumber of shares, as a string.
sharePriceYesPrice per share for this sale. Must be above zero (InvalidQuantityOrPrice).
isBuyerVerifiedYesSet true after the buyer passes your eligibility checks. false reverts with UnverifiedBuyer.

How lots are consumed

A transfer doesn’t name a security. The contract takes the transferor’s securities in this class in the order they were created until it has the requested quantity. For each security it uses:

  • The transferee gets a new security at the transfer’s price.
  • If only part of the security is used, the transferor gets a balance security for the rest, at the original price.
  • The original security closes.

History shows one StockTransfer row for each security used, plus a StockIssuance row for each new security. Read the new security ids from history after the poller catches up.

What’s next?

Last updated on