IDRX Documentation
  • Introduction
    • IDRX Whitepaper
    • Supported Chain and Contract Address
  • IDRX Account
    • Create Account
    • Sign In
    • Forgot Password
    • Account Verification (KYC)
    • Business Account
  • Services
    • Mint IDRX
    • Redeem IDRX
    • Bridge IDRX
    • Get Other Tokens
    • Redeem Other Stablecoin
    • Fees
  • API
    • Getting Started
    • Generating a Signature
    • Onboarding API
      • POST /api/auth/onboarding
      • GET /api/auth/members
      • POST /api/auth/add-bank-account
      • GET /api/auth/get-bank-accounts
      • DELETE /api/auth/delete-bank-account/:bankId
    • Transaction API
      • POST /api/transaction/mint-request
      • POST /api/transaction/redeem-request
      • POST /api/transaction/bridge-request
      • GET /api/transaction/method
      • GET /api/transaction/user-transaction-history
      • GET /api/transaction/rates
      • GET /api/transaction/get-additional-fees
  • Smart Contract
    • Staking
      • Staking Type
      • Staking IDRX
      • Claim Staking Reward
      • Unbond Staked IDRX
      • Claim Unbonded IDRX
      • Claim Principal and Staking Rewards
      • Application Binary Interface
  • Integration
    • Overview
    • Onboarding a new user
    • Managing bank accounts
    • Processing mint requests
      • Getting other tokens
    • Processing redeem requests
      • Redeeming from other tokens
Powered by GitBook
On this page
  1. Integration

Onboarding a new user

A typical flow to onboard new users

PreviousOverviewNextManaging bank accounts

Last updated 10 months ago

You can use the to onboard new users to the platform. A new user registered through the api will be a special type of user that's managed under the organization. This type of user does not need to complete certain steps in the KYC flow to simplify the onboarding process.

Firstly, you need to setup your API access. You can read more about that .

Then, you can use the POST /api/auth/onboarding endpoint to register the new user. Here is an example.

import { createSignature } from "./createSignature";
const axios = require('axios');

const apiKey = "{YOUR API KEY}";
const secret = "{YOUR SECRET}";

async function onboarding() {
  const path = "https://idrx.co/api/auth/onboarding";

  const form = new FormData();
  form.append("email"    , "john.smith@email.com");
  form.append("fullname" , "JOHN SMITH");
  form.append("address"  , "123 MAIN STREET, APT 1. HARRISBURG. PA 17101-0000");
  form.append("idNumber" , "83123997");
  form.append("idFile"   , fs.createReadStream('./path/to/id_file/83123997.png'));

  const bufferReq = Buffer.from(JSON.stringify(form), 'base64').toString('utf8');
  const timestamp = Math.round((new Date()).getTime()).toString();
  const sig = createSignature('POST', path, bufferReq, timestamp, secret);

  const res = await axios.post(path, form, {
    headers: {
      'Content-Type': 'multipart/form-data',
      'idrx-api-key': apiKey,
      'idrx-api-sig': sig,
    },
  });

  console.log('res.data: ');
  console.log(res.data);
}

onboarding();

Please note that the parameters shown are just an example. When onboarding a new user, you must use valid and verifiable data. After a successful operation, you will get a response as follows:

{
  statusCode: 201,
  message: 'success',
  data: {
    id: 1011,
    fullname: 'JOHN SMITH',
    createdAt: '2023-12-12T08:10:29.077Z',
    apiKey: 'fd1c15cb1fd157c7',
    apiSecret: '11b0de01a2cf17c1094db789bfa05eb1adc185482c3ee828a7ba617b83e9b711'
  }
}

You can then use the API keys to process requests for the specified user.

Onboarding API
here
Page cover image