fbpx

Customer Statement Bulk Email

This s a documentation page for our shiny new REST API - you weren't meant to find it. This API isn't ready for public use yet. We're chopping and changing it a LOT as we grow it. So if you build something that uses it then it's very likely to break in a future update. Don't say you weren't warned!

URL:

https://api.kashflow.com/v2/customerstatements/bulk/email?startdate={startdate}&enddate={enddate}&excludepaidinvoices={excludepaidinvoices}&filterby={filterby}

Method(s):

post

Response Formats:

JSON or XML

Description:

This method allows you to email multiple customer statements at one go. The request body should consist of List ( array ) of customer codes whose statements need to be emailed.

{startdate} and {enddate} are the dates between which customer invoices are taken into consideration in the statement to be mailed. These dates need to be specified in yyyymmdd format. If {startdate} and {enddate} are not supplied, statement for last three months is mailed.

If {filterby} parameter is set to ‘All’, then irrespective of the date specified, all invoices for the customer will be enlisted in the statement.

{excludepaidinvoices} is a numeric field which when set to 1, excludes paid invoices from the statement. 0 is the default value for this parameter.

Note : Maximum 35 customers statements can be emailed at a time.

The response of this request is a list of status objects for each of the customer statement mailed. Each status object has the fields mentioned in the following table:

NameTypeDescription
CustomerCodeStringUnique code of the customer whose statement is to be mailed
SentBooleanTrue/False
MessageStringThe descriptive message stating the reason for mail sending failure.

Important features
1. Emails will be sent with the template setup for the customer whose statement is to be sent.
2. If emails are successfully marked for sending, a customer note is created.
3. Even if one or more invalid customer(s) are specified, email will be sent for the remaining valid customer(s).
4. If one or more customer(s) have invalid customer email id, the processing of other customer(s) with valid email id’s will not be interrupted.

URL : /customerstatements/bulk/email?startdate=20130101&enddate=20131010&excludepaidinvoices=1&filterby=all

Example request


[ "101", "CUST123", "CUST2345", "0065" ]

Example response


{
  {
    "CustomerCode": "101",
    "Sent": true,
    "Message": "Marked to send"
  },
  {
    "CustomerCode": "CUST123",
    "Sent": false,
    "Message": "Invalid customer code"
  },
  {
    "CustomerCode": "CUST2345",
    "Sent": false,
    "Message": "Invalid customer email address"
  },
  {
    "CustomerCode": "0065",
    "Sent": true,
    "Message": "Marked to send"
  }
}

See how KashFlow works with your business and your books