Deploy and Mint a Deposit Token via API

Step-by-step guide for creating and minting deposit tokens using the ATK REST API

PREREQUISITES

  1. Platform URL – e.g., https://your-platform.example.com
  2. Running ATK environment – DALP services + Portal
  3. Account with PINCODE – enable in /account/profile
  4. Admin role – to grant yourself system permissions
  5. Deposit product design – term structure, denomination asset, early withdrawal settings from the user guide
  6. Vault + denomination asset plan – know the ERC-20 currency you will lock in DALP vaults (USDC, institutional stablecoin, etc.)

You'll need:

  • Wallet address (from Step 2)
  • Deposit decimals that match the denomination asset (the user guide emphasizes matching decimals to avoid accounting drift)
  • priceCurrency (ISO currency code) and basePrice (string) for liability tracking dashboards

Quick reference

StepWhatEndpoint
1Sign inPOST /api/auth/sign-in/email
2Get user infoGET /api/user/me
3Grant system rolesSet Up Roles guide
4Create deposit tokenPOST /api/token/create (type: "deposit")
5Grant token rolesPOST /api/token/grant-role (Set Up Roles Step 4)
6UnpausePOST /api/token/{contract}/unpause
7Mint deposit certificatesPOST /api/token/{contract}/mint
8Verify holders/liabilityGET /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"
  }'

Step 2: capture wallet + PIN status

curl -s YOUR_PLATFORM_URL/api/user/me \
  -b cookies.txt | jq '.'

Make sure pincodeEnabled is true; copy the wallet.


Step 3: grant system roles

Deposit factories require the tokenManager role. If you plan to automate collateral attestation or custom compliance, also grant claimPolicyManager or complianceManager.

Use Set Up Roles Step 2 (admin only); it contains the exact grant-roles request, so reuse it with the role name you need.


Step 4: create the deposit token

curl -v -X POST YOUR_PLATFORM_URL/api/token/create \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "type": "deposit",
    "name": "12M USD CD",
    "symbol": "CD12",
    "decimals": 2,
    "countryCode": "840",
    "priceCurrency": "USD",
    "basePrice": "1.00",
    "initialModulePairs": [],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Field mapping to the user guide:

  • decimals: Match the denomination asset decimals (guide section “Denomination asset selection”).
  • priceCurrency / basePrice: Store the fiat price per certificate for treasury dashboards (e.g., USD 1.00 for par value).
  • initialModulePairs: Plug in compliance/withdrawal modules once your treasury policies are finalized; keep [] for default enforcement and configure later.

Expected: 200 OK with the deposit contract address (id). The response also carries identity claims that record the base price for liability tracking.

Vault linking, denomination asset approvals, and early-withdrawal automation continue via the workflows described in the deposit user guide. This API guide covers contract deployment plus minting.


Step 5: grant token roles

curl -v -X POST YOUR_PLATFORM_URL/api/token/grant-role \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_DEPOSIT_CONTRACT",
    "address": "YOUR_WALLET_ADDRESS",
    "roles": ["supplyManagement", "emergency"],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Grant supplyManagement for mint/burn and emergency for pause control—mirrors the manual wizard’s “Operations team” assignment.


Step 6: unpause

curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_DEPOSIT_CONTRACT/unpause \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_DEPOSIT_CONTRACT",
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Step 7: mint deposit certificates

curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_DEPOSIT_CONTRACT/mint \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_DEPOSIT_CONTRACT",
    "recipients": ["RECIPIENT_WALLET"],
    "amounts": ["5000000"],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

With 2 decimals (USD-style), "5000000" = 50,000.00 units. Use the same scaling when minting to vault-controlled accounts after the subscription workflow approves deposits.


Step 8: verify holders & pricing claims

curl -s YOUR_PLATFORM_URL/api/token/YOUR_DEPOSIT_CONTRACT/holders?tokenAddress=YOUR_DEPOSIT_CONTRACT \
  -b cookies.txt | jq '.'

Balances will line up with depositor positions shown in the Asset Management view; claims include the base price used by treasury dashboards.


FULL SCRIPT

#!/bin/bash

EMAIL="YOUR_EMAIL"
PASSWORD="YOUR_PASSWORD"
PINCODE="YOUR_PINCODE"
RECIPIENT="RECIPIENT_WALLET"
BASE_URL="YOUR_PLATFORM_URL"

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

USER=$(curl -s $BASE_URL/api/user/me -b cookies.txt)
WALLET=$(echo $USER | jq -r '.wallet')
echo "Wallet: $WALLET"

CREATE=$(curl -s -X POST $BASE_URL/api/token/create \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"type\":\"deposit\",\"name\":\"12M USD CD\",\"symbol\":\"CD12\",\"decimals\":2,\"countryCode\":\"840\",\"priceCurrency\":\"USD\",\"basePrice\":\"1.00\",\"initialModulePairs\":[],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")

CONTRACT=$(echo $CREATE | jq -r '.id')
echo "Deposit contract: $CONTRACT"

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

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

MINT=$(curl -s -X POST $BASE_URL/api/token/$CONTRACT/mint \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"contract\":\"$CONTRACT\",\"recipients\":[\"$RECIPIENT\"],\"amounts\":[\"5000000\"],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")
echo $MINT | jq '.'

curl -s $BASE_URL/api/token/$CONTRACT/holders?tokenAddress=$CONTRACT -b cookies.txt | jq '.token.balances'

Amount calculations

  • 2 decimals (typical CDs aligned with USD stablecoins):
    • 1.00 unit → 100
    • 10.00 units → 1000
    • 50,000.00 units → 5000000
  • 18 decimals (if you run high-precision certificates) follow the ERC-20 pattern amount * 10^18.

Formula: on-chain amount = deposit_units * 10^decimals.


Troubleshooting

  • "tokenManager required" → Grant system role via Set Up Roles Step 2.
  • "PINCODE_INVALID" → Reconfirm your PIN.
  • "Token is paused" → Run Step 6 and ensure emergency role is assigned.
  • "Permission denied" during mint → Verify supplyManagement role through GET /api/token/{contract}.
  • "Invalid country code" → Provide a numeric ISO 3166-1 code (840, 056, 276, etc.).
  • Mismatched decimals vs. denomination asset → Align decimals with the ERC-20 you plan to lock in vaults as described in the deposit guide’s “Denomination asset selection.”
  • Need jq?brew install jq (macOS) or apt install jq (Debian/Ubuntu).