> ## 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 Real-Time Billing with EDD

Mandates may be used for real-time billing with European Direct Debit (EDD). While recurring billing associates the mandate with an `AutoBill` object, real-time billing associates a mandate with a `Transaction` object.

For more information on working with mandates, see [Understanding Mandates for Recurring Billing with EDD](Understanding_Mandates_f#).

To enable mandate storage for a real-time transaction:

1. Upload the HTML template of the mandate’s general text to the Vindicia servers.

2. Inform Subscribe that you intend to store the mandate for a transaction by including special flags in the form of name–value pairs in the `Transaction` object before calling `auth()`or `authCapture()`.

   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 `Transaction` object. |
   | vin:MandateVersion | Specifies the mandate instance to be used for the associated `Transaction` object. 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 `Transaction` object.

4. Add the name–value pairs to the `Transaction` object before calling `authCapture()` on it.

## Enable mandate storage for a transaction:

```

$tx->setSourcePaymentMethod($paymentMethod);
 
// Set flags in the transaction 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');
 
$tx->setNameValues(array($nv1, $nv2, $nv3));
 
// authCapture the transaction as shown in the previous example.
```

When creating a mandate instance to store with a transaction, Subscribe uses the template that matches the `preferredLanguage` attribute of the `Account` 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 UD DD payment method.

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

**Parent topic:**[Using EDD and UK DD for One-Time Transactions](../topics/Using_EDD_and_UK_DD_for__1)


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