Skip to main content
POST
/
Gateway
/
v
{version}
/
Refunds
curl --request POST \
  --url https://gateway.dev.waypay.live/Gateway/v1/Refunds \
  --header 'SWICH-API-Key: pk_test_xxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "trxnRef": "TXN20251212123456",
    "amount": 250,
    "reason": "Customer requested refund",
    "signature": "d4e5f6789012345678abcdef1234567"
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "paymentIntentId": "660e8400-e29b-41d4-a716-446655440001",
  "amount": 250,
  "currency": "PKR",
  "reason": "Customer requested refund",
  "status": 0,
  "isLive": true,
  "requestedAt": "2025-12-12T10:30:00Z",
  "approvedAt": null,
  "processedAt": null,
  "attemptCount": 0
}

Overview

This endpoint allows you to initiate a refund for a previously completed transaction. Refunds can be full or partial amounts.

Path Parameters

version
string
required
API version (e.g., “1”)

Request Body

trxnRef
string
required
Transaction reference number to refund
amount
number
Refund amount (minimum 10). If not provided, full transaction amount will be refunded
reason
string
Reason for refund (max 500 characters)
signature
string
required
Request signature for authentication. A 32-character lowercase hexadecimal string generated using MD5 hash.
Never expose your secret key in client-side code or public repositories.
See the Signature Guide for implementation details.

Response

id
uuid
Unique refund identifier
paymentIntentId
uuid
Associated payment intent ID
amount
number
Refund amount
currency
string
Currency code
reason
string
Refund reason
status
integer
Refund status:
  • 0 - Pending
  • 1 - Approved
  • 2 - Processing
  • 3 - Completed
  • 4 - Failed
  • 5 - Cancelled
  • 6 - Rejected
  • 7 - Expired
isLive
boolean
Whether this is a live or test refund
requestedAt
datetime
When the refund was requested
approvedAt
datetime
When the refund was approved
processedAt
datetime
When the refund was processed
attemptCount
integer
Number of processing attempts
curl --request POST \
  --url https://gateway.dev.waypay.live/Gateway/v1/Refunds \
  --header 'SWICH-API-Key: pk_test_xxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "trxnRef": "TXN20251212123456",
    "amount": 250,
    "reason": "Customer requested refund",
    "signature": "d4e5f6789012345678abcdef1234567"
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "paymentIntentId": "660e8400-e29b-41d4-a716-446655440001",
  "amount": 250,
  "currency": "PKR",
  "reason": "Customer requested refund",
  "status": 0,
  "isLive": true,
  "requestedAt": "2025-12-12T10:30:00Z",
  "approvedAt": null,
  "processedAt": null,
  "attemptCount": 0
}