Recurring Payments

Recurring Payments allow merchants to automatically charge a customer for future payments after the initial payment has been successfully authorized.

DigetPay Recurring Payments enable merchants to automate subscription billing and collect recurring payments without requiring customers to enter their payment card details for every transaction.

Recurring payments are commonly used for subscriptions, memberships, installment plans, and services requiring repeated payments.

DigetPay provides two main recurring payment integration methods:

  • Checkout Recurring Payments
  • Server-to-Server (S2S) Recurring Payments

Both methods support automatic scheduled payments, but they differ in how recurring plans are configured, initiated, and managed.


Recurring Payment Integration Methods

1. Checkout Recurring Payments

Checkout Recurring enables merchants to offer recurring payments through DigetPay Hosted Checkout.

Merchants configure their recurring payment settings directly through the Merchant Dashboard, including:

  • Enable or disable recurring payments.
  • Billing frequency: Daily, Weekly, or Monthly.
  • Number of recurring payments.
  • Customer checkout experience.
Merchant Dashboard recurring configuration

To initiate a recurring payment, merchants use the standard Checkout API with the following parameter:

{
  "payWithRecurring": true
}

The customer completes the initial payment through DigetPay Hosted Checkout.

Once the initial payment and recurring enrollment are successfully completed, DigetPay automatically processes future payments according to the configured billing schedule.

📘

Merchants do not need to send separate API requests for each scheduled payment. The recurring billing configuration is managed through the Merchant Dashboard, and scheduled payments are processed automatically by DigetPay.

API Endpoint

POST /payment/checkout/intiate

View Checkout Recurring API


2. Server-to-Server (S2S) Recurring Payments

S2S Recurring allows merchants to create and manage recurring payment plans directly through DigetPay's Server-to-Server APIs.

Unlike Checkout Recurring, the recurring configuration is provided within the Make Recurring API request, rather than being configured through the Merchant Dashboard.

Merchants can define:

  • Recurring payment amount and currency.
  • Customer information and payment card details.
  • Billing frequency: Daily, Weekly, Monthly, or Custom.
  • Number of payment iterations.
  • Retry count for failed recurring payments.
  • Customer return URLs for the initial payment.

The merchant sends a MakeRecurring request to create the recurring plan.

DigetPay returns a unique RecurringId, the initial payment information, and 3-D Secure authentication details when required.

After the customer completes the initial payment successfully, the recurring plan becomes Active.

DigetPay then processes future scheduled payments automatically according to the configured recurring plan.

📘

Merchants do not need to initiate a new payment request for every scheduled billing cycle. Once the recurring plan is activated, DigetPay handles subsequent scheduled payments automatically.

Available S2S Recurring APIs

APIMethodDescription
Make RecurringPOSTCreate a new recurring payment plan.
Get RecurringGETRetrieve a specific recurring plan using its RecurringId.
List Recurring PlansGETRetrieve all recurring plans associated with the merchant, with pagination.
Cancel RecurringPOSTCancel an existing recurring payment plan.

API Endpoints

POST /payment/s2s/MakeRecurring

GET /payment/s2s/GetRecurring?RecurringId={recurringId}

GET /payment/s2s/GetRecurring?page=1&pageSize=20

POST /payment/s2s/CancelRecurring?RecurringId={recurringId}

Supported Billing Frequencies

FrequencyDescription
DailySchedule recurring payments daily.
WeeklySchedule recurring payments weekly.
MonthlySchedule recurring payments monthly.
CustomSchedule payments at a specified interval in days.

Custom recurring examples support intervals of up to 180 days, as represented in the supplied API test collection.

🔐

S2S Recurring requires merchants to transmit payment card details as part of the initial API request. Merchants must comply with applicable PCI DSS requirements and must never store card security codes after authorization.


How Recurring Payments Work

The initial integration flow depends on the selected recurring payment method.

Checkout Recurring Flow

  1. The merchant configures recurring payment settings in the Merchant Dashboard.
  2. The merchant initiates a Hosted Checkout payment with payWithRecurring: true.
  3. The customer completes the initial payment.
  4. DigetPay activates recurring billing after successful payment and enrollment.
  5. Future payments are processed automatically according to the configured billing schedule.

S2S Recurring Flow

  1. The merchant sends a MakeRecurring API request with customer, card, and recurring plan details.
  2. DigetPay creates the recurring plan and returns a RecurringId.
  3. The initial recurring status may be PendingPayment.
  4. The customer completes the required 3-D Secure authentication.
  5. After successful initial payment, the recurring plan becomes Active.
  6. DigetPay processes subsequent scheduled payments automatically.
  7. The merchant can retrieve plan details, monitor payment execution, or cancel the plan through the S2S APIs.

Recurring Payment Flow Diagram

flowchart TD
    A[Merchant enables recurring payments] --> B{Integration Method}

    B -->|Checkout| C[Configure recurring settings in Merchant Dashboard]
    C --> D[Initiate Hosted Checkout with payWithRecurring true]
    D --> E[Customer completes initial payment]

    B -->|S2S| F[POST MakeRecurring with billing configuration]
    F --> G[Receive RecurringId and PendingPayment]
    G --> H[Customer completes required 3DS authentication]

    E --> I{Initial payment successful?}
    H --> I

    I -->|No| J[Handle pending or failed payment]
    I -->|Yes| K[Recurring plan becomes Active]

    K --> L[DigetPay processes scheduled payments automatically]
    L --> M[Track recurring payment results]

    M --> N{Plan status}
    N -->|More payments scheduled| L
    N -->|All iterations completed| O[Completed]
    N -->|Merchant cancels plan| P[Canceled]

S2S Recurring Plan Lifecycle

S2S Recurring plans have different statuses depending on their payment and subscription state.

The following statuses have been verified through actual API responses.

StatusDescription
PendingPaymentThe recurring plan has been created, but the initial payment has not yet been completed.
ActiveThe initial payment was completed successfully and the recurring plan is active.
FailedThe recurring plan failed, for example due to rejected authentication or an incomplete initial payment.
CompletedThe configured number of recurring payment iterations has been completed.
CanceledThe recurring plan has been canceled and is no longer active.

Example: Recurring Plan Activation

After calling the Make Recurring API, DigetPay may return:

{
  "IsSuccess": true,
  "Data": {
    "RecurringId": "RECUR18",
    "RecurringStatus": "PendingPayment",
    "ExecutedTimes": 0
  }
}

The merchant must complete the required initial payment authentication.

After successful payment, the merchant can retrieve the recurring plan using the Get Recurring API.

An active plan may contain:

{
  "RecurringId": "RECUR18",
  "RecurringStatus": "Active",
  "RecurringValue": 20,
  "RecurringType": "Monthly",
  "ExecutedTimes": 1,
  "Iteration": 12,
  "IsActive": true
}
📘

The initial successful payment counts toward the configured number of iterations. For example, a plan with Iteration: 12 and ExecutedTimes: 1 has recorded its initial payment as the first execution.


Scheduled Recurring Payments

Both Checkout Recurring and S2S Recurring support automatic scheduled payments.

A scheduled recurring plan charges the customer according to a predefined billing configuration.

Typical use cases include:

  • Monthly subscriptions.
  • Weekly memberships.
  • Daily services.
  • Installment plans.
  • Fixed recurring service fees.

Example: Monthly Subscription

SettingValue
Payment AmountSAR 100
Billing FrequencyMonthly
Number of Payments12
Initial PaymentDuring enrollment
Future PaymentsAutomatically scheduled
Payment ProcessingDigetPay

For S2S Recurring, the merchant defines these settings within the initial MakeRecurring request.

For Checkout Recurring, the configuration is managed through the Merchant Dashboard.

Scheduled Payment Timeline

timeline
    title Monthly Recurring Plan Example
    Initial Payment : Customer completes first payment
    Month 2 : Automatic recurring payment
    Month 3 : Automatic recurring payment
    Month 4 : Automatic recurring payment
    Month 5 onwards : Scheduled payments continue
    Final Payment : Plan reaches configured iteration count

Managing S2S Recurring Plans

S2S Recurring provides dedicated APIs for managing recurring subscriptions.

Retrieve a Recurring Plan

Merchants can retrieve the current recurring plan status using:

GET /payment/s2s/GetRecurring?RecurringId={recurringId}

The response includes:

  • Current recurring status.
  • Billing frequency and payment amount.
  • Number of executed payments.
  • Total configured iterations.
  • Last payment date.
  • Next scheduled payment date.
  • Associated recurring invoices.
  • Payment failure information, when applicable.

List All Recurring Plans

Merchants can retrieve all recurring plans associated with their API credentials using:

GET /payment/s2s/GetRecurring?page=1&pageSize=20

The API returns recurring plans with pagination information, including:

  • Page
  • PageSize
  • Total

Cancel a Recurring Plan

Merchants can cancel an existing plan using:

POST /payment/s2s/CancelRecurring?RecurringId={recurringId}

After successful cancellation, the API returns:

{
  "IsSuccess": true,
  "Message": "Recurring canceled",
  "Data": {
    "RecurringId": "RECUR16",
    "RecurringStatus": "Canceled",
    "NextPayDate": null,
    "IsActive": false
  }
}

A canceled plan no longer has a next scheduled payment.

Previously executed payments remain associated with the recurring plan for payment tracking and reconciliation.

📘

Canceling a recurring plan does not refund previously completed payments. Refunds must be handled separately through the applicable refund process.


Checkout Recurring vs. S2S Recurring

FeatureCheckout RecurringS2S Recurring
Integration MethodHosted CheckoutServer-to-Server
Initial PaymentHosted CheckoutS2S API with authentication when required
Billing ConfigurationMerchant DashboardMake Recurring API
Daily / Weekly / MonthlySupportedSupported
Custom Billing IntervalsNot documentedSupported
Automatic Scheduled PaymentsYesYes
Payment Card CollectionDigetPay Hosted CheckoutMerchant S2S integration
Recurring ManagementMerchant DashboardDedicated S2S APIs
Retrieve Recurring PlansDashboardGet Recurring / List Recurring Plans
Cancel Recurring PlansDashboardCancel Recurring API

API Environment

DigetPay uses a unified API base URL for both Test and Live environments.

Base URL

https://api.digetpay.com/v1

Authentication

x-api-key: YOUR_API_KEY
Content-Type: application/json

The selected API key determines the environment:

  • Test API Key: Testing environment.
  • Live API Key: Production environment.

Merchants should use their Test API Key during integration testing and switch to their Live API Key when ready for production.


Security and Best Practices

  • Select the recurring integration method appropriate to your payment architecture.
  • Keep API keys and recurring identifiers secure.
  • Never expose API keys or sensitive payment information in frontend applications.
  • Verify that the initial payment has been completed before activating a subscription.
  • Monitor recurring plan statuses and payment execution history.
  • Review failed payments and apply appropriate customer notification policies.
  • Store recurring identifiers securely for subscription management.
  • Do not store CVV/CVC after authorization.
  • Follow applicable PCI DSS requirements, particularly for S2S integrations handling cardholder data.
  • Confirm recurring plan cancellation before updating subscription records.
  • Retain payment references for reconciliation and reporting.

Related Documentation

Checkout Recurring

Checkout Recurring API

Learn how to initiate recurring payments through DigetPay Hosted Checkout.

S2S Recurring

Refer to the S2S Recurring API Reference section for:


Did this page help you?