Skip to Content

Accept Stock

An acceptance records that a stakeholder accepted a security. It adds a StockAcceptance history row and doesn’t change holdings. Issue the stock first with Issue Stock.

Find the security id

The contract assigns each security’s id, so read it from the issuance’s history row once the poller has written it:

curl -s "$API/historical-transactions/issuer-id/$ISSUER_ID" \ | jq '[.[] | select(.transactionType == "StockIssuance") | .transaction | {security_id, stakeholder_id, stock_class_id, quantity}]'

The security must still be live. A transfer, cancellation, retraction, reissue, or repurchase closes the security it acts on. When a partial cancel, repurchase, or transfer leaves shares behind, the remainder is a new security with its own StockIssuance row.

export SECURITY_ID="<security_id from history>"

Accept the security

The server key needs OPERATOR or ADMIN; see Server-signed routes.

curl -s -X POST "$API/transactions/accept/stock" \ -H "Content-Type: application/json" \ -d @- <<JSON { "issuerId": "$ISSUER_ID", "data": { "stakeholderId": "$STAKEHOLDER_ID", "stockClassId": "$STOCK_CLASS_ID", "security_id": "$SECURITY_ID", "comments": ["Accepted by the stakeholder"] } } JSON

The response echoes the acceptance with a placeholder id and today’s UTC date. The contract assigns the real id, which appears in the StockAcceptance history row after the poller’s next pass.

RevertCause
NoStakeholderThe stakeholder isn’t onchain.
InvalidStockClassThe stock class isn’t onchain.
NoActivePositionFoundThe stakeholder doesn’t hold that security, or it was closed.

What’s next?

Last updated on