Create Template
Template API helps us to create custom payment page template which we are going to show to the user, example is shared below.
Last updated
POST https://api.ninjapay.me/webextension/api/v1/fiat/realtime-payment-link/link
Body (application/json)
{
"type": "1",
"template_id": "null",
"title": "title of paymeny link",
"currency": "INR",
"amount": 1,
"allow_partial_payment": false,
"single_use": false,
"cust_phone": "8302280166",
"cust_email": "example.com",
"cust_full_name": "dummy name",
"ask_during_payment": false,
"only_phone": false,
"phone_code": "+91",
"only_email": false,
"link_expiry": null,
"is_sms": false,
"is_whatsapp": false,
"is_invoice_generate": false,
"enable_upi_qr": false,
"include_order_id_in_redirect": false,
"cust_reference_id": "",
"include_cust_ref_in_payment_link": false,
"redirect_url": "",
"cust_thanks_msg": "",
"custom_logo_url": "",
"custom_pay_text": "",
"tnc": "",
"reference_notes": "",
"expiry_id": null,
"allow_tips":false,
"webhook":"",
"reference_order_id":""
}
{
"status": true,
"data": {
"link_id": "RTLSpvmCCWL5YbgoQIy1uKO", // id of this payment link
"super_order_id": "FT_RTPL_SOeK5pKhG51kOcMYaNNGTL",
"qr_base64": "", // base 64 image of qr if qr customise is been done
"pay_link": "", // upi link for direct payment
"expiry_date": "2024-08-06 08:52:11", // expiry of invoice
"order_id": "FT_RTPL_SOTbKI1uC7uYfGMvDvOAw9" //
},
"message": "Payment link created successful"
}{
"STATUS":"", //
"ORDER_ID":"",
"CURRENCY":"",
"RESP_MSG":"",
"PAYMENT_MODE":"",
"TXN_ID":"",
"AMOUNT":"",
"CUS_REF_ID":"",
"TXN_DATE":"",
"CHECKSUMHASH":"",
"REFERENCE_ORDER_ID":""
}
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'API_KEY'
},
body: '{"amount":10,"title":"sample_description","reference_order_id":"myperosnalid","webhook":"https://yourwebhook.com" }'
};
fetch('https://api.ninjapay.me/webextension/api/v1/fiat/realtime-payment-link/link', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));