Withdraw from Wallet - Go Account (Simple)

Overview

The simple withdrawal flow for Go Accounts enables you to build and send transactions, all in 1 call, using BitGo Express. The simple flow suffices for most use cases. If you require more granular control, see the integration guide for the advanced flow.

Just like with the advanced flow, you can configure wallet policies to require approvals on withdrawals. Once the transaction is approved, you send it to BitGo for signing and broadcasting to the blockchain.

Prerequisites

1. Get idHash (Optional)

This step is required only for withdrawing fiat from your Go Account. Crypto withdrawals skip this step.

Withdrawals from your Go Account differ by asset and destination. Notably, withdrawing fiat currency to your whitelisted bank account requires a wire transfer. BitGo charges a $10 wire-transfer fee. Your bank may charge a wire-transfer fee too. Contact your bank to learn more.

Endpoint: List Bank Accounts

  • API
1 GET /api/v2/bankaccounts?enterpriseId=<enterpriseID>

Step Result

BitGo identifies your whitelisted bank account with a unique idHash that you can pass as the address value in the next step.

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "bankAccounts": [ { "accountNumber": "012345678", "address1": "test", "address2": "test", "enterpriseId": "1032e75c451052000436831deb797af1", "id": "60749ab75f8c4500060f5a8b244dd0cb", "name": "My Bank", "owner": { "name": "test", "address1": "test", "address2": "test" }, "idHash": "c2f4cf5555a66d77", "routingNumber": "087654321", "shortCountryCode": "US", "verificationState": "approved" } ] }

2. Build and Send Transaction

Build and send the transaction to BitGo, all in 1 call. The following example is shows the minimum required parameters for sending bitcoin or fiat.

Endpoint: Send Transaction

  • cURL
  • JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>" export COIN="<OFC_ASSET_ID>" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export ADDRESS="<DESTINATION_ADDRESS_OR_ID_HASH>" export GO_ACCOUNT="<DESTINATION_WALLET_ID>" // If withdrawing to another Go Account export AMOUNT="<AMOUNT_IN_BASE_UNITS>" export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>" curl -X POST \ http://$BITGO_EXPRESS_HOST:3080/api/v2/$COIN/wallet/$WALLET_ID/sendcoins \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "address": "'"$ADDRESS"'", "walletId": "'"$GO_ACCOUNT"'", // If withdrawing to another Go Account, pass "walletId" instead of "address" "amount": "'"$AMOUNT"'", "walletPassphrase": "'"$WALLET_PASSPHRASE"'" }'

Step Result

BitGo uses the data you pass to build an unsigned transaction.

If your withdrawal doesn't require approval, then BitGo receives the unsigned transaction. If you Create Policy Rules to require approvals on withdrawals, the transaction remains in a pending-approval status until a wallet admin approves it.

The following examples show a withdrawal of $10,000 TUSD that isn't pending approval and a withdrawal of 10,000 sats of TBTC that is pending approval.

  • JSON
  • JSON (pending approval)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 { "coin": "ofctusd", "transfers": [ { "entries": [ { "address": "c2f4cf5555a66d77", "wallet": "5ef523b7ab6b7f7b00b9314a0ac0a4e8", "value": -101000, "valueString": "-10100" }, { "address": "9c1e400b427c13fa", "value": 10000, "valueString": "10000" } ], "id": "62c5b1de8a0c5200071c9a603bdbadc5", "coin": "ofctusd", "wallet": "5ef523b7ab6b7f7b00b9513a0ac0a4e8", "walletType": "trading", "enterprise": "5ef51cc84ba8da93002a7bc2e55882e6", "height": 999999999, "heightId": "999999999-62c5b1de8a0c5200071c9a603bdbadc5", "date": "2023-02-27T15:42:31.403Z", "confirmations": 0, "type": "send", "value": -10100, "valueString": "-10100", "baseValue": -10000, "baseValueString": "-10000", "feeString": "1000", "payGoFee": 0, "payGoFeeString": "0", "usd": -1010, "usdRate": 1, "state": "unconfirmed", "instant": false, "isReward": false, "isFee": false, "tags": ["5ef523b7ab6b7f7b00b9513a0ac0a4e8", "5ef51cc84ba8da93002a7bc2e55882e6"], "history": [ { "date": "2023-02-27T15:42:31.296Z", "user": "5543247a32d9b1f4037cfd782fc4b06d", "action": "created" } ], "createdTime": "2023-02-27T15:42:31.296Z", "label": "" } ] }

3. Approve Transaction (Optional)

Endpoint: Update Pending Approval

  • cURL
  • JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 export COIN="<ASSET_ID>" export APPROVAL_ID="<APPROVAL_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>" export XPRV="<XPRV>" export OTP="<OTP>" curl -X POST \ http://api/v2/$COIN/pendingapprovals/$APPROVAL_ID -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "state": "approved", "walletPassphrase": "'"$WALLET_PASSPHRASE"'", "xprv": "'"$XPRV"'", "otp": "'"$OTP"'" }'

Step Result

Once approved, BitGo rebuilds the unsigned transaction, applying the most up-to-date fees.

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 { "id": "655686880765186f0b3e9e88e1bdd0f4", "coin": "tbtc", "wallet": "6553e933288be490293ae748efafeaaf", "enterprise": "62c5ae8174ac860007aff138a2d74df7", "creator": "62ab90e06dfda30007974f0a52a12995", "createDate": "2023-11-16T21:15:52.703Z", "info": { "type": "transactionRequest", "transactionRequest": { "requestedAmount": "10000", "fee": 45242, "sourceWallet": "6553e933288be490293ae748efafeaaf", "policyUniqueId": "6553e933288be490293ae753", "recipients": [ { "address": "2N3sBpM1RnWRMXnEVoUWnM7xtYzL756JE2Q", "amount": "10000", "_id": "655686880765186f0b3e9e8a" } ], "buildParams": { "recipients": [ { "address": "2N3sBpM1RnWRMXnEVoUWnM7xtYzL756JE2Q", "amount": "10000" } ] }, "coinSpecific": { "tbtc": { "txHex": "01000000000101eac5e7d68acfc2349672fb99094e79c2006e5fd663475c8f1eb6f29095970b740100000000ffffffff02102700000000000017a914747e6b7f5db53794b0fc01d95878e0f9b6db96738746c1020000000000220020efb9deaabeab5d62cecc363f24cd6deafcdd14d93d8734f7f01ed3953e732a640500483045022100cd6c221e4cefbb51aa82087d86e7d089b2473eb21ae809dba89eb9f13c4caf19022000f3b7f1b7fec2dc49cbfce35baa69ca37ab9ee8e51c779cde5b98a653f3e142010000695221029bde55661e4f359cf9ca2d1846c235e752f760ed6d65e2018f821253e78b3c722103f2b4a813ab79e4fb46edf3a6a87fb154a85b45810158e949f41a3fce3c9bf574210399a6d766f6d3a3843f8479446ee766b5745dc15c24d1db5149214d27987bd29453ae00000000" } }, "validTransaction": "01000000000101eac5e7d68acfc2349672fb99094e79c2006e5fd663475c8f1eb6f29095970b740100000000ffffffff02102700000000000017a914747e6b7f5db53794b0fc01d95878e0f9b6db96738746c1020000000000220020efb9deaabeab5d62cecc363f24cd6deafcdd14d93d8734f7f01ed3953e732a640400483045022100cd6c221e4cefbb51aa82087d86e7d089b2473eb21ae809dba89eb9f13c4caf19022000f3b7f1b7fec2dc49cbfce35baa69ca37ab9ee8e51c779cde5b98a653f3e14201473044022002b246c43722fec49858caf6b0605a0d01a6b6c13c964b84bf272604fd3951780220324ee44ba3ce8febb154c317e688a5f6ed410ad8e2bd77c5678bf1f7f3eb45f601695221029bde55661e4f359cf9ca2d1846c235e752f760ed6d65e2018f821253e78b3c722103f2b4a813ab79e4fb46edf3a6a87fb154a85b45810158e949f41a3fce3c9bf574210399a6d766f6d3a3843f8479446ee766b5745dc15c24d1db5149214d27987bd29453ae00000000", "validTransactionHash": "ff40ccd5c8ba75ffdce27d8584b6e8ee625cb3f71f7cbb6d072a445a97c2c8c3" } }, "state": "approved", "scope": "wallet", "userIds": [ "62ab90e06dfda30007974f0a52a12995", "627ff9325a5c1b0007c05a40d15e1522" ], "approvalsRequired": 1, "singleRunResults": [ { "ruleId": "Custodial Enterprise Transaction ID Verification", "triggered": false, "_id": "655686880765186f0b3e9e89" } ], "resolvers": [ { "user": "627ff9325a5c1b0007c05a40d15e1522", "date": "2023-11-16T21:33:24.644Z", "resolutionType": "pending" } ] }

Next

You can view your completed withdrawal in BitGo or on a blockchain explorer.

See Also