payment

Gkash payment return handler

Handles payment return from Gkash when user is redirected back after payment completion. This endpoint: - Accepts payment return data from Gkash (via POST or query parameters) - Detects if payment is successful or failed - Updates payment status in database if new information is provided - Returns payment status information including success/failure indicators

**Payment Status Detection:**
- Success: status = "88 - Transferred" AND description = "00 - Approved"
- Failed: Any other status or description

**Response includes:**
- Payment ID and reference number
- Payment status (success/failed/pending)
- Amount and currency
- Gkash transaction details
- Success/failure boolean flags
- Epkey (if available for recurring payments)
- Timestamps
post/payment/return/gkash

Request body

CIDstring required

Merchant Code (CID)

POIDstring required

Payment Order ID (POID) - Gkash transaction ID

statusstring required

Payment status code. "88 - Transferred" indicates successful payment

descriptionstring required

Payment description/result code. "00 - Approved" indicates successful payment

cartidstring required

Cart ID - Your merchant reference number (refNo)

epkeystring

Epkey (Encrypted Payment Key) - Token for recurring payments

signaturestring

Response signature for verification

amountstring

Payment amount

currencystring

Currency code

PaymentTypestring

Payment type/method used

Example request

{
  "CID": "M161-U-999",
  "POID": "M161-P0-999999",
  "status": "88 - Transferred",
  "description": "00 - Approved",
  "cartid": "merchant-reference-712893",
  "epkey": "5FBEA07FFB52E7D94AEFEB8582ED08F5FE129949AB8FB3788A3C4D58534D81D269FCC2EEB",
  "amount": "100.00",
  "currency": "MYR",
  "PaymentType": "Master Credit 0008"
}

Response

Payment return processed successfully. Returns payment status information.

successboolean required

Whether the operation was successful

messagestring required

Response message

dataobject required

Payment status data

Example response

{
  "success": true,
  "message": "Payment status retrieved successfully",
  "data": {
    "paymentId": 123,
    "refNo": "merchant-reference-712893",
    "status": "success",
    "amount": 100,
    "currency": "MYR",
    "gkashStatus": "88 - Transferred",
    "gkashTransId": "M161-P0-999999",
    "gkashDescription": "00 - Approved",
    "isSuccess": true,
    "isFailed": false,
    "epkey": "5FBEA07FFB52E7D94AEFEB8582ED08F5FE129949AB8FB3788A3C4D58534D81D269FCC2EEB",
    "createdAt": "2025-01-15T10:30: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.