Investhub.io
  • What is Investhub?
  • Pricing
  • APIs
    • KYC Oracle API (BETA)
      • CreateUser
      • CreateCustomer
      • CustomerCompany
        • CustomerCompanyDirector
        • CustomerCompanyUbo
      • HistoryChangeKycLevel
      • ComplycubeClient
      • DataConsent
      • Messages
      • logSendRequestExternal
    • Raise API
    • Referral API
    • Commitment API
    • Opportunity API
  • Referral Partners
    • How to Start
    • Referral Code
      • Assign Referral Partner
    • Rule Book
    • Ethics
  • Investor Training
    • Personalised Opportunities
    • How to generate Investor IBAN?
    • How to make KYC?
      • Redirect to Tenants
      • How to push my KYC to tenants?
      • How to push a Transaction to tenants?
    • Define your Risk Profile
    • How to register an .eth domain
    • What are Security Tokens?
  • Issuer Training
    • Issuer Responsibilities
    • Smart Contract Checklist
    • Prospectus
      • Discounts
      • Translation of Summary
      • Get an ISIN
      • Get a local Phone Number
      • Get a LEI Number
    • KID (key information document)
    • KIIS (key investment information sheet)
    • Fundraising Thresholds
    • Data Center
    • Corporate Governance
    • Insurances
    • Digital Incorporation
    • Prepare for Opportunity
    • Prepare for Deal
    • Accounting
    • Dos and Dont
    • Legal Disclaimers
    • Company Valuation
  • Raise (Compliance, Tokenisation, Reconciliation)
    • Setup a KYC (Raise) Tenant
    • KYC/KYB Handling
      • How to Edit for the user?
    • Video Ident / Liveness Check
    • Payment Channels
      • Crypto Settings
      • Transactions (On and Off-Chain)
      • Bank Accounts
        • Bank Details
      • Crypto.com
      • Volt.io
      • Stripe.com
      • Sendwyre.com
    • Languages
    • User Roles
    • Signature APIs
      • Signnow
      • Skribble
    • Company Information
    • Token Settings
    • Token Type
    • Discount Level Option
    • Currency Settings
    • Google Analytics, Tag Manager, Facebook Pixel
    • Video Frontpage
    • Emails
      • SMTP Settings
      • Email Reminders
    • Other Settings
    • Pythagoras Export
    • Transaction Limit
    • Risk Level Assessment
    • Data Storage Liechtenstein
    • Hotjar
    • Intercom
    • Auto Approval
    • Audit Trail (Log Event)
    • Blacklist
    • Smart Contracts
      • Smart Contract Checklist
      • Smart Contract API
      • Whitelisting
      • Cashlink (depreciated)
    • Exchange Rates
    • Exports
    • Wallet Screening
    • Monitoring
    • Watchlist Enhanced
  • Manage (Proceed Management)
    • Setting up a Manage Tenant
    • Dashboard
    • User Profile
    • Accounts
      • Create FIAT Accounts
      • Create Hot Wallets
      • Connect Metamask Wallet
      • Different Networks (Ethereum, Polygon)
    • Chart of Accounts
    • Cards
    • Reports
    • Users
    • Contacts
    • Settings
      • Company
      • Categories
      • Projects
      • Groups
      • Branches
      • Tax Rates
      • Departments
      • Roles
      • Reject reason
      • Advanced
      • User Permissions
    • Connecting Xero
      • Connect API
      • Multicurrency
      • Gas fees
    • Image Recognition API
      • Veryfi
      • Datamolino
      • Staple.ai
Powered by GitBook
On this page
  1. APIs

Referral API

PreviousRaise APINextCommitment API

Last updated 1 year ago

This API enables you, to send traffic to investhub.io and receive a commission for each subscription done via your referrals.

Each of our Tenants need to whitelist your Domain, this is important so that each Tenant can decide which Referral Partners they want to work with.

All available endpoints for referrals, make sure to whitelist URL first in Settings

Following endpoints are available:

  1. Endpoint for registration is https://kyc.yourdomain.com/sales/user?origin=https://kyc.yourdomain.com (?origin=https://kyc.yourdomain.com is also needed, for our routing purposes) Please change the host name (kyc.yourdomain.com) and origin (https://kyc.yourdomain.com) to your tenant like: https://yourname-dev.investhub.io/sales/user?origin=https://yourname-dev.investhub.io/ You need to send a POST request with content type of application/json containing the following fields: {"firstName": [first name],"lastName": [last name],"email: [email],"password": [password, hashed with bcrypt],"token_invest_amount": [number],"middleName": [middle name]} Example: {"firstName": "test","lastName": "test","token_invest_amount": 500,"middleName": "test","email": "test@gmail.com","password": "$2b$13$HDRwk3FfnKLiPoV8SlEpoeoexIAhx3wH.rzDMlstenBnFaWfa1wmy"} The response will be also in JSON format, with the following fields: {"success": [boolean], "redirect_url": [string]} redirect_url is url to redirect the user. after the redirect, the user will be automatically authenticated at KYC tenant in case of error: {“success”: false,“error”: [description of the error]} Example of successful registration: {“success”: true,“redirect_url”: “https://kyc.yourdomain.com/salesLogin?first_auth_token=eoexIAhx3wH”}

  2. Login auth1. Generate auth_token: - Post request to https://kyc.yourdomain.com/sales/generate-user-auth-token?origin=https://kyc.yourdomain.com with body params with email & password (password format like the Endpoint for registration) example: {"email": "aaa.test.4@investhub.io", "password": "$2b$13$YeGFwoZ3KMaL7AmS/Dl/peXXdf7bOAkcp0FFriAjFoYJG0iMOrgpe"} CURL example: curl --location --request POST 'https://kyc.yourdomain.com/sales/generate-user-auth-token?origin=https://kyc.yourdomain.com' \--header 'Content-Type: application/json' \--header 'Cookie: __cfduid=dda0b0fed26c194b28ed84793e3ef93611602681187' \--data-raw '{ "email": "aaa.test.4@investhub.io", "password": "$2b$13$YeGFwoZ3KMaL7AmS/Dl/peXXdf7bOAkcp0FFriAjFoYJG0iMOrgpe"}' Then you will receive a response with auth_token, and the redirect_url link, this link when you access, it will automatically login into KYC platform. {"success": true, "auth_token": "xben1ikulllpud9xq7twxizy4dajb7jg", "redirect_url": "https://kyc.yourdomain.com/salesAuthTokenLogin?auth_token=xben1ikulllpud9xq7twxizy4dajb7jg"}

  3. Endpoint for purchase of tokens https://kyc.yourdomain.com/sales/buy-amount-contribution?origin=https://kyc.yourdomain.com (?origin=https://kyc.yourdomain.com is also needed, for our routing purposes) Please change the host name (kyc.yourdomain.com) and origin to your tenant URL if you use dev, please use dev, if production use production.

You need to send a POST request with a content type of application/JSON containing the following fields: {“email”: [email],“amount_contribution”: [Int of tokens purchased]}Example:{“email”: “test@gmail.com”,“amount_contribution”: 1000} The response will be also in JSON format, with the following fields: {"success": [boolean], "redirect_url": [string]} redirect_url is url to redirect the user. after the redirect, the user will be automatically authenticated at kyc.yourdomain.com and open contribute page In case of error: {“success”: false,“error”: ‘User not found!' or 'amount_contribution must be an integer!’} Example of successful: {"success": true,"redirect_url": "https://kyc.yourdomain.com/auth?auth_token=c4knp7sknqaqayn018dwry3o9kfzrcvx&redirect_url=contribute"}

API Endpoints (ONLY AVAILABLE IF referral source is activated)

When your session end, you can call this api to destroy auth_token: - Post request to https://kyc.yourdomain.com/sales/destroy-user-auth-token?origin=https://dev-kyc.yourdomain.com with body params with email & the auth_token (in this case it will be "xben1ikulllpud9xq7twxizy4dajb7jg" ) CURL example: curl --location --request POST 'https://kyc.yourdomain.com/sales/destroy-user-auth-token?origin=https://kyc.yourdomain.com' \--header 'Content-Type: application/json' \--header 'Cookie: __cfduid=dda0b0fed26c194b28ed84793e3ef93611602681187' \--data-raw '{"email": "aaa.test.4@investhub.io", "auth_token": "xben1ikulllpud9xq7twxizy4dajb7jg"}' then It should return the status of success true. Then the previous redirect_url link will be expired. Just tested. It's working. My reproduce steps: - First create new user by post to registration After click to first login in -> then I signed out ( like normal user does ) - Post to generating the auth token: When you click on the redirect_url => It will auto login our system. - And when session end, post destroy auth token

If KYC has been submitted - then we will send a request to https://www.yourdomain.com/api/first-token-submissions (https://www.yourdomain.com/api/ is a config API URL, we can change it in Admin -> Settings -> Internal Sales API Settings) With this data: {"success": true, "user_email": "", "amount": 1, "context": "first_token_submissions"}

Endpoint for sending payment confirmations The endpoint is:www.sales.yourdomain.com/api/payment-notification We will send the POST request to the sale api with this endpoint. The data have this keys: success, user_email and amount Example of data: {"success": true,"user_email": "test@test.it","amount": 2} Possible outcomes: {"success": false,"msg": "User not found"} {"success": false,"msg": "Package not found"} {"success": false,"msg": "Transaction denied"} {"success": false,"msg": "Data inside json are missing"} {"success": false,"msg": "Data json is missing"} {"success": false,"msg": "PHP error, contact and administrator"} {"success": true,"msg": "Package purchased succesfully"} Also, the call method is POST, and data must be inside the body in JSON format

test@test.it