| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Charge a customer using a previously stored recurring token obtained from an initial recurring-enabled payment.
Recurring payments: Before using this endpoint, you must complete an initial payment with recurring enabled and store the returned
recurringTokensecurely.
Flow
sequenceDiagram
autonumber
participant Merchant as Your Server
participant DigetPay as DigetPay API
participant Gateway as Payment Gateway
Note over Merchant: Initial payment created recurringToken
Merchant->>DigetPay: POST /payment/s2s/recurring
Note right of Merchant: transactionId<br/>recurringToken<br/>amount + order
DigetPay->>Gateway: Charge stored token
Gateway-->>DigetPay: Payment result
DigetPay-->>Merchant: SUCCESS / DECLINED
Request
| Method | POST |
| URL | {baseUrl}/payment/s2s/recurring |
| Auth | x-api-key (required) |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | Original gateway transaction ID from the initial payment |
recurringToken | string | Yes | Token received from the initial recurring-enabled payment |
amount | number | Yes | Amount to charge |
order | object | Yes | Order information (number, amount, currency, description) |
Important: Use the same
transactionIdthat generated therecurringToken. Tokens cannot be used with unrelated transactions.
Request payload
{
"transactionId": "c09fba3c-59e2-434a-9ec1-5d2e71a44a8d",
"recurringToken": "token_from_initial_sale",
"amount": 50,
"order": {
"number": "ORD-REC-001",
"amount": 50,
"currency": "SAR",
"description": "Monthly subscription"
}
}Security: Never expose the
recurringTokenin browser JavaScript, URLs, mobile applications, or logs. Store it securely on your backend.
Responses
{
"success": {
"status": 200,
"body": {
"statusCode": 200,
"responseBody": {
"result": "SUCCESS",
"status": "SUCCESS",
"payment_id": "0808779145497567115585"
}
}
}
}{
"failed": {
"status": 200,
"body": {
"statusCode": 200,
"responseBody": {
"result": "DECLINED",
"status": "FAILED",
"payment_id": null,
"decline_reason": "Invalid recurring token"
}
}
}
}{
"failed_unauthorized": {
"status": 401,
"body": {
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}
}
}Response fields
| Field | Description |
|---|---|
result | Overall recurring payment result (SUCCESS, DECLINED) |
status | Current payment status |
payment_id | Gateway payment reference for the recurring charge |
decline_reason | Reason for failure when the transaction is declined |
Successful recurring payment: Treat the payment as successful only when both
resultandstatusareSUCCESS.
Best practice: Save the returned
payment_idfor reconciliation, refunds, and transaction tracking. Monitor recurring payments using webhooks or the appropriate transaction status API.
If the recurring token becomes invalid, expires, or is revoked by the issuer, the transaction will be declined and a new customer authorization may be required.
