---
title: Payment Schedules
slug: payments/payment-schedules
description: Set up payment schedules in Unaric Payments for recurring billing, instalments, and subscription management.
image: https://archbee-image-uploads.s3.amazonaws.com/10Nod6Ww95R3dPr0k0TCJ/eORV-uPS9z8yy0S051u9b_unaric-payments.png
icon: {"faIcon":"fa-solid fa-calendar-days"}
docTags: 
createdAt: 2025-02-02T17:05:31.954Z
---

Unaric Payment Schedule contains the information needed to drive the creation of payments where they need to recur automatically. Every payment schedule is linked to an authorisation, which stores the customer's payment details. Their only function is to create Payment records, linked to Authorisations (Saved Payment methods) on a fixed schedule so that these payments can be collected automatically.

::Image[Alternatively, you can use your own objects (such as invoices or orders) to drive the automatic creation of payment records rather than using payment schedules.]{src="https://api.archbee.com/api/optimize/10Nod6Ww95R3dPr0k0TCJ/Qg6KGNbJW2YmXFmUMPk-u_asperato-payment-schedule.gif" size="76" width="1920" height="960" darkWidth="1920" darkHeight="960" position="center" caption="Payment schedules grant control over date collection options.." showCaption="true"}

## Key fields

| **Field**             | **Description**                                                                                                                                     |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authorisation**     | Set to the authorisation record that should be used to collect the schedule payment.                                                                |
| **Frequency**         | The frequency at which the payment should be collected.                                                                                             |
| **Regular amount**    | The amount that should be taken from each payment.                                                                                                  |
| **Next payment date** | The date that you want the payment schedule to start collecting. This will be updated (according to the frequency) each time the schedule collects. |
| **Status**            | *Active*, *Inactive*, or *Expired*.                                                                                                                 |

## Statuses

| **Status**                                  | **Description**                                                                                                       |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Active (previously&#x20;*****In Force)*** | The default status. The schedule is active and will collect.                                                          |
| **Inactive**                                | The schedule is not collecting.                                                                                       |
| **Expired**                                 | In cases a **final payment date** has been set and is due, the record will be set to expired after the final payment. |

## Create Payment Schedules from existing authorisation

1. On the **Unaric Payments Authorisations** tab, navigate to the Authorisation record you want to use for the payment schedule.
2. Select the dropdown arrow by the payment schedules related list and click **New**.

   ::Image[]{src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/43025528645/original/B79rdzZi4mdj1ThnlMAM-vj3UtYoBdGdQw.png?1549887532" size="58" width="628" height="411" position="center" darkWidth="628" darkHeight="411" showCaption="false"}
3. The correct authorisation will already be pre-populated. Fill in the rest of the required fields.
4. Click **Save** to finish. The payment schedule is now active, and will collect overnight each time the following conditions are met:
   - The **Next Payment Date** is set to either today, or is in the past.
   - The status of the payment schedule is set to *Active.*
   - The status of the authorisation attached to the payment schedule is *In force.*

## Deactivate payment schedule

If you wish to temporarily stop the payment schedule from collecting, then edit the record, and change its status from *In force* to *Inactive*.

:::hint{type="warning"}
Direct Debits take time to process. As such, ensure the payment is taken from the customer's bank account on the correct date the whole cycle starts a number of days before the actual due date ("Next Payment Date"). The number of days is a configuration parameter that is set to 4 by default. If you make a Payment Schedule *Inactive* during that window then there might already be a payment being processed that you will need to deal with separately.
:::

## Processing payment schedules

In order to process payment schedules the Unaric Repeat Payment Scheduled job needs setting up.

1. In Salesforce, navigate to **Setup > Environments > Jobs > Scheduled Jobs**.
2. Navigate to **Setup > Custom Code > Apex Classes**.
3. Click the **Schedule Apex** button.
4. Configure the new job as follows:&#x20;
   - **Job Name:** **Asperato Repeat Payment** (recommended)
   - **Apex Class:** Click the magnifying glass and select **BatchProcessPaymentSchedules.**
   - **Schedule Apex Execution:**&#x20;
     - **Frequency:** As per requirements
     - **Recurs every week on:** Select all checkboxes.
     - **Start Date:** Choose a date (defaults to today).
     - **End Date:** Set a date far in the future (e.g., 12/31/2050).
     - **Preferred Start Time:** Set a time (e.g., 04:00 or 05:00).
5. Click **Save** to finish.

:::hint{type="warning"}
&#x20;Ensure that the user account you use to recreate the scheduled job has the **System Administrator** profile. This is necessary to grant the job the required permissions to access the **AggregateResult** entity.
:::

