Request a new Payment
Once you have obtained the merchant code
, you can initiate a new payment transaction.
Please ensure you obtain the preferred currency of your users for transactions.
note
The document ID for USDT
is 66aa386f9dd55e246fb617e6
. Further cryptocurrencies and upcoming versions will be provided in due course.
And for the request's headers:
warning
Do not forget to paste your merchant code in the headers
.
Request methods:
- cURL
- Js - Fetch
- flutter
cURL request
curl -XPOST -H 'merchant: YOUR MERCHANT CODE' -H "Content-type: application/json" -d '{
"reason": "Blah Blah",
"amount": 32,
"currency": "66aa386f9dd55e246fb617e6",
"redirectUrl": "https://your-website.com/pay/verify"
}' 'https://api.nasrpay.com/api/v1/payment/request'
Fetch request
fetch('https://api.nasrpay.com/api/v1/payment/request', {
method: 'POST',
headers: {
'merchant': 'YOUR MERCHANT CODE',
'Content-type': 'application/json'
},
body: JSON.stringify({
'reason': 'Blah Blah',
'amount': 32,
'currency': '66aa386f9dd55e246fb617e6',
'redirectUrl': 'https://your-website.com/pay/verify'
})
});
Will be added in the newer versions 🤍
response:
{
success: true,
transactionId: "doc-transaction-id",
link: "https://nasrpay.com/pay/verify/doc-transaction-id"
}
success
Now you can redirect user to payment page!