API Documentation

Payment Gateway
NuxPay payment gateway allows you to receive payment with its automate callback feature. It notifies backend system when payment is received.

First, you have to setup NuxPay payment gateway in https://www.nuxpay.com. You are required to enter destination address and callback URL. Callback URL defined as an URL that enables NuxPay system to make HTTP POST when payment is received.

Every callback will be in POST method while data in JSON format.
Generate Address API
NuxPay Payment Gateway also provide an API to generate address. API format as follow:
Path:
https://api.nuxpay.com/crypto/generate/new/address
Request Type:
POST
Request Parameter:
Parameter Data Type Description Sample Value
api_key STRING API Key can be obtained by login to https://www.nuxpay.com/login.php EyXo65nFiyqZKMh35EZelMspkasdim9sQ6I
wallet_type STRING wallet_type tetherusd/bitcoin/ethereum/usd2/myr2
Wallet Type
Wallet Type Description
tetherusd Tether USD
ethereum Ethereum
bitcoin Bitcoin
bitcoincash Bitcoin Cash
litecoin Litecoin
thenuxcoin TheNux Coin
bnb Binance Coin
usd2 USD2
myr2 MYR2
hkd2 HKD2
rmb2 RMB2
eur2 EUR2
won2 WON2
yen2 YEN2
php2 PHP2
thb2 THB2
Successful Response Value (Status code: 200)
Parameter Data Type Description Sample Value
Status STRING Response Code ok
message STRING Response Message SUCCESS/ERROR
result result Address Data {new_address: (string)new_address}
Sample Output
                
status : ok
message : SUCCESS
message_d : Address Successfully Generated
code : 1
result :
new_address : 2NByXFU7vCkMhBxiRozysQsyNcDmZwofnAn

                
            
Callback data is as following
Field Data Type Description Sample data
command STRING Action type paymentGatewayCallback
params JSON Array Data array
params Variable
Field Data Type Description Sample data
receivedTxID STRING Received Transaction ID 0x4eb58a8394b14200371d77eba9281415721873f4b83bce829b1a2fb3240ab57f
referenceID STRING Transaction Reference ID 2552510
txDetails Object Transaction Details
input Array Fund In Transaction Data
receivedTxID String Received Transaction ID 0x4eb58a8394b14200371d77eba9281415721873f4b83bce829b1a2fb3240ab57f
amount String Amount 0.100000000000000000
unit String Coin Unit ETH
type String Coin Type ethereum
exchangeRate String Exchange Rate 478.8574884700
minerFee Object Miner Fee Details
amount String Miner Fee Amount 0.000105000000000000
unit String Miner Fee Unit ETH
type String Miner Fee Type ethereum
exchangeRate String Miner Fee Exchange Rate 478.8574884700
output Array Destination Transaction Data
destination Object Destination Transaction Details
amount String Destination Transaction Amount 0.089790000000000000
unit String Destination Transaction Unit ETH
type String Destination Transaction Type ethereum
exchangeRate String Destination Transaction Exchange Rate 478.8574884700
charges Object Service Charge Details
amount String Service Charge Amount 0.089790000000000000
unit String Service Charge Unit ETH
type String Service Charge Type ethereum
exchangeRate String Service Charge Exchange Rate 478.8574884700
minerFee Object Miner Fee Details
amount String Miner Fee Amount 0.089790000000000000
unit String Miner Fee Unit ETH
type String Miner Fee Type ethereum
exchangeRate String Miner Fee Exchange Rate 478.8574884700
txID STRING Transaction ID 0x51f7dc400c3f127ef9ce12d6684408e0fc631ccbf165b9622b73e4c3a219cdfc
amount STRING Transaction Amount 0.08979 ETH
amountReceive STRING Amount Received in destination address 0.1 ETH
serviceCharge STRING Service Charge imposed in this transaction 0.01 ETH
minerAmount STRING Miner Amount 0.000105 ETH
address STRING Sender Address 0x46739ede49c94be3de880d2e2511aa34549bb6a5
status STRING Status success
transactionDate STRING Transaction Date 2020-11-20 10:08:07
transactionUrl STRING Transaction Url https://ropsten.etherscan.io/tx/0x51f7dc400c3f127ef9ce12d6684408e0fc631ccbf165b9622b73e4c3a219cdfc
type STRING Coin Type ethereum
sender STRING internal 0x90561a2423694e34fccb20fff89e0b9150537d40
sender STRING external 0xf4dd12271cb73b5eda57721334e59bce0f2cacca
recipient STRING internal 0x858ce2d99a674a340a1baf1f308e3dca0a697e86
recipient STRING external 0x406198aD26DeD711878b2702a9Fa23fdCB4a557e
Sample Output
                
{
"command": "paymentGatewayCallback",
"params": {
    "receivedTxID": "0x4eb58a8394b14200371d77eba9281415721873f4b83bce829b1a2fb3240ab57f",
    "referenceID": "2552510",
    "txDetails": {
        "input": [{
        "receivedTxID": "0x4eb58a8394b14200371d77eba9281415721873f4b83bce829b1a2fb3240ab57f",
        "amount": "0.100000000000000000",
        "unit": "ETH",
        "type": "ethereum",
        "exchangeRate": "478.8574884700",
        "referenceID": 2552510,
        "charges": {
            "amount": "0.010000000000000000",
            "unit": "ETH",
            "type": "ethereum",
            "exchangeRate": "478.8574884700"
        },
        "minerFee": {
            "amount": "0.000105000000000000",
            "unit": "ETH",
            "type": "ethereum",
            "exchangeRate": "478.8574884700"
        }
        }],
        "output": [{
        "destination": {
            "amount": "0.089790000000000000",
            "unit": "ETH",
            "type": "ethereum",
            "exchangeRate": "478.8574884700"
        },
        "charges": {
            "amount": "0.010000000000000000",
            "unit": "ETH",
            "type": "ethereum",
            "exchangeRate": "478.8574884700"
        },
        "minerFee": {
            "amount": "0.000105000000000000",
            "unit": "ETH",
            "type": "ethereum",
            "exchangeRate": "478.8574884700"
        }
        }]
    },
    "txID": "0x51f7dc400c3f127ef9ce12d6684408e0fc631ccbf165b9622b73e4c3a219cdfc",
    "amount": "0.08979 ETH",
    "amountReceive": "0.1 ETH",
    "serviceCharge": "0.01 ETH",
    "minerAmount": "0.000105 ETH",
    "address": "0x46739ede49c94be3de880d2e2511aa34549bb6a5",
    "status": "success",
    "transactionDate": "2020-11-20 10:08:07",
    "transactionUrl": "https://ropsten.etherscan.io/tx/0x51f7dc400c3f127ef9ce12d6684408e0fc631ccbf165b9622b73e4c3a219cdfc",
    "type": "ethereum",
    "sender": {
        "internal": "",
        "external": "0xf4dd12271cb73b5eda57721334e59bce0f2cacca"
    },
    "recipient": {
        "internal": "",
        "external": "0x406198aD26DeD711878b2702a9Fa23fdCB4a557e"
    }
}
}

            
Whitelist Address API
This API is use to whitelist the address.
Path:
https://api.nuxpay.com/whitelist/address/multi
Request Type:
POST
Request Parameter:
Parameter Data Type Description Sample Value
business_id STRING business_id 16226
api_key STRING whitelisting module api key n32MKbhtYTIuw84EeOVa7qmplLcJHGRy
address Objects address [{"address": "0x16643a9f1475c5552d11d93f41db00e20b477348", "wallet_type": "tetherusd"}, {"address": "0xade4f9852a30860f01539392247ba545e3a138d9", "wallet_type": "bitcoin"}, {"address": "2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH", "wallet_type": "bitcoin"}]
Successful Response Value (Status code: 200)
Parameter Data Type Description Sample Value
code INTEGER Response Code 1/0
message STRING Response Message Success/Failed
data Objects Whitelist Data [{
"address": "0x16643a9f1475c5552d11d93f41db00e20b477348",
"wallet_type": "tetherusd",
"status": "Failed",
"reason": "Duplicate address detected"
}, {
"address": "0xade4f9852a30860f01539392247ba545e3a138d9" ,
"wallet_type": "bitcoin",
"status": "Failed",
"reason": "Invalid address"}, {
"address": "2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH",
"wallet_type": "bitcoin",
"status": "Success",
"reason": "Success"}]
Sample Output
                
code : 1
message : Success
message_d : Success
data :
  0 :
    address : 0x16643a9f1475c5552d11d93f41db00e20b477348
    wallet_type : tetherusd
    status : Failed
    reason : Duplicate address detected
  1 :
    address : 0xade4f9852a30860f01539392247ba545e3a138d9
    wallet_type : bitcoin
    status : Failed
    reason : Invalid address
  2 :
    address : 2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH
    wallet_type : bitcoin
    status : Success
    reason : Success

            
Automate Fund Out
This is a function to enable your application to send crypto-currencies to your customer. The fund will be transferred from your dedicated wallet to your recipient address. Before performing this transaction, your find out address needs to have sufficient balance, and whitelist the recipient of this transaction. Currently Fund Out only supports USDT, ETH & BTC.

You may find your fund out address from Fund Out page.

The whitelist of your recipient need to be done in Whitelist Address page

Path:
https://api.nuxpay.com/​crypto/external/transfer
Request Type:
POST
Request Parameter:
Parameter Data Type Description Sample Value
business_id STRING The business_id can be obtained from NuxPay settings. 12345
api_key STRING The api_key can be obtained from NuxPay dashboard. DO3ImBQzZbwsSEc69J14pkijTY5auVkN
wallet_type STRING This attribute is to include the cryptocurrency that you wanna perform the transaction, may refer section Wallet Type. tetherusd
reference_id STRING This attribute is for you to identify the transaction while NuxPay responds to your request and callback to your Callback URLon status update. invoice001
recipient_address STRING The recipient_address is the wallet address that is going to receive the fund out from your address. It has to be whitelisted before performing this transaction. 0x05fc5a079e0583b8a07526023a16e2022c4c6296
amount STRING It’s the amount that will fund out from your fund out address to recipient_address. The balance in your fund out address needs to be sufficient to perform this transaction. 1200.89
Sample Output
                
{
    "business_id": "12345",
    "api_key": "DO3ImBQzZbwsSEc69J14pkijTY5auVkN", 
    "wallet_type": "tetherusd",
    "reference_id": "invoice001", 
    "recipient_address": "0x05fc5a079e0583b8a07526023a16e2022c4c6296", 
    "amount": "1200.89"
}

            
If the request have successfully received in NuxPay​ endpoint, will response attribute as below:
Parameter Data Type
code Example:
1
The code is identified as the status of this request.
If ​1​ = Success and able to process;
If ​0​ = Fail to process due to error
message Example:
SUCCESS
This message will return the status of this request in word.
If ​SUCCESS​ = Success and able to process;
If ​FAILED​ = Fail to process due to error
message_d Example:
Success
This message_d will return the message description of
this request in sentences.
data The details of the response will be in the data object.
referenceID Example:
invoice001
This data is for you to identify the transaction while you request Fund Out via NuxPay API.
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d
71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund
out request from Fund Out address to recipient address.
amountDetails This object is the transaction amount from fund out
address to recipient wallet address.
amount Example:
12.089000
The transaction amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction
exchangeRate This object will provide the conversion rate of the
wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d
71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund
out request from Fund Out address to recipient address.
serviceChargeDetails This object is the transaction amount from fund
out address to NuxPay service charge wallet address.
amount Example:
12.089000
The transaction amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the
wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d
71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund
out request from Fund Out address to NuxPay services charge wallet address.
feeChargeDetails This object is the transaction amount from fund
out address to NuxPay miner/gas fee wallet address.
amount Example:
12.089000
The transaction amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the
wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d
71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund
out request from Fund Out address to NuxPay miner/gas fee wallet address.
feeDetails This object is the transaction amount from fund out address to NuxPay miner/gas fee in actual wallet address.
amount Example:
0.00054000
The miner fee amount is return in decimal value.
unit Example:
ETH
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the
wallet_type in fiat currency
USD Example:
461.95000000
confirmation Example:
0
This is the confirmation of this transaction from
Fund Out Address to Recipient Wallet Address in blockchain network.
status Example:
pending
The status of the transaction in blockchain network.
time Example:
2020-11-04 14:09:12
The timing while returning this response.
successTime Example:
2020-11-04 14:09:12
This is the timing while returning this response with status of success.
whitelist Example:
Address is whitelisted.
It will show if the recipient address has been whitelisted in your NuxPay account.
isWhitelist Example:
1
It will show if the recipient address has been whitelisted in your NuxPay account.
If ​1​ = whitelisted.
If ​0​ = not whitelisted.
errorMessage Example:
Insufficient balance
If the requests have failed to process, it will return the error info here.
errorType Example:
destination
If the requests have failed to process, it will return the error type here.
errorCode Example:
E10000
If the requests have failed to process, it will return the error code here.
balance Example:
20000000
The balance of Fund Out Address.
If Request is Successful:
                    {
"code": 1,
"message": "SUCCESS", 
"message_d": "Success", 
"data": {
    "referenceID": "test",
    "transactionHash": "0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d71f8e02b05d4cb50d2172222",
    "amountDetails": {
        "amount": "10.000000", 
        "unit": "USDT", 
        "walletType": "tetherusd", 
        "exchangeRate": {
            "USD": "0.99918496" 
        },
        "transactionHash": "0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d71f8e02b05d4cb50d2172222"
    }, 
    "serviceChargeDetails": {
        "amount": "1.000000", 
        "unit": "USDT", 
        "walletType": "tetherusd", 
        "exchangeRate": {
            "USD": "0.99918496" 
        },
        "transactionHash": "0x762a0796d08e32975083b6b6e5caa752c9bc4d85995afee211c3a2859f4a31df"
    }, 
    "feeChargeDetails": {
        "amount": "0.278026", 
        "unit": "USDT", 
        "walletType": "tetherusd",
    "exchangeRate": { 
        "USD": "0.99918496"
    }, 
    "transactionHash":"0x09aef2d60c10ff068394bcdd6b2b80b5412bedcb25ecba2ee44c1459097dee23" 
    },
    "confirmation": 0,
    "status": "pending",
    "time": "2020-11-04 14:09:12", 
    "successTime": "",
    "whitelist": "Address is whitelisted.", 
    "isWhitelist": "1"
    }
}
                        
                    
Error when insufficient balance in fund out address:
{
	"code": 0,
	"message": "FAILED",
	"message_d": "Insufficient balance", 
	"data": {
		"errorCode": "E10000",
		"errorMessage": "Insufficient balance", 
		"totalTokenAmount": "110279478", 
		"balance": 20000000,
		"referenceID": "test"
	}
}               
            
Error when address did not Whitelist:
{
	"code": 0,
	"message": "FAILED",
	"message_d": "Address are not whitelisted.",
	"data": {
		"errorMessage": "Address are not whitelisted.",
		"errorType": "destination",
		"isWhitelist": "0",
		"referenceID": "test"
	}
}	     
			
            
After https://www.nuxpay.com have successfully received the request, while there’s updates on the transaction status, it will make a callback to your ​Callback URL​ as below:
command Example:
externalFundOutCallback
This command will return the type of request callback.
params The details of the callback will be in the data object.
referenceID Example:
invoice001
This data is for you to identify the transaction while you request Fund Out via NuxPay API.
transactionToken Example:
f072043dd4a7a9573a3cc3305a85fe2d
The transactionToken is to identify the validity of this transaction with the blockchain network.
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37
d71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund out request from Fund Out address to recipient address.
amountDetails This object is the transaction amount from fund out address to recipient wallet address.
amount Example:
12.008900
The transaction amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37
d71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund out request from Fund Out address to recipient address.
serviceChargeDetails This object is the transaction amount from fund out address to NuxPay service charge wallet address.
amount Example:
12.008900
The service charge amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37
d71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund out request from Fund Out address to NuxPay service charge wallet address.
feeChargeDetails This object is the transaction amount from fund out address to NuxPay miner/gas fee wallet address.
amount Example:
12.008900
The miner fee amount is return in decimal value.
unit Example:
USDT
The wallet_type of the transaction in symbol.
walletType Example:
tetherusd
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the wallet_type in fiat currency
USD Example:
0.99918496
transactionHash Example:
0x5eb98f8f65ac07fed0d0b1d4be264875da58b37
d71f8e02b05d4cb50d2172222

The transactionHash is the unique hash for this fund out request from Fund Out address to NuxPay miner/gas fee wallet address.
feeDetails This object is the transaction amount from fund out address to NuxPay miner/gas fee in actual wallet address.
amount Example:
0.00054000
The miner fee amount is return in decimal value.
unit Example:
ETH
The wallet_type of the transaction in symbol.
walletType Example:
ethereum
The wallet_type of this transaction.
exchangeRate This object will provide the conversion rate of the wallet_type in fiat currency
USD Example:
461.95000000
confirmation Example:
78
This is the confirmation of this transaction from Fund Out Address to Recipient Wallet Address in blockchain network.
status Example:
confirmed
The status of the transaction in blockchain network.
time Example:
2020-11-11 11:14:29
The timing while returning this callback.
successTime Example:
2020-11-11 11:14:38
This is the timing while returning this callback with status of success.
Example of Callback Data:
                
{
"command": "externalFundOutCallback", 
"params": {
    "referenceID": 0,
    "transactionHash": "0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d71f8e02b05d4cb50d2172222",
    "amountDetails": {
        "amount": "10.000000", 
        "unit": "USDT", 
        "walletType": "tetherUSD", 
        "exchangeRate": {
            "USD": "382.73742481" 
        },
        "transactionHash": "0x5eb98f8f65ac07fed0d0b1d4be264875da58b37d71f8e02b05d4cb50d2172222"
    }, 
    "serviceChargeDetails": {
        "amount": "1.000000", 
        "unit": "USDT", 
        "walletType": "tetherUSD", 
        "exchangeRate": {
            "USD": "382.73742481"
        }, 
    "transactionHash":"0x762a0796d08e32975083b6b6e5caa752c9bc4d85995afee211c3a2859f4a31df" 
    },
    "feeChargeDetails": { 
        "amount": "0.278026", 
        "unit": "USDT", 
        "walletType": "tetherUSD", 
        "exchangeRate": {
            "USD": "382.73742481" 
        },
        "transactionHash": "0x09aef2d60c10ff068394bcdd6b2b80b5412bedcb25ecba2ee44c1459097dee23"
    },
    "confirmation": 52,
    "status": "confirmed",
    "time": "2020-11-04 14:09:07", 
    "successTime": "2020-11-04 14:08:42"
    }
}              
            
Whitelist Address API
This API is use to whitelist the address.
Path:
https://api.nuxpay.com/whitelist/address/multi
Request Type:
POST
Request Parameter:
Parameter Data Type Description Sample Value
business_id STRING business_id 16226
api_key STRING whitelisting module api key n32MKbhtYTIuw84EeOVa7qmplLcJHGRy
address Objects address [{"address": "0x16643a9f1475c5552d11d93f41db00e20b477348", "wallet_type": "tetherusd"}, {"address": "0xade4f9852a30860f01539392247ba545e3a138d9", "wallet_type": "bitcoin"}, {"address": "2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH", "wallet_type": "bitcoin"}]
Successful Response Value (Status code: 200)
Parameter Data Type Description Sample Value
code INTEGER Response Code 1/0
message STRING Response Message Success/Failed
data Objects Whitelist Data [{"address": "0x16643a9f1475c5552d11d93f41db00e20b477348", "wallet_type": "tetherusd", "status": "Failed", "reason": "Duplicate address detected"}, {"address": "0xade4f9852a30860f01539392247ba545e3a138d9" ,"wallet_type": "bitcoin", "status": "Failed", "reason": "Invalid address"}, {"address": "2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH", "wallet_type": "bitcoin", "status": "Success", "reason": "Success"}]
Sample Output
                

code : 1
message : Success
message_d : Success
data :
  0 :
    address : 0x16643a9f1475c5552d11d93f41db00e20b477348
    wallet_type : tetherusd
    status : Failed
    reason : Duplicate address detected
  1 :
    address : 0xade4f9852a30860f01539392247ba545e3a138d9
    wallet_type : bitcoin
    status : Failed
    reason : Invalid address
  2 :
    address : 2N9ogZNCkdrJrH2sxWFjhfRRoqRMev73KEH
    wallet_type : bitcoin
    status : Success
    reason : Success


                
            
Address
2051 Junction Ave, Suite 212
San Jose CA 95131
USA
Email
Contact Us
Connect With Us
We Accept

Copyright © 2021 NuxPay. All Rights Reserved. Terms & Condition | Privacy Policy.