How to generate a wallet address

Merchants can generate new wallet addresses for sub-users and main accounts, this can be used to collect deposits from different channels.

Making request

Generate a new wallet address: send a post request to the create wallet address endpoint with the URL PARAMS.

URL PARAMS:

  • user_id: The User ID. Use 'me' if fetching wallets of the main authenticated user, use the user_id if fetching the Sub-account linked to the authenticated user.
  • currency: Currency. Allowed valued: qdx, usd, ngn, ghs, btc, usdt, busd, cfx, usdc, cnhc, eth, bnb, xrp, ltc, wkd, bch, doge, dash, trx, one, link, cake, xlm, axs, shib, afen, bls, fil, ada, dot, babydoge, xtz, matic, sfm, aave, wsg, ckt, floki, sol, mana, ftm, sand, slp, enj, lrc, ape, sushi, zil.

Request:

curl --request POST \
     --url https://www.quidax.com/api/v1/users/<user_id>/wallets/<currency>/addresses \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <api_secret_key>'
const options = {
  method: 'POST',
  headers: {accept: 'application/json', Authorization: 'Bearer s3cr3tk3y'}
};

fetch('https://www.quidax.com/api/v1/users/<user_id>/wallets/<currency>/addresses', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.quidax.com/api/v1/users/<user_id>/wallets/<currency>/addresses', [
  'headers' => [
    'Authorization' => 'Bearer s3cr3tk3y',
    'accept' => 'application/json',
  ],
]);

echo $response->getBody();
import requests

url = "https://www.quidax.com/api/v1/users/<user_id>/wallets/<currency>/addresses"

headers = {
    "accept": "application/json",
    "Authorization": "Bearer s3cr3tk3y"
}

response = requests.post(url, headers=headers)

print(response.text)

πŸ“˜

Wallet Address

Wallet address are generated in the background so your integration would need to listen to wallet.address.generated webhook event to get the newly generated address or make an API call to fetch the wallet address via the API endpoint to get the newly generated wallet address.

Response:

{
  "status": "success",
  "message": "Successful",
  "data": {
    "id": "62zwjrex",
    "reference": null,
    "currency": "btc",
    "address": "1cp26oZ916P6aVRMtgx9Bo8YDBbxaC2B9",
    "destination_tag": null,
    "total_payments": "0.0",
    "created_at": "2021-11-15T21:16:20.718+01:00",
    "updated_at": "2021-11-15T21:16:20.718+01:00"
  }
}