How to trigger emails for all your documents via API?
With a separate end points, trigger emails to your clients/vendors, either at the time of creating an accounting document, or any time after.
There are two ways you can share a document with your client or vendor:
While creating a document
Via a separate endpoint for emails via POST
While creating an invoice, you can add a separate object for email.
Important Note: Only use "email.from" fields if you want to send emails from your own email address. For that, you will first need to connect your personal/work email with Refrens (_See how to do that>_). If you don't add the "email.from" fields, the emails will be sent from our own system email.
Quotations:
Delivery Challans:
Invoices and all other documents:
> urlKey: Your business URL key
> invoiceID: the ID of the document you want to share over email. Find the document ID as part of the response under "_id"
There are two ways you can share a document with your client or vendor:
While creating a document
Via a separate endpoint for emails via POST
1) Email while creating an invoice
While creating an invoice, you can add a separate object for email.
Name | Type | Description |
---|---|---|
reminders.to | object | Main recipient of email |
reminders.to.name | string | Name of main recipient |
reminders.to.email | Email of main recipient | |
reminders.cc | array[object] | email CC list |
reminders.cc[].name | string | Name of recipient |
reminders.cc[].email | Email of recipient | |
reminders.from | object | Email from |
reminders.from.name | string | Sender Name |
reminders.from.email | Sender Email |
Important Note: Only use "email.from" fields if you want to send emails from your own email address. For that, you will first need to connect your personal/work email with Refrens (_See how to do that>_). If you don't add the "email.from" fields, the emails will be sent from our own system email.
Sample Payload
"reminders": {
"to": {
"name": "John",
"email": "John@gmail.com"
},
"cc": {
"email": "richard@xyz.com"
},
"from": {
"email": "steve@xyz.com",
"name": "steve"
}
}
2) Via separate end-point, post invoice creation
URL:
Quotations:
https://api.refrens.com/businesses/:urlKey/quotations/:invoiceID/email
Delivery Challans:
https://api.refrens.com/businesses/:urlKey/deliverychallans/:invoiceID/email
Invoices and all other documents:
https://api.refrens.com/businesses/:urlKey/invoices/:invoiceID/email
> urlKey: Your business URL key
> invoiceID: the ID of the document you want to share over email. Find the document ID as part of the response under "_id"
Sample Payload
{
"cc": [
{
"email": "richard@xyz.com",
"name": null
}
],
"to": {
"email": "John@gmail.com",
"name": "John"
},
"from": {
"name": "Steve",
"email": "steve@xyz.com"
}
}
Sample Response
{
"cc": [],
"to": {
"email": "John@gmail.com",
"name": "John"
},
"from": {
"name": "Steve"
"email": "steve@xyz.com"
},
"emailType": "email",
"isExpenditureEmail": false,
"subject": "[Important] Email Invoice For API Client - #UG0262",
"body": "Hi Infosys,\n\nPlease find attached invoice #UG0262.\n\nInvoice No: #UG0262\nInvoice Date: Dec 12, 2023\nBilled To: API Client\nInvoice Amount: ₹1,180.0\nAmount Received: ₹1,180.0\nTotal: ₹1,180\nPayment Date: Dec 12, 2023\n\nThank you for your business.\n\nRegards ,\nRefrens Demo"
}
Updated on: 31/01/2025
Thank you!