Deploy and Mint Equity via API
Step-by-step guide for creating and minting equity tokens using the ATK REST API
PREREQUISITES
Before running these commands:
- Platform URL – e.g.,
https://your-platform.example.com - Running ATK instance – local or hosted with DALP services up
- Account with PINCODE – enable in
Account Settings → Security - Admin role – needed to grant yourself system roles
- Share class design – finalized parameters from the Issue an equity guide (decimals, voting rules, compliance framework)
- Compliance modules – know which OnchainID claims map to your regulatory framework (Reg D, Reg S, Reg A+, custom)
You'll need:
- Wallet address (captured in Step 2)
- Equity
class(COMMON_EQUITY,PREFERRED_EQUITY, etc.) andcategory(VOTING_COMMON_STOCK,DUAL_CLASS_SHARES, etc.) from the platform taxonomy - Optional ISIN (
uniqueIdentifier) if your share class is registered
Quick reference
| Step | What | Endpoint |
|---|---|---|
| 1 | Sign in | POST /api/auth/sign-in/email |
| 2 | Get user info | GET /api/user/me |
| 3 | Grant system roles | Set Up Roles guide |
| 4 | Create equity token | POST /api/token/create (type: "equity") |
| 5 | Grant token roles | POST /api/token/grant-role (from Set Up Roles Step 4) |
| 6 | Unpause token | POST /api/token/{contract}/unpause |
| 7 | Mint shares | POST /api/token/{contract}/mint |
| 8 | Verify holders and metadata | GET /api/token/{contract}/holders |
STEP-BY-STEP COMMANDS
Step 1: sign in
curl -v -X POST YOUR_PLATFORM_URL/api/auth/sign-in/email \
-H "Content-Type: application/json" \
-c cookies.txt \
-d '{
"email": "YOUR_EMAIL",
"password": "YOUR_PASSWORD"
}'Expected: 200 OK, session cookie saved to cookies.txt
Step 2: capture your wallet
curl -s YOUR_PLATFORM_URL/api/user/me \
-b cookies.txt | jq '.'Expected: JSON with wallet, pincodeEnabled: true, and your organization info.
Step 3: grant system roles
You need the tokenManager system role to deploy equity contracts.
Follow the Set Up Roles guide Step 2 to grant tokenManager to your wallet (only admins can run that endpoint); that section provides the exact grant-roles payload you can reuse here.
If your compliance flow requires custom claim topics (Reg D vs. Reg S, KYC tiers, ROFR modules), grant complianceManager at the same time.
Step 4: create the equity token
curl -v -X POST YOUR_PLATFORM_URL/api/token/create \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"type": "equity",
"name": "Series B Voting Shares",
"symbol": "SBVS",
"decimals": 0,
"countryCode": "840",
"priceCurrency": "USD",
"basePrice": "10.00",
"class": "COMMON_EQUITY",
"category": "VOTING_COMMON_STOCK",
"uniqueIdentifier": "US0378331005",
"initialModulePairs": [],
"walletVerification": {
"secretVerificationCode": "YOUR_PINCODE",
"verificationType": "PINCODE"
}
}'Parameters:
decimals: Use0for whole-share cap table parity (per the equity user guide) or18for fractionalized ownership.priceCurrency/basePrice: Store reference valuation claims (e.g., USD 10.00) used by analytics dashboards.class: One of theequityClassesvalues (COMMON_EQUITY,PREFERRED_EQUITY,SECTOR_INDUSTRY_EQUITY, etc.).category: One of theequityCategoriesvalues (VOTING_COMMON_STOCK,DUAL_CLASS_SHARES, etc.).uniqueIdentifier: Optional ISIN for reporting; omit for private or pre-ISIN rounds.initialModulePairs: Compliance module pairs from your onboarding wizard (leave[]for defaults and configure later).
Expected: 200 OK with id (equity contract address) plus identity claims capturing the price data and optional ISIN.
Step 5: grant token roles
Give yourself minting and unpause powers:
curl -v -X POST YOUR_PLATFORM_URL/api/token/grant-role \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"contract": "YOUR_EQUITY_CONTRACT",
"address": "YOUR_WALLET_ADDRESS",
"roles": ["supplyManagement", "emergency"],
"walletVerification": {
"secretVerificationCode": "YOUR_PINCODE",
"verificationType": "PINCODE"
}
}'supplyManagement lets you mint/burn; emergency lets you unpause. Add governance if you plan to change compliance modules or ROFR settings via API.
Step 6: unpause the equity
curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_EQUITY_CONTRACT/unpause \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"contract": "YOUR_EQUITY_CONTRACT",
"walletVerification": {
"secretVerificationCode": "YOUR_PINCODE",
"verificationType": "PINCODE"
}
}'Expected: 200 OK. Required before any transfers or minting.
Step 7: mint shares
curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_EQUITY_CONTRACT/mint \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"contract": "YOUR_EQUITY_CONTRACT",
"recipients": ["RECIPIENT_WALLET"],
"amounts": ["100"],
"walletVerification": {
"secretVerificationCode": "YOUR_PINCODE",
"verificationType": "PINCODE"
}
}'- When
decimals = 0, amounts are literal share counts (e.g.,"100"= 100 shares). - If you used 18 decimals, scale by
10^18like any ERC-20 ("100000000000000000000"= 100 shares).
Step 8: verify holders
curl -s YOUR_PLATFORM_URL/api/token/YOUR_EQUITY_CONTRACT/holders?tokenAddress=YOUR_EQUITY_CONTRACT \
-b cookies.txt | jq '.'You should see the recipient with the minted balance plus identity claims that include the price reference, share class, and any compliance metadata.
FULL SCRIPT
#!/bin/bash
EMAIL="YOUR_EMAIL"
PASSWORD="YOUR_PASSWORD"
PINCODE="YOUR_PINCODE"
RECIPIENT="RECIPIENT_WALLET"
BASE_URL="YOUR_PLATFORM_URL"
echo "Sign in..."
curl -s -X POST $BASE_URL/api/auth/sign-in/email \
-H "Content-Type: application/json" \
-c cookies.txt \
-d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\"}" > /dev/null
echo "Get user info..."
USER=$(curl -s $BASE_URL/api/user/me -b cookies.txt)
WALLET=$(echo $USER | jq -r '.wallet')
echo " Wallet: $WALLET"
echo "Grant system role tokenManager if needed (Set Up Roles Step 2)."
echo "Create equity..."
CREATE_RESPONSE=$(curl -s -X POST $BASE_URL/api/token/create \
-H "Content-Type: application/json" \
-b cookies.txt \
-d "{\"type\":\"equity\",\"name\":\"Series B Voting Shares\",\"symbol\":\"SBVS\",\"decimals\":0,\"countryCode\":\"840\",\"priceCurrency\":\"USD\",\"basePrice\":\"10.00\",\"class\":\"COMMON_EQUITY\",\"category\":\"VOTING_COMMON_STOCK\",\"uniqueIdentifier\":\"US0378331005\",\"initialModulePairs\":[],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")
CONTRACT=$(echo $CREATE_RESPONSE | jq -r '.id')
echo " Equity contract: $CONTRACT"
echo "Grant token roles (supplyManagement + emergency)..."
curl -s -X POST $BASE_URL/api/token/grant-role \
-H "Content-Type: application/json" \
-b cookies.txt \
-d "{\"contract\":\"$CONTRACT\",\"address\":\"$WALLET\",\"roles\":[\"supplyManagement\",\"emergency\"],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}" > /dev/null
echo "Unpause..."
curl -s -X POST $BASE_URL/api/token/$CONTRACT/unpause \
-H "Content-Type: application/json" \
-b cookies.txt \
-d "{\"contract\":\"$CONTRACT\",\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}" > /dev/null
echo "Mint 100 shares..."
MINT_RESPONSE=$(curl -s -X POST $BASE_URL/api/token/$CONTRACT/mint \
-H "Content-Type: application/json" \
-b cookies.txt \
-d "{\"contract\":\"$CONTRACT\",\"recipients\":[\"$RECIPIENT\"],\"amounts\":[\"100\"],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")
echo $MINT_RESPONSE | jq '.'
echo "Check holders..."
curl -s $BASE_URL/api/token/$CONTRACT/holders?tokenAddress=$CONTRACT -b cookies.txt | jq '.token.balances'Amount calculations
- Decimals = 0 (recommended for cap table parity): amount strings equal actual share counts (
"1"= 1 share). - Decimals = 18 (fractionalized equity): scale by
10^18. Examples—"1000000000000000000"= 1 share,"100000000000000000000"= 100 shares.
General formula: on-chain amount = desired_shares * 10^decimals.
Troubleshooting
- "tokenManager required" → Grant the system role via Set Up Roles Step 2.
- "Token is paused" → Ensure you ran Step 6 and that your wallet holds the
emergencyrole. - "Invalid enum value" for
classorcategory→ Use values from the platform taxonomy (COMMON_EQUITY,PREFERRED_EQUITY,VOTING_COMMON_STOCK, etc.). - "PINCODE_INVALID" → Re-check the PIN under
/account/profile. - "Permission denied" during mint/unpause → Re-run the
grant-rolecall to ensuresupplyManagement/emergencyare set. - Need
jq→ Install withbrew install jq(macOS) orapt install jq(Debian/Ubuntu).