payment

Initiate recurring payment using epkey

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
post/payment/gkash/recurring

Request body

memberIDstring required

Member ID - Epkey will be automatically retrieved from the most recent successful payment for this member

amountstring required

Payment amount (min 1.00)

currencystring required

Currency code

prodDescstring required

Product description

recurringTypestring required

Recurring type

transactionTypestring required

Transaction type

epkeystring

Epkey from initial payment callback (optional - will be auto-retrieved from memberID if not provided)

refNostring

Reference number (cart ID) - auto-generated if not provided

walletIDstring

Wallet ID

documentIDstring

Document ID

serviceFeeRatestring

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.

remarkstring

Remark

extraChargesstring

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.

Example request

{
  "memberID": "TWE-123456",
  "amount": "100.00",
  "currency": "MYR",
  "prodDesc": "WOWlet Token Reload",
  "recurringType": "ANNUAL",
  "transactionType": "RELOAD",
  "epkey": "5FBEA07FFB52E7D94AEFEB8582ED08F5FE129949AB8FB3788A3C4D58534D81D269FCC2EEB",
  "refNo": "merchant-reference-712894",
  "walletID": "TWW-123456789012-1",
  "documentID": "123456789012",
  "serviceFeeRate": "0.02",
  "remark": "Recurring Payment",
  "extraCharges": "0.00"
}

Response

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

successboolean required

Success status

messagestring required

Response message

dataobject required

Payment data

Example response

{
  "success": true,
  "message": "Recurring payment processed successfully",
  "data": {
    "paymentId": 124,
    "refNo": "merchant-reference-712894",
    "status": "success",
    "amount": 100,
    "currency": "MYR",
    "gkashStatus": "88 - Transferred",
    "gkashTransId": "M161-P0-999999",
    "epkey": "C23CA2EF5425B4879E3117BF1DAE5D361A5A9E351D0650700B14977E32A2E79002056",
    "createdAt": "2025-01-15T10:35:00.000Z",
    "updatedAt": "2025-01-15T10:35:05.000Z",
    "completedAt": "2025-01-15T10:35:05.000Z"
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.