HomeGuidesAPI Reference
API Reference

Recurring

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

The Recurring API (S2S) allows merchants to charge customers on a recurring basis (e.g., subscriptions, installments) using a previously generated recurringToken.

This is an unscheduled recurring flow, meaning merchants control when charges are triggered from their backend systems.


Recurring Flow


Endpoint

POST https://app-api.edfapay.com/api/v1/payment-gateway/s2s/recurring

Content-Type: application/json


Authentication

All requests must include a valid X-API-KEY in the request header.

The API key must be generated from your dashboard and must only be used server-side.

👉 How to generate API key

🔐

Security Note


Never expose your API Key on the frontend or client-side applications.

Always send requests from your backend server.


Request Body

FieldTypeRequiredDescription
transactionIdStringYesUnique identifier for the recurring transaction.
recurringTokenStringYesToken received from the initial payment.
amountDecimalYesAmount to be charged.
orderIdStringYesUnique order number
currencyStringYesCurrency code (ISO 4217), e.g., USD, SAR.
orderObjectYesOrder details object.

Order Object

FieldTypeRequiredDescription
numberStringYesUnique order number.
amountDecimalYesOrder amount.
currencyStringYesCurrency code (ISO 4217), e.g., USD, SAR.
descriptionStringYesDescription of the order.

Example Request

curl --location 'https://app-api.edfapay.com/api/v1/payment-gateway/s2s/recurring' \
--header 'x-api-key: <Api Key>' \
--header 'Content-Type: application/json' \
--data '{
  "transactionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "orderId": "XXXXXXXXXXXX",
  "amount": 1,
  "currency": "SAR",
  "recurringToken": "TKN-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "order": {
    "number": "XXXXXXXXXXXX",
    "description": "Monthly subscription payment",
    "amount": 1,
    "currency": "SAR"
  }
}'

How to Get recurringToken

To perform recurring payments, you must first obtain a recurringToken.

This token is generated during the initial payment under the following conditions:

  • The initial payment request includes recurring initialization (e.g., recurringInit = Y)
  • The transaction is successfully completed

The token is then returned in the callback/webhook response and must be stored securely for future use.

🔁

The same recurring token can be reused for future charges until it is expired or revoked.


Response Example

{
  "code": 200,
  "message": "Success",
  "errorCode": null,
  "data": {
    "transactionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "acquirerPaymentId": "xxxxxxxxxxxxxxxxxxxx",
    "amount": "1",
    "message": "Recurring transaction successful",
    "status": "APPROVED",
    "orderId": "XXXXXXXXXXXX",
    "recurringToken": "TKN-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  }
}

Important Notes

⚠️

Important Notes

Recurring payments require a valid recurring token.

The initial transaction must be successful to generate the token.

Merchants are responsible for managing billing cycles and retry logic.

Always validate transaction responses and webhook notifications.

Response
200
Language
LoadingLoading…