Inqud Docs
  • Developer
    • 🟢Inqud API
    • 🔑Authentication
    • 🪝Web Hooks
      • Web Hook Verification
      • Payment Web Hook
    • Payment Statuses
    • 📃API Reference
  • Payments
    • 🔢Payment Methods
    • 💸Withdrawal/Payout
      • Cross Payout Feature
    • 💰Deposit/Payin
    • 💰H2H Deposit/Payin
  • Crypto Widget
    • 💣Integration overview
    • Usage models
    • Extra features
      • Auto-conversion
      • Preselected currency checkout
    • 💱Coverage
    • 📄Glossary
    • ✅Get started
      • Onboarding
      • Setup instructions
    • 🔎Explore
      • Checkouts
      • Requests
      • Payments
    • 💻Integration
      • ⚙️Redirect payment flow
      • ⚙️Embedded widget
      • ⚙️Using your own UI with Inqud processing
      • 🪝Web Hooks
        • Checkout Web Hook
        • Request Web Hook
      • 📃API Reference
  • Crypto Static Addresses
    • 📃Overview
    • 💱Coverage
    • ✅Get Started
      • 1️⃣Step 1. Account verification
      • 2️⃣Step 2. Project setup
      • 3️⃣Step 3. Integration
    • 💻Integration
      • ⚙️API Integration
      • 🪝Web Hooks
      • 📃API Reference
  • Crypto Recurring
    • 📃Overview
      • Inqud Hosted Page overview
      • Inqud Recurring SDK overview
    • 💡Use Cases
      • Subscription Payments
      • On-Demand Payments
    • 💱Coverage
    • 📄Glossary
    • ✅Get Started
      • 1️⃣Step 1. Account verification
      • 2️⃣Step 2. Project setup
      • 3️⃣Step 3. Plan setup
      • 4️⃣Step 4. Integration
    • 🔎Explore
      • How it works
      • Project
      • Plan
      • Authorization
      • Subscription
      • Invoice
      • Payment Intent
    • 💻Integration
      • ⚙️Inqud Hosted
      • ⚙️Recurring SDK
        • SDK Package & Docs
        • SDK Usage Example
        • Example Sandbox
      • 🪝Web Hooks
        • Subscription Web Hook
        • Authorization Web Hook
        • Invoice Web Hook
      • 📃API Reference
Powered by GitBook
On this page
  • API Tokens in action
  • Python Example
  1. Developer

Authentication

PreviousInqud APINextWeb Hooks

Last updated 9 months ago

To use the Inqud API you need to get an API id and secret keys.

Following steps explain how to get API token:

  1. Sign up or log into Inqud's .

  2. Navigate to and pass KYC process.

  3. Ask your personal manager to get access to the API.

  4. On the same page in the "API tokens" section click "Add API token".

  5. Fill in the form on the modal window and click "Create API token".

  6. After that you will be provided with "Token Id" and "Token Secret".

  7. Now you all set! Please store the keys securely. If the credentials were compormised you can revoke it at any time on the same page.

API Tokens in action

Below you can find the request headers which are used for the token-based authentication:

Simple approach:

X-Token-API-Id - Identifier of the token (started with TKN- prefix)
X-Token-API-Secret - Token secret

HmacSHA256:

X-Token-API-Id - Identifier of the token (started with TKN- prefix)
X-HMAC-SHA256-Signature - HMAC Signature
X-Salt - Salt (nonce)

Signature = HmacSHA256 function of (Request body + salt) hashed by token secret in HEX

For GET request just use "" as a body parameter

Python Example

Here is an example of how to get a balance with the signature of the request in python

Secret token GET example

import requests

id = 'TKN-6c1296b8-6929-443b-ac06-f732e0e27be1'
secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"


headers = {}
headers['X-Token-API-Id'] = id
headers['X-Token-API-Secret'] = secret


url = 'https://api.inqud.com/v1/user/wallet/balances'

http_response = requests.get(url=url, headers=headers)


print(str(http_response.content.decode()))

HmacSHA256 GET example

import hashlib
import hmac
import requests
import secrets

base_url = 'https://api.inqud.com'
token_id = "TKN-6c1296b8-6929-443b-ac06-f732e0e27be1"
token_secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"
salt = secrets.token_hex(32)

data = ''
data_s = data + salt

dig = hmac.new(token_secret.encode('utf-8'), msg=data_s.encode('utf-8'),
digestmod=hashlib.sha256).digest()

signature = dig.hex()


headers = {'X-Token-API-Id': token_id,
         'X-HMAC-SHA256-Signature': signature,
         'X-Salt': salt}

url = base_url + '/v1/user/wallet/balances'

http_response = requests.get(url=url, headers=headers)

HmacSHA256 POST example

import hashlib
import hmac
import requests
import secrets
import json

base_url = 'https://api.inqud.com'
token_id = "TKN-6c1296b8-6929-443b-ac06-f732e0e27be1"
token_secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"
salt = secrets.token_hex(32)

data = {"amount": 50, "cardNumber": "5555555555554444", "firstName": "John",
        "lastName": "Doe", "phoneNumber": "+111111111111",
        "method": "CC_VISAMC", "currency": "USD"}
data_s = json.dumps(data) + salt
dig = hmac.new(token_secret.encode('utf-8'), msg=data_s.encode('utf-8'),
               digestmod=hashlib.sha256).digest()

signature = dig.hex()

headers = {
    'X-Token-API-Id': token_id,
    'X-HMAC-SHA256-Signature': signature,
    'X-Salt': salt
}

url = base_url + '/v1/user/payments/payout'

http_response = requests.post(url=url, headers=headers, json=data)
🔑
app
user settings