About How doest it work? Integration API Description URL Authorization HTTP Status codes API Create wallet Webhooks Deposit webhook Withdrawal webhook

About

iqpay is a platform that allows brokers and websites to easily connect cryptocurrency as their payment method.

How doest it work?

The website connects to our iqpay datacenter via Rest API. When a customer of the website wants to make a deposit, the website asks our API to generate a unique wallet that will be bound to this customer. As nobody else, except the customer, knows this address, each money transfer to this wallet will be percied as a deposit of this particular customer. When the deposit occurs, our datacenter calls websites webhook to notify of about preliminarily receiving the transaction. When a certain amount of blocks(confirmations) are done, the transaction can not be undone by hackers attack, so iqpay datacenter calls the final webhook to notify the website about deposit success. After that the system automaticaly transfer whole deposit amount from customer deposit wallet to the websites wallet.

Integration

To complete integration you need:

  • Get API key from settings that bound to these addresses;
  • Integrate our REST API. For the minimum integration you need only Get deposit wallet request;
  • Create webhooks. For the minimum integration you need only Confirm deposit webhook. Other webhooks allow you to watch the full deposit cylcle. We strongly recommend you to specify Update confirmations webhooks too. We support GET, POST, PUT and DELETE request methods. You should tell our manager the methods and URLs of created REST endpoints.
  • [Optional] Choose whether you want to receive converted to USD or EUR deposit amount in webhooks body.

API Description

API URL

https://sdc.iqpay.io/

Authorization

To access API endpoints you can get in settings page API key bound to your IPs. The received API key you need to add to the header Authorization of each HTTP request. Get currencies request can be used for the test.

HTTP Status codes
Code Description
200 OK Successful request
400 Bad Request. Returns JSON with the error message
401 Invalid login data
402 Forbidden. Action is forbidden for API key
403 Authorization token expired
500 Internal Server Error
503 Service Unavailable. Service is down for maintenance
504 Gateway Timeout. Request timeout expired

Time format

All dates are returned in timestamp(seconds) format in UTC. Example: "1543657837"

POST

Create deposit wallet

https://sdc.iqpay.io/wallet/create/:currency (for example: BTC ETH BNB USDT)

Create wallet

Example Request

curl --location --request POST 'https://sdc.iqpay.io/wallet/create/BTC' \
--header 'Content-Type: application/json' \
--header 'Authorization:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IldXZ3dRc0dYUzhOb2NLRXBBSmV5N2M4SlVKRjR1dkxPUzYvc2dpUlptS1puWDRUOVlTNzBPdmpXUEptWWhXb2hsTzFDUEI3L2d1TVRVYTY3dWtSUXE5RlRQbXJKeEUweFBHeEJobU5jWDF0RUxWbE4i.OgAfx9CWSxfbp6piL2HB5uoDY_47YP7uOD5GO0ouutI' \
--data-raw '{
"extId":"232342"
}'

HEADERS
Content-Type application/json
Authorization eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IldXZ3dRc0dYUzhOb2NLRXBBSmV5N2M4SlVKRjR1dkxPUzYvc2dpUlptS1puWDRUOVlTNzBPdmpXUEptWWhXb2hsTzFDUEI3L2d1TVRVYTY3dWtSUXE5RlRQbXJKeEUweFBHeEJobU5jWDF0RUxWbE4i.OgAfx9CWSxfbp6piL2HB5uoDY_47YP7uOD5GO0ouutI
BODY
extId 90233

Notice: for each extId will create wallet. In case you send same extId will created same wallet.

200 - OK

Example Response

{
    "status": 200,
    "data": {
        "publicKey": "1JeFHLLFQqXDef7K5QskgFbVhyAHGmQNPZ",
        "tag": "",
        "currency": "BTC",
        "extId": "2",
    }
}

POST

Deposit webhook

URL is specified in the admin panel

Notice: You must answer status 200. If the status is not 200 - we will repeat the request

BODY
address Deposit wallet address
wallet_ext_id extId
fromAddress Detail of transaction
txid Detail of transaction
amount Amount of deposit
currency Currency of deposit
status -2 - TX error - 1 - waiting add to blockchain 0 - created added to blockchain, 1 - pending(have all agreegation), 2 - success
convert_currency
convert_price
converted_amount

Example Request Body

{
    "status": 200,
    "address": "1JeFHLLFQqXDef7K5QskgFbVhyAHGmQNPZ",
    "extId": "2",
    "fromAddress": "19gwn5dzryrs11rm8s4euwf5v1rdpmrwne",
    "txId": "04fbaac8265b52cc51df73dac4a974de41c25c2acb79f2c1b639baa9ee52429b",
    "amount": 0.01,
    "currency": 'BTC',
    "status": 1,
"time": 123223257,     "convert_currency": "USD",
    "convert_price": 24000,
    "converted_amount": 240
}


POST

Withdrawal webhook

URL is specified in the admin panel

Notice: You must answer status 200. If the status is not 200 - we will repeat the request

BODY
address Withdrawal wallet address
txid Detail of transaction
amount Amount of withdrawal
currency Currency of withdrawal
status 0 - Tx added to blockchain, 1 - TX confirmed, 2 - TX error

Example Request Body

{
    "id": 11,
    "address": "1JeFHLLFQqXDef7K5QskgFbVhyAHGmQNPZ",
    "currency": 'ETH',
    "amount": 0.022,
    "txid": "0x52e56318d44123c61f43f2febf4d050bbe64ce48d4df865aa9b8ace4dcf60d83",
    "gas": 0.000714,
    "timeCreated": 1590334908,
    "timeConfirmed": 1590334913,
    "status": 2
}