How to Deposit and Withdraw testnet BTC into your Paxos Sandbox Account

Summary

The following guide explains how to test Paxos’s v2 Transfer APIs in Sandbox using testnet BTC (tBTC). 

Disclaimer - Paxos does not maintain testnets and as a common courtesy, please return the testnet currency when you’re finished. 

 

Prerequisites

You will need API credentials with the following scopes enabled:

  • transfer:write_deposit_address
  • transfer:write_crypto_withdrawal 
  • funding:read_activity 

 

Creating a Test Deposit 

1) Create a deposit address by calling the Create Deposit Address API endpoint.

Example

URL

POST https://api.sandbox.paxos.com/v2/transfer/deposit-addresses

 

Payload

{
    "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
    "crypto_network": "BITCOIN",
    "ref_id": "btc-testnet-dep-ad-01"
}

Response

{
   "id": "33a695ec-2f3c-4ba7-b1ba-878b3e07b9d4",
   "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
   "customer_id": "70065fcd-f609-40d3-9dda-f5a0f6a2a8ef",
   "crypto_network": "BITCOIN",
   "identity_id": "00000000-0000-0000-0000-000000000000",
   "ref_id": "btc-testnet-dep-ad-01",
   "address": "msu5qRLGBF36Ch335huXGjYB7NircVKAdd",
   "account_id": "00000000-0000-0000-0000-000000000000"
}

 

2) Record the `address` returned in the response message from CreateDepositAddress. This is where you will send your test currency.

 

3) Navigate to the BTC test-net faucet (https://testnet-faucet.mempool.co/) and fill out the form with the `address` you just created.

Note: it may take some time for the Bitcoin testnet to confirm the transfer on the blockchain. You may view the record on Blockchain.com and search for the TxID created from the deposit.

Examplemceclip1.png


4) You can verify the deposit by calling the List Transfers endpoints.

Example

URL

GET https://api.sandbox.paxos.com/v2/transfer/transfers 

Response:

{
          "id": "cdf5a475-ade2-4b1d-bdac-2aa954564adf",
          "customer_id": "70065fcd-f609-40d3-9dda-f5a0f6a2a8ef",
          "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
          "amount": "0.001",
          "total": "0.001",
          "fee": "0",
          "asset": "BTC",
          "direction": "CREDIT",
          "type": "CRYPTO_DEPOSIT",
          "status": "COMPLETED",
          "created_at": "2022-03-30T16:21:55.207706Z",
          "updated_at": "2022-03-30T16:21:57.588079Z",
          "destination_address": "msu5qRLGBF36Ch335huXGjYB7NircVKAdd",
          "crypto_network": "BITCOIN",
          "crypto_tx_hash": "0d40c9c7162405247df32d32d8f2062aa3ba31b4a0042cc48f5f5816771ed262",
          "crypto_tx_index": "1",
          "auto_conversion": {
              "from_transfer_id": "00000000-0000-0000-0000-000000000000",
              "to_transfer_id": "00000000-0000-0000-0000-000000000000"
          }
      }

 

Creating a test withdrawal

1) In order to withdraw tBTC in Sandbox, you will need to submit a POST request to the Create Crypto Withdrawal API endpoint.

Example

URL:

POST https://api.sandbox.paxos.com/v2/transfer/crypto-withdrawals

Payload

{
  "ref_id": "tbtc-withdraw-testnet-01",
  "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
  "destination_address": "mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt",
  "total": "0.0001",
  "asset": "BTC"
}

Response

{
  "id": "9d7e9b59-40f8-4ab7-9a56-23612ffe6e28",
  "customer_id": "70065fcd-f609-40d3-9dda-f5a0f6a2a8ef",
  "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
  "ref_id": "tbtc-withdraw-testnet-01",
  "amount": "0.00009778",
  "total": "0.0001",
  "fee": "0.00000222",
  "asset": "BTC",
  "direction": "DEBIT",
  "type": "CRYPTO_WITHDRAWAL",
  "status": "PENDING",
  "created_at": "2022-03-30T16:27:14.828046Z",
  "updated_at": "2022-03-30T16:27:14.878901Z",
  "destination_address": "mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt",
  "crypto_network": "BITCOIN",
  "auto_conversion": {
      "from_transfer_id": "00000000-0000-0000-0000-000000000000",
      "to_transfer_id": "00000000-0000-0000-0000-000000000000"
  }
}

Note: it may take some time for the Bitcoin testnet to confirm the transfer on the blockchain. You may view the record on Blockchain.com and search by the Paxos Bitcoin address you created earlier. 


mceclip2.png

 

Verifying Withdrawal

1) You can verify the transfer by passing the ID assigned in the response in the Get Transfer API endpoint. You will have to call this endpoint to retrieve the most recent status of the transfer as it may take some time to complete transaction on the blockchain.

Example

URL:

https://api.sandbox.paxos.com/v2/transfer/transfers/9d7e9b59-40f8-4ab7-9a56-23612ffe6e28

Response:

{
  "id": "9d7e9b59-40f8-4ab7-9a56-23612ffe6e28",
  "customer_id": "70065fcd-f609-40d3-9dda-f5a0f6a2a8ef",
  "profile_id": "c7121a5f-0c89-44b5-bbb1-ed62f55ec1b6",
  "ref_id": "tbtc-withdraw-testnet-01",
  "amount": "0.00009778",
  "total": "0.0001",
  "fee": "0.00000222",
  "asset": "BTC",
  "direction": "DEBIT",
  "type": "CRYPTO_WITHDRAWAL",
  "status": "PENDING",
  "created_at": "2022-03-30T16:27:14.828046Z",
  "updated_at": "2022-03-30T16:27:14.878901Z",
  "destination_address": "mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt",
  "crypto_network": "BITCOIN",
  "auto_conversion": {
      "from_transfer_id": "00000000-0000-0000-0000-000000000000",
      "to_transfer_id": "00000000-0000-0000-0000-000000000000"
  }
}
Was this article helpful?
0 out of 0 found this helpful