NACE Pay API Documentation
NACE Pay API Documentation
Overview
New Age Crypto provides a standards-based REST interface which enables application developers to
interact with their New Age Crypto merchant account. Using the New Age Crypto API, clients can
create depositing wallet address to accept BTC, ETH, LTC and BCH for payment, real time digital
asset to fiat rates and receive notification of payments received.
Environments
The following environments are available -
Getting Started
In order to use Trade API, user will have to go through few simple steps:
1. API key
2. HMAC authorization header
API key
To use API, user will need to obtain API Public key and Secret Key, which are passed to API
with every request. API keys can be generated in your merchant dashboard at
pay.newagecrypto.com under Settings > API Keys section.
Once user obtained API key, it is all set up! Now, the only thing left is to form HMAC
authorization header variable. In order to form this header, user will need following variables:
var apikey = 'public key'; / key obtained from New Age Crypto
var secretkey = 'secret key'; / secret obtained from New Age Crypto
var timestamp = Math.floor(Date.now() / 1000); / timestamp in seconds
var nonce = Math.floor(Math.random() * Math.floor(1000000)); / random nonce integer
The last variable, which is needed is Parameters from body (JSON), String consists of ALL
parameters from body separated by '&' sign if more than one (for example:
'ref_id=mk1231sa11×tamp=1588364168&nonce=900288).
bodyString='ref_id=mk1231sa11×tamp=1588364168&nonce=900288’
bodyString='ref_id=mk1231sa11&url=https:/yourwebhookurl.com×tamp=1588364168&n
once=900288¤cy=USD’
Finally, user has to put all of the variables together and encode them:
That's it! User can now use variable 'authentication' as header to communicate with trade API.
User Merchant ID can be found in user New Age Crypto dashboard at pay.newagecrypto.com
or sandbox.digitalpaydev.com under Settings > section Account information section.
https:/payapi.newagecrypto.com:5000/usr/wallet/<asset>/create
https:/api.digitalpaydev.com:5000/usr/wallet/<asset>/create
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
"ref_id": "user unique reference/invoice id per client",
"url": "https:/yourwebhookurl.com", (optional field, this will override the webhook url set in the
API key options. )
"timestamp": 1550838976,
"nonce": 693795,
“currency”:”USD” ( options USD,CAD,EUR. If field is not included USD is used by default. )
}
{
"status": "error",
"message": "Access Invalid"
}
Or
{
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
"status": "error",
"message": " Could Not Create Address
"
}
Instant Payment Notifications (IPNs) are sent from New Age Crypto upon every confirmed
status change. IPNs are POSTed to your webhook URL specified in user New Age Crypto
dashboard. If the New Age Crypto gateway receives an HTTP/1.1 200 OK response from
your server, the message is deemed to have been correctly delivered.
NOTE: This does not mean user application correctly handled the data - only that it was
received successfully by user server!
If an HTTP error code is received by the gateway, New Age Crypto server will attempt to
resend the IPN at increasing time intervals.
The amount of time between each re-post is as follows: 1 minute delay, 2 minute delay, 4
minute delay, 8 minute delay, 20 minute delay, 40 minute delay, 80 minute delay, 160
minute delay, 320 minute delay, 640 minute delay and 1,280 minute delay. The IPN system
stops re-posting when:
New Age Crypto receives a basic HTTP "200 OK" response from your web server, or
when 1,280 minutes have passed since the initial post.
Headers
signature CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(Body, secretkey));
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
Body
{"ref_id":"wm_123323",
"price":8550.26,
"amount":0.0006,
"total":5.13,
"date_time":"1588354319000",
"transaction_id":"c3c2920e4705cc37c57d0937576d6346c27ca81f2b9e507fd47a1de113b7bba
9",
"coin":"BTC",
"network":"testnet",
"currency":"USD",
"confirmation":"6",
"status":"Paid",
"fee":"0.2",
"source_address":" 0x3C965939Ca2d63962b4D0bdF84863262870eE198",
"type":"Payment" (Payment | Reused)
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
"address": "bchtest:qpggts6de95hnutg8wrxx55mh9z2dnxp2v64tuqn73",
“all”:false, (optional true | false)
"timestamp": 1550838976,
"nonce": 693795
}
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
"txid": "0bd4d3c2ab491649bc5c7328aba8d46b2c2c856ca5cd8261d489a7e01c2a5f12",,
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
“all”:false, (optional true | false)
"timestamp": 1550838976,
"nonce": 693795
}
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
"ref_id": "89012121-1212",
“all”:false, (optional true | false)
"timestamp": 1550838976,
"nonce": 693795
}
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
"ref_id": "89012121-1212",
"timestamp": 1550838976,
"nonce": 693795
}
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
"contact": {"email":"[email protected]",
"firstname":"first name",
"lastname":"last name",
"company":"company name",
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
"address":"address",
"city":"city",
"prov_state":"province or state",
"country":"country",
"postal_zip":"postal/zip code",
"phone":"phone"},
"ref_id":"your invoice ref number",
"items":[{"item":"product name","cost":"5","quantity":"2"}],
"total_amount":"10",
"currency":"USD", (USD|CAD|EUR)
"due_date":"2021-07-23",
"sendemail":false, (default true)
"url":"https:/yourwebhookurl", (not required)
"timestamp": 1627050940,
"nonce": 51487
}
Success Response
{
"status": "success",
"data": {
"invoice_id": "1cc1fe7e-b37b-5247-a0cc-5dc4a6a004ebc",
"invoice_url": "https:/digitalpaydev.com/payinvoice/?inv=1cc1fe7e-b37b-5247-a0cc-
5dc4a6a004ebc",
"ref_id": "your invoice ref number"
}
}
Production https:/payapi.newagecrypto.com:5000/usr/fees
Sandbox https:/api.digitalpaydev.com:5000/usr/fees
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
"timestamp": 1627050940,
"nonce": 51487
}
Success Response
{
"status": "success",
"fees": {
"main": {
"feeprecent": 2,
"extrafee": 0
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
},
"erc": {
"feeprecent": 2,
"extrafee": 15
},
"eth": {
"feeprecent": 2.5,
"extrafee": 0
}
}
}
Get Transactions
Production https:/payapi.newagecrypto.com:5000/usr/transactions
Sandbox https:/api.digitalpaydev.com:5000/usr/transactions
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
"timestamp": 1627050940,
"nonce": 51487,
"startDate": ‘YYYY-MM-DD’
"endDate": ‘YYYY-MM-DD’
}
Success Response
{
"status": "success",
"data": [
{
"ref_id": "YourInvoiceId",
"date_time": "2022-06-03T13:51:44.000Z",
"address": "0x2C2c678ad144DA45616E9A676BFb7630e46E534e",
"tag": "",
"txid": "0xcc2a3181d4ff5926fe6b50d2e1884987bf52af432be17cbf7447b6d75a795fa7",
"price": 1789.78,
"payment_amount": 0.000558,
"total_payment": 1,
"coin": "ETH",
"status": "Paid",
"currency": "USD",
"settled_currency": "USD",
"settled_payment": ".975",
"settled_fee": 0.025,
"type": "Payment",
"note": ""
}]
Get Balances
Production https:/payapi.newagecrypto.com:5000/usr/balances
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
Sandbox https:/api.digitalpaydev.com:5000/usr/balances
Headers
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
"timestamp": 1550838976,
"nonce": 693795
}
Get Assets
Production https:/payapi.newagecrypto.com:5000/assets
Sandbox https:/api.digitalpaydev.com:5000/assets
{
"apps": “true” (optional field true (available on apps and API | false (available only through
the API)
}
]
}
Request Payment
Production https:/payapi.newagecrypto.com:5000/usr/request_payment
Sandbox https:/api.digitalpaydev.com:5000/usr/request_payment
Headers
{
"currency": “USD”, (options : USD | CAD | EUR | BTC | BCH | LTC | ETH | USDT | USDC |
DASH | XRP | SOL | USDT_TRON )
“type”:”Wire”, (only for USD | CAD | EUR options: Wire | ACH (USD only)| e-Transfer ( CAD
only)
"timestamp": 1550838976,
"nonce": 693795
}
{
"status": "success",
"data": {
"amount": 174.5547,
"fee": 20,
"currency": "USD",
"type": "Wire"
}
}
Settlement Payments
Production https:/payapi.newagecrypto.com:5000/usr/payments
Sandbox https:/api.digitalpaydev.com:5000/usr/payments
apikey. 9c0c51ee6f3798e3aae63ea630ddd2b7265fe54f
(public key value)
{
"timestamp": 1627050940,
"nonce": 51487,
"startDate": "YYYY-MM-DD", (optional (default all)– if used endDate must also be supplied)
"endDate": "YYYY-MM-DD", (optional (default all)– – if used startDate must also be supplied)
Success Response
{
"status": "success",
"data": [
{
"amount_paid": 3249.69,
"fee_amount": 82.53126,
"date": "2022-07-15T19:03:18.130Z",
"currency": "USD",
"payment_type_fee": 0,
"payment_type": "USDC",
"notes": "qwqwqwqwq"
},
{
"amount_paid": 3.99,
"fee_amount": 0,
"date": "2021-07-20T15:56:10.447Z",
"currency": "BTC",
"payment_type_fee": 0.01,
Copyright © 2022 Newagecrypto.com – [email protected]
Release: November 27th 2022 v.2.10.8
"payment_type": "BTC",
"notes": ""
}}