Refund Payments
Learn how to refund captured payments and return funds to customers
Refund Payments
A refund returns funds to the customer after a payment has been captured and settled. Use refunds for returns, cancellations after settlement, or when adjusting the final amount owed.
When to Refund
Refund a payment when:
- Customer returns a product
- Service was not delivered as expected
- Customer was overcharged
- Order was cancelled after payment settled
- Goodwill gesture or customer satisfaction
For payments that haven't settled yet, use reversal instead. Reversals are faster and avoid interchange fees.
API Endpoint
POST https://api.plexypay.com/v2/payments/{payment_id}/refundsRefunding a Payment
Full Refund
Refund the entire captured amount:
curl -X POST https://api.plexypay.com/v2/payments/pay_1234567890/refunds \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchant_id": "merchant_abc123",
"reason": "CUSTOMER_REQUEST"
}'Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | object | No | Amount to refund. If omitted, refunds the full captured amount. |
amount.value | integer | Yes | Amount in smallest currency unit |
amount.currency | string | Yes | Three-letter ISO currency code |
merchant_id | string | Yes | Your merchant identifier |
reason | string | Yes | Reason code for the refund |
reference | string | No | Your internal reference for this refund |
description | string | No | Additional details about the refund |
idempotency_key | string | No | Unique key to prevent duplicate refunds |
Refund Reasons
You must provide a reason code for each refund:
| Reason Code | Description | Use Case |
|---|---|---|
FRAUD | Fraudulent transaction | Unauthorized use, stolen card |
CUSTOMER_REQUEST | Customer asked for refund | General cancellation, changed mind |
RETURN | Product returned | Physical goods returned |
DUPLICATE | Duplicate transaction | Accidental double charge |
OTHER | Other reason | Specify in description field |
Response
{
"payment_id": "pay_1234567890",
"refund_id": "ref_0987654321",
"status": "refunded",
"merchant_id": "merchant_abc123",
"amount": {
"value": 10000,
"currency": "KZT"
},
"reason": "CUSTOMER_REQUEST",
"refunded_at": "2026-03-25T10:30:00Z"
}Partial Refunds
Refund a portion of the captured amount:
curl -X POST https://api.plexypay.com/v2/payments/pay_1234567890/refunds \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": {
"value": 3000,
"currency": "KZT"
},
"merchant_id": "merchant_abc123",
"reason": "RETURN",
"description": "Partial refund for returned item"
}'Partial Refund Response
{
"payment_id": "pay_1234567890",
"refund_id": "ref_0987654321",
"status": "refunded",
"merchant_id": "merchant_abc123",
"amount": {
"value": 3000,
"currency": "KZT"
},
"remaining_captured": {
"value": 7000,
"currency": "KZT"
},
"reason": "RETURN",
"refunded_at": "2026-03-25T10:30:00Z"
}Multiple Refunds
You can issue multiple partial refunds for the same payment until the total captured amount is refunded.
First refund — return item 1:
curl -X POST https://api.plexypay.com/v2/payments/pay_1234567890/refunds \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": { "value": 3000, "currency": "KZT" },
"merchant_id": "merchant_abc123",
"reason": "RETURN",
"reference": "return_item_1"
}'Second refund — return item 2:
curl -X POST https://api.plexypay.com/v2/payments/pay_1234567890/refunds \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": { "value": 2000, "currency": "KZT" },
"merchant_id": "merchant_abc123",
"reason": "RETURN",
"reference": "return_item_2"
}'To check the remaining refundable amount, retrieve the payment:
curl -X GET https://api.plexypay.com/v2/payments/pay_1234567890 \
-H "x-api-key: YOUR_API_KEY"The response includes refundable_amount — in this example, 5000 (original 10000 − 3000 − 2000).
Unreferenced Refunds
In some cases, you may need to refund a customer without a matching original payment (e.g., cash payment refunded to card, compensation). This is called an unreferenced refund.
Unreferenced refunds have higher fraud risk and may require additional verification. Use them only when necessary.
curl -X POST https://api.plexypay.com/v2/refunds \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": {
"value": 5000,
"currency": "KZT"
},
"merchant_id": "merchant_abc123",
"payment_method": {
"type": "card",
"card_number": "4111111111111111",
"expiry_month": "12",
"expiry_year": "2028"
},
"reason": "OTHER",
"description": "Compensation for service issue"
}'Webhook Events
REFUND
Sent when a refund is successfully processed.
{
"event_type": "REFUND",
"event_id": "evt_abc123",
"created_at": "2026-03-25T10:30:00Z",
"data": {
"payment_id": "pay_1234567890",
"refund_id": "ref_0987654321",
"merchant_id": "merchant_abc123",
"amount": {
"value": 10000,
"currency": "KZT"
},
"reason": "CUSTOMER_REQUEST",
"status": "refunded",
"refunded_at": "2026-03-25T10:30:00Z"
}
}REFUND_FAILED
Sent when a refund attempt fails.
{
"event_type": "REFUND_FAILED",
"event_id": "evt_def456",
"created_at": "2026-03-25T10:30:00Z",
"data": {
"payment_id": "pay_1234567890",
"merchant_id": "merchant_abc123",
"amount": {
"value": 10000,
"currency": "KZT"
},
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Merchant account has insufficient balance to process refund"
}
}
}REFUND_REVERSED
Sent when a refund is reversed (e.g., funds returned to merchant because customer account was closed).
{
"event_type": "REFUND_REVERSED",
"event_id": "evt_ghi789",
"created_at": "2026-03-25T10:30:00Z",
"data": {
"payment_id": "pay_1234567890",
"refund_id": "ref_0987654321",
"merchant_id": "merchant_abc123",
"amount": {
"value": 10000,
"currency": "KZT"
},
"reversal_reason": "Customer account closed",
"reversed_at": "2026-03-25T10:30:00Z"
}
}Refund Processing Time
Refund timing varies by payment method:
| Payment Method | Processing Time |
|---|---|
| Visa/Mastercard | 5-10 business days |
| Bank transfer | 1-3 business days |
| E-wallets | Instant to 24 hours |
Even after Plexy processes the refund, it may take additional time for the customer's bank to credit their account.
Error Handling
| Error Code | Description | Resolution |
|---|---|---|
PAYMENT_NOT_FOUND | Payment ID does not exist | Verify the payment_id |
INVALID_PAYMENT_STATE | Payment not in refundable state | Check payment status |
AMOUNT_EXCEEDS_CAPTURED | Refund amount exceeds captured amount | Reduce refund amount |
INSUFFICIENT_BALANCE | Merchant balance too low | Add funds to merchant account |
REFUND_NOT_SUPPORTED | Payment method doesn't support refunds | Contact customer for alternative |
REFUND_WINDOW_EXPIRED | Too much time since capture | Contact support for assistance |
Example Error Handling
If the refund returns AMOUNT_EXCEEDS_CAPTURED, retrieve the payment to check the remaining refundable amount:
curl -X GET https://api.plexypay.com/v2/payments/pay_1234567890 \
-H "x-api-key: YOUR_API_KEY"The response includes refundable_amount.value — use this as the maximum for your refund request.
If the error is INSUFFICIENT_BALANCE, alert your finance team and top up the merchant account balance before retrying.
If the error is INVALID_PAYMENT_STATE, retrieve the payment to inspect its current status field and determine the appropriate next action.
Refund vs Cancel vs Reversal
| Scenario | Action | Time to Customer |
|---|---|---|
| Payment authorized, not captured | Cancel | Immediate |
| Payment captured, before settlement | Reversal | 1-2 business days |
| Payment captured, after settlement | Refund | 5-10 business days |
Best Practices
If the payment hasn't settled yet, use reversal instead of refund for faster processing and lower fees.
Track refund reasons for analytics and fraud prevention.
Prevent duplicate refunds from retry attempts.
Update your order system when REFUND webhook arrives, not just on API response.
Communicate clear refund policies to customers and enforce time limits.
High refund rates may indicate product or service issues, or potential fraud.
Viewing Refunds in Plexy Dashboard
Manage refunds in the Plexy Dashboard:
- Navigate to Payments
- Filter by Status: Refunded or Partially Refunded
- Click on a payment to view refund history
The dashboard shows:
- All refunds for a payment
- Refund amounts and reasons
- Processing status and timestamps
- Remaining refundable amount
You can also issue refunds directly from the Dashboard:
- Find the payment you want to refund
- Click Refund
- Enter the amount and reason
- Confirm the refund