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

# Mandate Details

> Technical reference for VRP mandate parameters in the Yapily API. Covers maximum amount, frequency, date ranges, and merchant category codes for recurring mandates.

Technical details about our handling of VRP mandates for payment validation.

<Info>
  All VRP periods reset **at midnight (UTC time)**, so consent-aligned periods do not take into account the time that the consent was created. In other words, the smallest relevant unit of time is a day.
</Info>

## Calendar Alignment

* `DAILY`
  * Period resets at midnight (UTC time).
* `WEEKLY`
  * Period resets **every Monday**.
* `EVERY_TWO_WEEKS`
  * **Not available**: the OBUK standard prohibits calendar-aligned fortnightly frequency, as the ISO calendar does not support or provide any guidance on when a fortnight should start.
* `MONTHLY`
  * Period resets **every 1st of every month**.
* `YEARLY`
  * Period resets **every 1st of January**.

## Consent Alignment

* `DAILY`
  * Period resets at midnight (UTC time).
  * This is *identical* to the calendar-aligned daily period.
* `WEEKLY`
  * Period resets on the **weekday** that the consent was created.
* `EVERY_TWO_WEEKS`
  * Period resets on the **weekday** that the consent was created on **every other week**.
* `MONTHLY`
  * Period resets on the **day of the month** that the consent was created
    * e.g. if consent was created on the 16th, then the period resets every 16th of every month
  * If consent was created on a day that is not present in all months (e.g. on the 31st),<br />then months without that day will reset on the *last day* of the month:
    * e.g. 31st Aug -> 30th Sep -> 31st Oct -> ... -> 28th Feb -> 31st Mar -> ...
    * e.g. 30th Aug -> 30th Sep -> 30th Oct -> ... -> 28th Feb -> 30th Mar -> ...
* `YEARLY`
  * Period resets on the **day of the specific month** that the consent was created
    * e.g. if consent was created on March 16th, then the period resets every March 16th
  * If consent was created on 29th of February, then during *non-leap* years the period will reset on the 28th of February.

## Pro-Rata Calculation

The **very first calendar-aligned period** is subject to a pro-rata calculation. That is, if a calendar-aligned consent is created in the middle of the relevant calendar period, then its periodic limit will be reduced proportionally to the remaining days in this period.

The specific pro-rata formula is `(t - c + 1) / t` where

* `t` is the *Total number of days* in the first period
* `c` is the *number of the Current day* within the period
* the `+1` term accounts for the current day being inside the periodic limit

<Info>
  The pro-rata adjusted limit is **rounded down to the nearest cent** or equivalent (e.g. a pro-rata adjusted limit of `33.6789` will be rounded to `33.67`).
</Info>

Examples, assuming a periodic limit of `5`:

* a weekly calendar-aligned consent created on Tuesday
  * `(7 - 2 + 1) / 7 = 0.8571`
  * i.e. \~86% of the Weekly limit (`4.28`) available until the end of the first week
* a monthly calendar-aligned consent created on the 16th of March
  * `(30 - 16 + 1) / 30 = 0.5` (note that March has 30 days)
  * i.e. 50% of the Monthly limit (`2.50`) available until the end of the first month
* a yearly calendar-aligned consent created on the 5th of October during a non-leap year
  * `(365 - 278 + 1) / 365 = 0.2411` (note that 5th of October is the 278th day of a non-leap year)
  * i.e. \~24% of the Yearly limit (`1.20`) available until the end of the first year
