Burn Tokens
Burn tokens by creating an order with the token as source and the funding asset as destination. See the Guide.
-
Set up BitGo v2 HMAC authentication before calling the Mint API from a client that supports pre-request scripting, such as Postman.
The pre-request script adds an
hmacheader derived from the request path, body, and timestamp. Direct cURL calls, like the ones in this cookbook, only need the bearer token. -
List the tokens available to your enterprise, including burn minimums, fees, and your role for each token. The response gives you the chain-scoped asset IDs used in later steps.
Before you start, accept the minting services terms for your enterprise, use an access token for a user with the enterprise member or admin role, and hold the token to burn in a Go Account wallet with a user holding Spend permission.
minimumBurnAmountis a full-unit string, while the per-pair minimums in the next step are base units. -
List the configured exchange pairs for your enterprise, with per-pair minimums, decimal precision, and fees. For a burn, find the pair whose
sourceis the token you want to redeem and whosedestinationis the funding asset you want to receive.You use
source.decimalsto calculate base units in the next step. -
All order amounts must be positive integer strings in base units, with no decimal point. Multiply the full-unit amount by 10 raised to the power of the source asset's
decimalsvalue.For example, 100 tokens at
decimals: 18becomes"100000000000000000000". -
Submit the order with the source set to the token you want to redeem and the destination set to the funding asset you want to receive. Burning uses the same endpoint as minting — reversing source and destination is what makes the order a burn.
Save the returned
idanddepositInstructions.sequenceId; you need both in the next step. For a burn,depositInstructions.assetis the off-chain form of the token, for exampleofchteth:usd1. -
Creating the order does not move any tokens by itself. Send the tokens to the wallet in
depositInstructions, using the exactdepositInstructions.sequenceIdreturned by the order.Copy the sequence ID verbatim — a mismatched sequence ID is the most common reason an order stays in
CREATED. Issuer-direct orders (orderMethod: "ISSUER_DIRECT") skip this step. -
Poll the order until it reaches
FULFILLEDorFAILED. The response includes the statustimelineand the client-facingtransactionslegs.The
destination.amountreflects the funding asset amount returned after fees are applied. -
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.
# AI SETUP: Before running this cookbook:
# 1. Check if ~/.bitgo/credentials.env exists and source it.
# 2. If not found, ask the user if they have a credentials file at another location.
# - If yes, source that file.
# - If no, prompt the user to provide each value below before proceeding.
// 1. Configure HMAC
# The Mint API uses BitGo v2 HMAC authentication. If calling from Postman, add
# an environment variable BITGO_ACCESS_TOKEN and the pre-request script from the guide.
# The cURL calls below use bearer token auth only.
// 2. List Supported Tokens
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export BASE_URL="https://app.bitgo-test.com/api/mint/v1" # app.bitgo.com for production
curl -s "$BASE_URL/enterprise/$ENTERPRISE_ID/supported-tokens" \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 3. List Asset Pairs
curl -s "$BASE_URL/enterprise/$ENTERPRISE_ID/asset-pairs" \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 4. Calculate Base Units
# base units = amount * 10^decimals
DECIMALS=18 # from asset-pairs source.decimals
AMOUNT_FULL=100
AMOUNT_BASE=$(echo "$AMOUNT_FULL * 10^$DECIMALS" | bc)
echo "Amount in base units: $AMOUNT_BASE"
// 5. Create Burn Order
export SOURCE_WALLET_ID="<SOURCE_GO_ACCOUNT_ID>"
export DESTINATION_WALLET_ID="<DESTINATION_WALLET_ID>"
curl -s -X POST "$BASE_URL/enterprise/$ENTERPRISE_ID/orders" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"idempotencyKey": "<YOUR_UNIQUE_KEY>",
"source": {
"asset": "hteth:usd1",
"amount": "'"$AMOUNT_BASE"'",
"walletId": "'"$SOURCE_WALLET_ID"'",
"type": "GO_ACCOUNT"
},
"destination": {
"asset": "tfiatusd",
"type": "GO_ACCOUNT",
"walletId": "'"$DESTINATION_WALLET_ID"'"
}
}'
// 6. Transfer Tokens to BitGo
# Use the sequenceId and walletId returned in depositInstructions — do not construct them.
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"
export SEQUENCE_ID="<DEPOSIT_INSTRUCTIONS_SEQUENCE_ID>"
export DEPOSIT_WALLET_ID="<DEPOSIT_INSTRUCTIONS_WALLET_ID>"
curl -X POST \
"http://$BITGO_EXPRESS_HOST/api/v2/ofchteth:usd1/wallet/$SOURCE_WALLET_ID/sendcoins" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"address": "'"$DEPOSIT_WALLET_ID"'",
"amount": "'"$AMOUNT_BASE"'",
"walletPassphrase": "'"$WALLET_PASSPHRASE"'",
"sequenceId": "'"$SEQUENCE_ID"'"
}'
// 7. Check Order Status
export ORDER_ID="<YOUR_ORDER_ID>"
curl -s "$BASE_URL/enterprise/$ENTERPRISE_ID/orders/$ORDER_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 8. Bulk Fetch Orders by ID (Optional)
curl -s -G "$BASE_URL/enterprise/$ENTERPRISE_ID/orders" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data-urlencode "id=<ORDER_ID_1>" \
--data-urlencode "id=<ORDER_ID_2>"
// AI SETUP: Before running this cookbook:
// 1. Check if ~/.bitgo/credentials.env exists and load it with dotenv.
// 2. If not found, ask the user if they have a credentials file at another location.
// - If yes, load that file instead.
// - If no, prompt the user to provide each required value before proceeding.
// 1. Configure HMAC
// Use the REST API for this step (see cURL tab)
// 2. List Supported Tokens
// Use the REST API for this step (see cURL tab)
// 3. List Asset Pairs
// Use the REST API for this step (see cURL tab)
// 4. Calculate Base Units
// Use the REST API for this step (see cURL tab)
// 5. Create Burn Order
// Use the REST API for this step (see cURL tab)
// 6. Transfer Tokens to BitGo
// Use the REST API for this step (see cURL tab)
// 7. Check Order Status
// Use the REST API for this step (see cURL tab)
// 8. Bulk Fetch Orders by ID (Optional)
// Use the REST API for this step (see cURL tab)
// 2. List Supported Tokens Response
{
"tokens": [
{
"token": "usd1",
"assets": ["hteth:usd1", "tbsc:usd1", "tsol:usd1"],
"type": "stablecoin",
"minimumMintAmount": "1",
"minimumBurnAmount": "1",
"mintFeeBps": "0",
"burnFeeBps": "0",
"role": "issuer",
"issuerOrdersEnabled": true,
"name": "USD1"
}
]
}
// 3. List Asset Pairs Response
{
"assetPairs": [
{
"source": { "asset": "hteth:usd1", "minimumAmount": "100", "decimals": 18 },
"destination": { "asset": "tfiatusd", "decimals": 2 },
"fee": { "basisPoints": "10" }
}
]
}
// 5. Create Burn Order Response
{
"id": "95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"status": "CREATED",
"source": { "asset": "hteth:usd1", "amount": "100000000000000000000", "type": "GO_ACCOUNT" },
"destination": { "asset": "tfiatusd", "type": "GO_ACCOUNT" },
"depositInstructions": {
"type": "GO_ACCOUNT",
"asset": "ofchteth:usd1",
"sequenceId": "order-deposit:95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"walletId": "69490df0179d6702e06d214e493929e2"
}
}
// 6. Transfer Tokens to BitGo Response
{
"coin": "ofchteth:usd1",
"transfers": [
{
"id": "transfer_id_12345",
"coin": "ofchteth:usd1",
"wallet": "67bc4b03...",
"value": -100000000000000000000,
"baseValue": -100000000000000000000,
"state": "unconfirmed",
"type": "send"
}
]
}
// 7. Check Order Status Response
{
"id": "95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"type": "BURN",
"status": "FULFILLED",
"source": { "asset": "hteth:usd1", "amount": "100000000000000000000", "type": "GO_ACCOUNT" },
"destination": { "asset": "tfiatusd", "amount": "99900000", "type": "GO_ACCOUNT" },
"fee": { "basisPoints": "10" },
"timeline": [
{ "status": "CREATED", "timestamp": "2025-04-04T09:25:48.216Z" },
{ "status": "CONFIRMED_DEPOSIT", "timestamp": "2025-04-04T09:26:10.001Z" },
{ "status": "PROCESSING", "timestamp": "2025-04-04T09:26:12.500Z" },
{ "status": "FULFILLED", "timestamp": "2025-04-04T09:32:00.000Z" }
]
}
// 8. Bulk Fetch Orders by ID (Optional) Response
{
"orders": [
{
"id": "95bdbd9c-9cdc-41a4-ae70-165387b7aa51",
"type": "BURN",
"status": "FULFILLED",
"source": { "asset": "hteth:usd1", "amount": "100000000000000000000", "type": "GO_ACCOUNT" },
"destination": { "asset": "tfiatusd", "amount": "99900000", "type": "GO_ACCOUNT" },
"fee": { "basisPoints": "10" },
"orderMethod": "ISSUER_DIRECT",
"createdAt": "2025-04-04T09:25:48.216Z",
"updatedAt": "2025-04-04T09:32:00.000Z"
}
],
"total": 1,
"pageNo": 1,
"pageSize": 50
}