> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding Mandates for Recurring Billing with EDD

**Mandates** are written agreements from your customers that authorize you to withdraw funds from their bank accounts. Although you can create `AutoBills` without mandates in Subscribe, Vindicia recommends that you store mandates, because it is required by law in most countries that support EDD.

To enable mandate storage for an AutoBill paid through UK DD or EDD:

1. Upload the HTML template of the mandate’s general text to Vindicia. Each template must specify the country to which the template applies (see the valid values for `countryCode` in the DirectDebit Subobject in the **Subscribe API Guide)**, the language the template is in (specify the ISO code for the language), and the template’s version number. Contact Vindicia Client Services to upload your mandate template.

   The HTML mandate template contains placeholder tuples (tags), listed in the document European Direct Debit for Subscribe in The Netherlands, Germany, and Austria: An Overview. When creating an instance of the mandate from the template for a subscription, Subscribe replaces those tuples with the values from the corresponding `AutoBill` object, then stores the mandate instance with that `AutoBill` object in the Vindicia database.

2. Inform Subscribe that you intend to store the mandate for a subscription by including special flags in the form of name–value pairs in the `AutoBill` object before calling `update()` to create the object. The following table lists the flags.

| Name of Flag | Value |
| - | - |
| `vin:MandateFlag` | A value of 1 indicates that you would like to store the mandate for the associated `AutoBill` object. |
| `vin:MandateVersion` | Specifies the mandate instance to be used for the associated `AutoBill` object. **Note:** If you do not specify this field, Subscribe uses the most recently added template for the customer’s preferred language and country. |
| `vin:MandateBankName` | Specifies the name of the customer’s bank used for the mandate. (Required only in the Netherlands.) |

3. Include the source IP address from which the customer made this purchase in the `AutoBill` object. Some countries consider the IP address, coupled with the timestamp for the `AutoBill`’s creation, to be a valid replacement for the customer’s signature on the mandate.

   Subscribe accepts transactions without IP addresses, to allow for cases in which a paper mandate is kept on file, precluding the requirement for an IP address.

4. Add the name–value pairs to the code.

   Enable mandate storage for an existing AutoBill:

   (This example expands on the previous.)

   ```
   ...
   $autobill->setPaymentMethod($edd_pm);
    
   // Set flags in the autobill to enable mandate storage
   // You must have uploaded a mandate template of version 1.0 
   // to Vindicia servers prior to this.
    
   $nv1 = new NameValuePair();
   $nv1->setName('vin:MandateFlag');
   $nv1->setValue('1');
    
   $nv2 = new NameValuePair();
   $nv1->setName('vin:MandateVersion');
   $nv1->setValue('1.0');
    
   $nv3 = new NameValuePair();
   $nv1->setName('vin:MandateBankName');
   $nv1->setValue('Deutsche Bank');
    
   // nameValues attribute is available in Vindicia's AutoBill
   // object from API version 3.4 onwards
    
   $autobill->setNameValues(array($nv1, $nv2, $nv3));
    
   // update the AutoBill as shown in the previous example
   ```

Multiple mandate templates may be uploaded for different languages. When creating a mandate instance to store with an `AutoBill`, Subscribe uses the template that matches the `preferredLanguage` attribute of the `AutoBill` object associated with the transaction.

**Note:** If you do not specify a value for `preferredLanguage`, Subscribe defines the language for the mandate using the country specified in the EDD or UK DD payment method.

Use the Subscribe Portal to view and retrieve mandates. If you have enabled an AutoBill for mandate storage, a link to view the mandate is displayed on the AutoBill Detail page on the Portal. Click that link to display the PDF document for the mandate.

**Parent topic:**[Using EDD and UK DD for Recurring Billing](../topics/Using_EDD_and_UK_DD_for_)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.