Mint Tokens
Mint tokens by creating an order with a funding asset. Minting sends an equivalent amount of the destination token to the wallet you specify. See the Guide.
-
The Mint API uses BitGo v2 HMAC authentication. To generate the
hmacheader dynamically, create an environment with the variableBITGO_ACCESS_TOKENset to your access token, then add the following pre-request script: -
View the tokens available to your enterprise, including mint minimums, fees, and your role for each token. The response includes the chain-scoped asset IDs you need when choosing an asset pair and creating the order. The following example passes the testnet base URL and returns testnet asset IDs. To see production asset IDs, call the production base URL (
https://app.bitgo.com). -
List the configured exchange pairs for your enterprise, with per-pair minimums, decimal precision, and fees. For a mint, find the pair, the
sourceis the funding asset and thedestinationis the token you're minting. Usesource.decimalsto convert full-unit amounts to base units in the next step. You can pass the optionaltokenquery parameter to filter pairs by logical token name. The following example passes the testnet base URL and returns testnet asset IDs. To see production asset IDs, call the production base URL (https://app.bitgo.com). -
Ensure precision during on-chain transactions by using base units (integers). Using base units accounts for the fiat currency decimal places, enabling the smart contract to process the value without floating-point errors. Formula: Base Units = Amount * 10Decimals Example (USD): This example uses a deposit of 100 USD for an asset with 2 decimals:
- Amount: 100
- Decimals: 2
- Calculation: 100 * 10² = 10,000
- Result: 10,000 base units
-
The following example shows the minimum required parameters for minting an asset.
-
Retrieve the real-time status and detailed metadata for the mint order. Poll this endpoint until the order reaches
FULFILLEDorFAILED. -
Repeat the
idparameter to fetch a specific set of orders in one call. This is the efficient way to refresh many known orders at once.
// 1. Configure HMAC
// Use the JavaScript tab for this step
// 2. List Supported Tokens
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
https://app.bitgo-test.com/api/mint/v1/enterprise/$ENTERPRISE_ID/supported-tokens \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 3. List Asset Pairs
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
https://app.bitgo-test.com/api/mint/v1/enterprise/$ENTERPRISE_ID/asset-pairs \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 4. Calculate Mint Amount
# Calculate programmatically
DECIMALS=2 # From assets API response
AMOUNT_BASE_UNITS=$(($AMOUNT_IN_FULL_UNITS * 10**$DECIMALS))
echo "Amount in base units: $AMOUNT_BASE_UNITS"
// 5. Create Mint Order
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export SOURCE_ASSET="<ASSET_ID>"
export SOURCE_AMOUNT="<SOURCE_AMOUNT>"
export SOURCE_WALLET_ID="<YOUR_WALLET_ID>"
export DESTINATION_ASSET="<DESTINATION_ASSET>"
export DESTINATION_WALLET_ID="<DESTINATION_WALLET_ID>"
curl -X POST \
https://app.bitgo-test.com/enterprise/$ENTERPRISE_ID/orders \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"source": {
"asset": "'"$SOURCE_ASSET"'",
"amount": "'"$SOURCE_AMOUNT"'",
"walletId": "'"$SOURCE_WALLET_ID"'",
"type": "GO_ACCOUNT"
},
"destination": {
"asset": "'"$DESTINATION_ASSET"'",
"walletId": "'"$DESTINATION_WALLET_ID"'",
"type": "GO_ACCOUNT"
}
}'
// 6. Send Mint Order
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ADDRESS="<ADDRESS>"
export AMOUNT="<AMOUNT>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"
export SEQUENCE_ID="<ORDER_ID>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/$WALLET_ID/sendcoins \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"address": "'"$ADDRESS"'",
"amount": "'"$AMOUNT"'",
"walletPassphrase": "'"$WALLET_PASSPHRASE"'",
"sequenceId": "'"$SEQUENCE_ID"'" # The ID from the Create Mint Order results
}'
// 7. Check Order Status
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export ORDER_ID="<YOUR_ORDER_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
https://app.bitgo-test.com/enterprise/$ENTERPRISE_ID/orders/$ORDER_ID \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 8. Bulk Fetch Orders by ID (Optional)
curl -X GET \
https://app.bitgo-test.com/enterprise/$ENTERPRISE_ID/orders \
-H 'accept: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 1. Configure HMAC
const crypto = require('crypto-js');
const rawToken = pm.environment.get('BITGO_ACCESS_TOKEN');
const url = new URL(pm.request.url.toString());
// Include query params in the path (auth-service uses x-original-uri, which includes them).
const urlPath = url.pathname + url.search;
// GET requests have no body; POST/PUT and others need compact JSON.
let body = '';
if (pm.request.method !== 'GET' && pm.request.body && pm.request.body.raw) {
body = JSON.stringify(JSON.parse(pm.request.body.raw));
}
const timestamp = Date.now().toString();
// v2 HMAC subject: timestamp|urlPath|body
const subject = [timestamp, urlPath, body].join('|');
const hmac = crypto.HmacSHA256(subject, rawToken).toString(crypto.enc.Hex);
const tokenHash = crypto.SHA256(rawToken).toString(crypto.enc.Hex);
pm.request.headers.upsert({ key: 'Authorization', value: 'Bearer ' + tokenHash });
pm.request.headers.upsert({ key: 'auth-timestamp', value: timestamp });
pm.request.headers.upsert({ key: 'bitgo-auth-version', value: '2.0' });
pm.request.headers.upsert({ key: 'hmac', value: hmac });
// 2. List Supported Tokens
// Use the cURL tab for this step
// 3. List Asset Pairs
// Use the cURL tab for this step
// 4. Calculate Mint Amount
const fromAmount = (100 * Math.pow(10, usdAsset.decimals)).toString(); // 100 USD in base units
// 5. Create Mint Order
// Use the cURL tab for this step
// 6. Send Mint Order
const wallet = await bitgo.coin('ofctusd').wallets().get({ id: walletId });
await wallet.sendMany({
recipients: [{ address: treasuryWalletId, amount: fromAmount }],
sequenceId: order.id,
walletPassphrase,
});
// 7. Check Order Status
// Use the cURL tab for this step
// 8. Bulk Fetch Orders by ID (Optional)
// Use the cURL tab for this step
// 2. List Supported Tokens Response
{
"tokens": [
{
"token": "usd1",
"assets": [
"hteth:usd1",
"tbsc:usd1",
"tsol:usd1"
],
"type": "stablecoin",
"minimumMintAmount": "1.5",
"minimumBurnAmount": "1.5",
"mintFeeBps": "5",
"burnFeeBps": "5",
"description": "A stablecoin backed by US dollar reserves",
"role": "issuer",
"issuerOrdersEnabled": true,
"name": "USD1"
}
]
}
// 3. List Asset Pairs Response
{
"assetPairs": [
{
"source": {
"asset": "tfiatusd",
"minimumAmount": "100000000",
"decimals": 6
},
"destination": {
"asset": "hteth:usd1",
"decimals": 2
},
"fee": {
"basisPoints": "5"
}
}
]
}
// 5. Create Mint Order Response
{
"id": "95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"userId": "user-123",
"status": "CREATED",
"enterpriseId": "67bc4ae090e8af8f9b412d3d67e85252",
"source": {
"asset": "tfiatusd",
"amount": "100000000",
"type": "GO_ACCOUNT",
"walletId": "67bc4b03..."
},
"destination": {
"asset": "hteth:usd1",
"type": "GO_ACCOUNT",
"address": "0x123456789abcdef123456789abcdef123456789a",
"walletId": "67bc4b038f5408faefbfc8edcf6e6577",
"transferId": "6437d9f07d6a87000613e6c06e4218d3",
},
"createdAt": "string",
"updatedAt": "string",
"idempotencyKey": "mint-order-2025-04-04-001",
"depositInstructions": {
"type": "GO_ACCOUNT",
"asset": "string",
"sequenceId": "order-deposit:95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"address": "0x123456789abcdef123456789abcdef123456789a"
},
"createdAt": "2025-04-04T09:25:48.216Z",
"updatedAt": "2025-04-04T09:25:48.216Z"
}
// 6. Send Mint Order Response
{
"coin": "tfiatusd",
"transfers": [
{
"id": "transfer_id_12345",
"coin": "tfiatusd",
"wallet": "67bc4b03...",
"value": -100000000,
"baseValue": -100000000,
"state": "unconfirmed",
"type": "send"
}
]
}
// 7. Check Order Status Response
{
"timeline": [
{
"status": "PROCESSING",
"timestamp": "2025-04-04T09:25:48.216Z"
}
],
"transactions": [
{
"type": "DEPOSIT",
"status": "INITIATED",
"asset": "string",
"createdAt": "string",
"updatedAt": "string",
"transactionHash": "string",
"transferId": "string",
"amount": "500000000"
}
],
"id": "string",
"userId": "string",
"type": "MINT",
"status": "CREATED",
"enterpriseId": "string",
"source": {
"asset": "string",
"amount": "string",
"type": "GO_ACCOUNT",
"walletId": "string"
},
"destination": {
"asset": "string",
"type": "GO_ACCOUNT",
"amount": "string",
"address": "0x123456789abcdef123456789abcdef123456789a",
"walletId": "67bc4b038f5408faefbfc8edcf6e6577",
"transferId": "6437d9f07d6a87000613e6c06e4218d3",
"transactionHash": "0xdeadbeef..."
},
"fee": {
"basisPoints": "5"
},
"createdAt": "string",
"updatedAt": "string",
"idempotencyKey": "mint-order-2025-04-04-001",
"depositInstructions": {
"type": "GO_ACCOUNT",
"asset": "string",
"sequenceId": "order-deposit:95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"address": "0x123456789abcdef123456789abcdef123456789a"
},
}
// 8. Bulk Fetch Orders by ID (Optional) Response
{
"orders": [
{
"id": "string",
"userId": "string",
"type": "MINT",
"status": "CREATED",
"enterpriseId": "string",
"source": {
"asset": "string",
"amount": "string",
"type": "GO_ACCOUNT",
"walletId": "string"
},
"destination": {
"asset": "string",
"type": "GO_ACCOUNT",
"amount": "string",
"address": "0x123456789abcdef123456789abcdef123456789a",
"walletId": "67bc4b038f5408faefbfc8edcf6e6577",
"transferId": "6437d9f07d6a87000613e6c06e4218d3",
"transactionHash": "0xdeadbeef..."
},
"fee": {
"basisPoints": "5"
},
"createdAt": "string",
"updatedAt": "string",
"idempotencyKey": "mint-order-2025-04-04-001",
"depositInstructions": {
"type": "GO_ACCOUNT",
"asset": "string",
"sequenceId": "order-deposit:95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"address": "0x123456789abcdef123456789abcdef123456789a"
},
"orderMethod": "ISSUER_DIRECT",
"memo": "string"
}
],
"total": 142,
"pageNo": 1,
"pageSize": 50
}