tax_country (string): Country where the tax is applicable
is_all_states (boolean): If tax is applicable to all states
tax_states (array): List of states where tax is applicable (empty if all states)
Request Body
Body (application/json)
{
"id": "", // if need to update template add value here from get template api response
"template": {
"business_logo": "https://awesomecompany.com", // URL of the business logo
"business_name": "Awesome Company", // Name of the business
"phone": "234567890", // Contact phone number (without country code)
"phone_code": "+1", // Country code for the phone number
"email": "sample@gmail.com", // Contact email address
"billing_address": "123 Main Street", // Billing address
"city": "Hyderabad", // City of the business
"state": "Telangana", // State of the business
"zipcode": "12345", // Zipcode of the business
"country": "USA", // Country of the business
"documents": {
"doc_1": {
"title": "PAN", // Title of the document
"value": "HG297323" // Value of the document
},
"doc_2": {
"title": "GST", // Title of the document
"value": "76YHGF67656" // Value of the document
}
},
"default_currency": "USD", // Default currency for transactions
"enable_qr": true, // Enable or disable QR code generation
"redirect_url": "", // URL to redirect after payment
"include_invoice_id": true, // Include invoice ID in the documentation
"webhook_url": "", // URL for webhook callbacks
"terms_condition_url": "https://google.com", // URL for terms and conditions
"custom_thanks_message": "Thank you for your payment!", // Custom thank you message
"custom_button_text": "", // Custom text for the payment button
"green_donation_link": "", // URL for green donation link
"donation_percentage": 0.0, // Percentage of donation
"donation_message": "", // Message regarding donations
"tax_details": {
"tax_title": "GST", // Title for tax
"tax_percentage": 18, // Tax percentage
"tax_country": "India", // Country where the tax is applicable
"is_all_states": true, // If tax is applicable to all states
"tax_states": [] // List of states where tax is applicable (empty if all states)
}
}
}
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'API_KEY' //Invoice key required
},
body: {
"id": "", // if need to update template add value here from get template api response
"template": {
"business_logo": "https://awesomecompany.com", // URL of the business logo
"business_name": "Awesome Company", // Name of the business
"phone": "234567890", // Contact phone number (without country code)
"phone_code": "+1", // Country code for the phone number
"email": "sample@gmail.com", // Contact email address
"billing_address": "123 Main Street", // Billing address
"city": "Hyderabad", // City of the business
"state": "Telangana", // State of the business
"zipcode": "12345", // Zipcode of the business
"country": "USA", // Country of the business
"documents": {
"doc_1": {
"title": "PAN", // Title of the document
"value": "HG297323" // Value of the document
},
"doc_2": {
"title": "GST", // Title of the document
"value": "76YHGF67656" // Value of the document
}
},
"default_currency": "USD", // Default currency for transactions
"enable_qr": true, // Enable or disable QR code generation
"redirect_url": "", // URL to redirect after payment
"include_invoice_id": true, // Include invoice ID in the documentation
"webhook_url": "", // URL for webhook callbacks
"terms_condition_url": "https://google.com", // URL for terms and conditions
"custom_thanks_message": "Thank you for your payment!", // Custom thank you message
"custom_button_text": "", // Custom text for the payment button
"green_donation_link": "", // URL for green donation link
"donation_percentage": 0.0, // Percentage of donation
"donation_message": "", // Message regarding donations
"tax_details": {
"tax_title": "GST", // Title for tax
"tax_percentage": 18, // Tax percentage
"tax_country": "India", // Country where the tax is applicable
"is_all_states": true, // If tax is applicable to all states
"tax_states": [] // List of states where tax is applicable (empty if all states)
}
}
}
};
fetch('https://api.ninjapay.me/webextension/api/v1/fiat/invoice/user/template/create', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));