---
title: "Initiate recurring payment using epkey"
method: POST
path: "/payment/gkash/recurring"
tags: ["payment"]
---

# Initiate recurring payment using epkey

`POST /payment/gkash/recurring`

Initiate a recurring payment using the epkey from the member's payment history. This endpoint:
    - Automatically retrieves epkey from the most recent successful payment for the memberID
    - Charges the customer's saved card without requiring them to enter card details again
    - Sends a server-to-server request to Gkash payment submit API
    - Processes the payment synchronously and returns immediate result
    - Updates payment status in database
    - Returns a new epkey in the response (if provided by Gkash) for future recurring payments
    
    **Required Parameters:**
    - memberID: Member ID (epkey will be automatically retrieved from this member's payment history)
    - amount: Payment amount
    - currency: Currency code (default: MYR)
    - prodDesc: Product description
    - recurringType: Recurring type (ANNUAL, MONTHLY, WEEKLY, DAILY)
    - transactionType: Transaction type (RELOAD, PURCHASE, SUBSCRIPTION, etc.)
    
    **Optional Parameters:**
    - epkey: Can be provided explicitly (otherwise auto-retrieved from memberID)
    - refNo: Reference number (auto-generated if not provided)
    - walletID, documentID, remark: Optional fields
    
    **Prerequisites:**
    - The member must have at least one successful GKash payment with an epkey
    - The epkey must be from a payment with status "success"
    
    **Process:**
    1. Provide memberID and payment details
    2. System automatically finds epkey from member's payment history
    3. Gkash processes the payment server-to-server
    4. Response includes payment status immediately (no redirect needed)
    5. Store the new epkey from response for future recurring payments

## Request body

- CreateRecurringPaymentDto
  - `memberID` string, required — Member ID - Epkey will be automatically retrieved from the most recent successful payment for this member
  - `amount` string, required — Payment amount (min 1.00)
  - `currency` string, required — Currency code
  - `prodDesc` string, required — Product description
  - `recurringType` string, required — Recurring type
  - `transactionType` string, required — Transaction type
  - `epkey` string — Epkey from initial payment callback (optional - will be auto-retrieved from memberID if not provided)
  - `refNo` string — Reference number (cart ID) - auto-generated if not provided
  - `walletID` string — Wallet ID
  - `documentID` string — Document ID
  - `serviceFeeRate` string — Service fee rate applied on top of `amount`, as a decimal fraction. Omit to charge the standard 2% fee. Send "0" for fee-free recurring (third-party integrations). Range 0 to 0.2. NOTE: TW-Backend currently rejects a 0.00 fee on amounts below RM30 with "An error occurred during the fee calculation process", which leaves the charge uncredited. Fee-free recurring below RM30 is not reliable until that is fixed on their side.
  - `remark` string — Remark
  - `extraCharges` string — DEPRECATED — ignored by the server. Recurring fee is controlled by GKASH_RECURRING_FEE_RATE (currently 0 = no charges). Field kept for backward compatibility with older app builds.

## Response `201`

Recurring payment processed successfully. Payment status is returned immediately (no redirect needed).

- CreateRecurringPaymentResponseDto
  - `success` boolean, required — Success status
  - `message` string, required — Response message
  - `data` object, required — Payment data

## Other responses

- `400` — Bad request - invalid payment data (e.g., amount less than 1.00, invalid format, missing required fields)
- `404` — No successful payment with epkey found for the member
- `500` — Internal server error or Gkash API error

---

[API](https://skmtc.dev/tonewow/apis/tonewow-database-api.md) · [All operations](https://skmtc.dev/tonewow/apis/tonewow-database-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tonewow/tonewow-database-api/revisions/f36472974ad4/schema)
