payment

Initiate recurring payment using epkey

Changed on

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

  • Base URL
    https://api.tonewow.com (the document declares no server; this is the origin it was published from)
  • URL
    https://api.tonewow.com/payment/gkash/recurring
  • Auth
    none declared

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. Ignored when extraCharges is supplied.

NOTE: a zero fee on amounts below RM30 is rejected with 400, because TW-Backend refuses it and the charge would go uncredited.

remarkstring

Remark

extraChargesstring

Explicit service fee AMOUNT to charge on top of amount, with two decimals. Takes precedence over serviceFeeRate. Send "0.00" to charge no fee, e.g. TW-Backend auto top-up sending the full amount with the fee already settled. Capped at 20% of amount. A zero fee on amounts below RM30 is rejected with 400 (TW-Backend refuses it and the wallet would not be credited). Omit to use serviceFeeRate or the default 2%.

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.70"
}

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