Create a recurring payment plan using DigetPay's Server-to-Server (S2S) API.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The Make Recurring API allows merchants to create recurring payment plans by providing customer information, payment card details, and recurring billing configurations.
Merchants can define the billing frequency, number of payment iterations, and retry count.
The initial payment may require 3-D Secure (3DS) authentication. Once the initial payment is successfully completed, the recurring plan becomes active, and subsequent payments are processed automatically according to the configured billing schedule.
API Endpoint
Method: POST
Endpoint:
https://api.digetpay.com/v1/payment/s2s/MakeRecurring
Authentication
Include the following headers in your API request:
| Header | Value |
|---|---|
x-api-key | YOUR_API_KEY |
Content-Type | application/json |
DigetPay uses a unified API base URL for both Test and Live environments.
- Test API Key: Used for testing.
- Live API Key: Used for production payments.
Request Example
The following example creates a monthly recurring payment plan of SAR 20, with 12 payment iterations and a retry count of 2.
curl --location 'https://api.digetpay.com/v1/payment/s2s/MakeRecurring' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"PaymentValue": 20,
"Currency": "SAR",
"RecurringModel": {
"RecurringType": "Monthly",
"IntervalDays": null,
"Iteration": 12,
"RetryCount": 2
},
"CustomerName": "fname lname",
"CustomerEmail": "[email protected]",
"CustomerMobile": "966512345678",
"Card": {
"Holder": "fname lname",
"Number": "5123450000000008",
"ExpiryMonth": "12",
"ExpiryYear": "30",
"Cvv": "100"
},
"CallBackUrl": "https://merchant.example/payment/success",
"ErrorUrl": "https://merchant.example/payment/error"
}'Note: Replace the example values with the appropriate payment details. Use only supported test cards with your Test API Key during testing.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
PaymentValue | Number | Amount to be charged for the recurring payment. |
Currency | String | Transaction currency, such as SAR. |
RecurringModel | Object | Contains the recurring billing configuration. |
CustomerName | String | Customer's full name. |
CustomerEmail | String | Customer's email address. |
CustomerMobile | String | Customer's mobile number, including country code. |
CustomerReference | String | Merchant-defined customer reference. |
Card | Object | Contains customer payment card information. |
CallBackUrl | String | Customer return URL for the successful payment flow. |
ErrorUrl | String | Customer return URL for the failed payment flow. |
RecurringModel Object
| Parameter | Type | Description |
|---|---|---|
RecurringType | String | Billing frequency: Daily, Weekly, Monthly, or Custom. |
IntervalDays | Integer / Null | Number of days between recurring payments when using Custom. |
Iteration | Integer | Configured number of payment iterations. |
RetryCount | Integer | Number of retry attempts for failed recurring payments. |
Card Object
| Parameter | Type | Description |
|---|---|---|
Holder | String | Cardholder's name. |
Number | String | Payment card number. |
ExpiryMonth | String | Card expiration month, e.g. 12. |
ExpiryYear | String | Card expiration year, e.g. 30. |
Cvv | String | Card security code. |
Supported Recurring Types
The RecurringType parameter determines how frequently recurring payments are scheduled.
Daily Recurring
{
"RecurringType": "Daily",
"IntervalDays": null,
"Iteration": 1,
"RetryCount": 1
}Weekly Recurring
{
"RecurringType": "Weekly",
"IntervalDays": null,
"Iteration": 4,
"RetryCount": 3
}Monthly Recurring
{
"RecurringType": "Monthly",
"IntervalDays": null,
"Iteration": 12,
"RetryCount": 2
}Custom Recurring — Every 30 Days
{
"RecurringType": "Custom",
"IntervalDays": 30,
"Iteration": 6,
"RetryCount": 1
}Custom Recurring — Every 180 Days
{
"RecurringType": "Custom",
"IntervalDays": 180,
"Iteration": 2,
"RetryCount": 0
}Important: IntervalDays must be specified when RecurringType is set to Custom.
Response Example
The following response was returned after successfully submitting a Make Recurring request.
At this stage, the recurring plan has been created, but the initial payment is still awaiting authentication.
{
"IsSuccess": true,
"Message": "Success",
"Data": {
"RecurringId": "RECUR18",
"InvoiceId": 7331354,
"PaymentId": "07077331354392824673",
"IsDirectPayment": false,
"RecurringStatus": "PendingPayment",
"ExecutedTimes": 0,
"ThreeDS": {
"Url": "https://pay.digetpay.com/En/KWT/PayInvoice/MpgsAuthentication?...",
"Method": "GET",
"Html": "<!DOCTYPE html>..."
}
}
}Note: The ThreeDS.Url and ThreeDS.Html values have been shortened for readability. The actual API response contains the complete authentication URL and HTML document.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
IsSuccess | Boolean | Indicates whether the API request was processed successfully. |
Message | String | General API response message. |
Data | Object | Contains the created recurring plan and initial payment information. |
Data.RecurringId | String | Unique identifier of the recurring payment plan. |
Data.InvoiceId | Number | Invoice identifier associated with the initial payment. |
Data.PaymentId | String | Payment identifier associated with the initial transaction. |
Data.IsDirectPayment | Boolean | Indicates whether the initial payment uses the direct payment flow. |
Data.RecurringStatus | String | Current recurring plan status. |
Data.ExecutedTimes | Number | Number of payment executions recorded for the recurring plan. |
Data.ThreeDS | Object | Contains 3-D Secure authentication information. |
Data.ThreeDS.Url | String | Authentication URL returned for the initial payment. |
Data.ThreeDS.Method | String | HTTP method indicated for the authentication URL. |
Data.ThreeDS.Html | String | HTML document containing the payment authentication flow. |
Handling 3-D Secure Authentication
The initial recurring payment may require the customer to complete 3-D Secure authentication.
When the response includes the ThreeDS object:
- Retrieve the authentication information from
Data.ThreeDS. - Initiate the authentication flow using the supported
ThreeDS.UrlorThreeDS.Htmlintegration method. - Allow the customer to complete the authentication process.
- Handle the customer return through the configured
CallBackUrlorErrorUrl. - Retrieve the recurring plan status to verify that the initial payment has been completed successfully.
The supplied response contains both a ThreeDS.Url with Method: GET and an HTML document that automatically submits a POST form with browser information. The required integration approach should be verified against the supported DigetPay 3DS implementation before production deployment.
PendingPayment Status
Immediately after creating the recurring plan, the API may return:
{
"RecurringStatus": "PendingPayment",
"ExecutedTimes": 0
}This indicates that:
- The Make Recurring request was accepted.
- A recurring plan identifier was generated.
- The initial payment is still pending.
- No completed payment executions have been recorded.
Important: IsSuccess: true confirms successful processing of the API request, not successful completion of the initial payment.
Recurring Plan Activation
Once the customer completes the initial payment successfully, the recurring plan becomes active.
The merchant can retrieve the updated plan information using the Get Recurring API.
Example: Active Recurring Plan
The following data was returned after the initial payment was completed successfully.
{
"RecurringId": "RECUR18",
"RecurringStatus": "Active",
"RecurringValue": 20,
"RecurringType": "Monthly",
"IntervalDays": null,
"ExecutedTimes": 1,
"Iteration": 12,
"RetryCount": 2,
"LastPayDate": "2026-11-02T09:57:49.852Z",
"NextPayDate": "2026-12-01T21:00:00.000Z",
"IsActive": true,
"RecurringInvoices": [
{
"InvoiceId": 7331354,
"PaymentId": "07077331354392824673",
"InvoiceStatus": "Paid",
"Kind": "INITIAL"
}
]
}This example is an excerpt from the Get Recurring API response.
Understanding the Activation Status
| Field | Description |
|---|---|
RecurringStatus: Active | The recurring plan is active. |
IsActive: true | Indicates that the plan is currently active. |
ExecutedTimes: 1 | One payment execution has been recorded, including the initial payment. |
Iteration: 12 | The configured number of payment iterations. |
LastPayDate | Date and time of the most recent payment. |
NextPayDate | Date and time of the next scheduled recurring payment. |
InvoiceStatus: Paid | The initial invoice has been paid. |
Kind: INITIAL | Identifies the initial payment associated with the recurring plan. |
Important: Merchants should confirm the recurring plan is active before activating the customer's subscription or providing paid services.
Recurring Payment Flow
sequenceDiagram
autonumber
participant Customer
participant Merchant
participant DigetPay
participant Gateway
Merchant->>DigetPay: POST /payment/s2s/MakeRecurring
DigetPay->>Gateway: Initiate initial payment
Gateway-->>DigetPay: Authentication required
DigetPay-->>Merchant: RecurringId + PendingPayment + ThreeDS
Merchant-->>Customer: Start 3DS authentication
Customer->>Gateway: Complete authentication
Gateway-->>DigetPay: Payment result
Merchant->>DigetPay: GET /payment/s2s/GetRecurring
DigetPay-->>Merchant: Active + ExecutedTimes: 1
Note over DigetPay: Recurring plan activated
loop Scheduled recurring payments
DigetPay->>Gateway: Process scheduled charge
Gateway-->>DigetPay: Payment result
end
The diagram illustrates the expected recurring payment flow, including the confirmed initial activation sequence. Scheduled renewal execution should be validated separately.
Validation Rules
The supplied Postman collection includes the following validation test cases:
| Parameter | Expected Behavior |
|---|---|
RetryCount | Values above 3 are expected to return HTTP 400. |
IntervalDays | Values above 180 are expected to return HTTP 400. |
IntervalDays | A null value with RecurringType: Custom is expected to return HTTP 400. |
RecurringType | Examples cover Daily, Weekly, Monthly, and Custom. |
These rules are based on the supplied Postman test cases and should be verified against actual API responses.
Security Considerations
The S2S Recurring API involves transmitting customer payment card information.
Merchants must:
- Send requests from a secure backend environment.
- Keep API keys confidential.
- Protect cardholder information during transmission.
- Comply with applicable PCI DSS requirements.
- Never store CVV/CVC after authorization.
- Never expose raw card information in application logs or analytics.
- Verify the final payment result before activating subscriptions.
- Store
RecurringIdsecurely for subscription management.
Related APIs
- Get Recurring — Retrieve details of an existing recurring plan.
- List Recurring Plans — Retrieve recurring plans using pagination.
- Cancel Recurring — Cancel an existing recurring payment plan.
For additional information, refer to the Recurring Payments Overview.
200
