Mandates

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/customers/{customercode}/mandates

Method(s):

post, get, delete

Response Formats:

JSON, XML

Description:

Allows to setup/get/delete a mandate for a particular customer

Parameters

NameTypeDescription
AmountNumericAmount for the mandate which can be used for direct debit. This amount is the maximum amount that can be used within a duration specified in AmountValidity property.
TitleStringTitle of the mandate
DescriptionStringDescription of the mandate.
AmountValidityStringAmountValidity is the period in which specified amount can be used. The acceptable values for this parameter are:
1. Monthly
2. Quarterly
3. Yearly
EMailIdStringEMailId on which confirmation email will be sent for setting up direct debit
RequestTimeDateRequest time for mandate
StatusStringStatus of mandate. The acceptable values for this parameter are:
1. Pending
2. Verified
IsGoCardlessMandateSetBooleanWhether GoCardless mandate has been set up or not for the customer. But mandate may or may not be verified.

POST Operation

Sets up a mandate for specified customer. Only one mandate can be setup for a customer.
Api returns 400 if mandate already exists for the customer.
Following fields are mandatory for the post operation –
1. Amount
2. AmountValidity
3. EMailId

Api returns 201 if request is successful.

URL : /customers/{customercode}/mandates

Example request for POST of mandate


{
	"Amount": 345,
	"Title": "Setting up mandate for customer xyz",
	"Description": "Sample description",
	"EMailId": "someone@kashflow.com",
	"AmountValidity": "Yearly"
}

Example response for POST of mandate


{
	"Amount": 345,
	"Title": "Setting up mandate for customer xyz",
	"Description": "Sample description",
	"EMailId": "someone@kashflow.com",
	"AmountValidity": "Yearly"
}

GET Operation

Gets the mandate for specified customer. Api returns 200 if request is successful. If no mandate exists for the customer then api returns IsGoCardlessMandateSet property as false.

URL : /customers/{customercode}/mandates

Example response for GET of mandate

      

   {
    "Amount":10.0000,
    "AmountValidity":"Yearly",
    "RequestTime":"2014-06-26 12:14:21",
    "Status":"Pending",
    "IsGoCardlessMandateSet": true
   }

DELETE Operation

Deletes the mandate for specified customer. Api returns 204 if request is successful.

URL : /customers/{customercode}/mandates

See how KashFlow works with your business and your books