Skip to main content
POST
/
api
/
v1
/
pos
/
refund
curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/pos/refund" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "original_transaction_id": "txn_pos_12345",
    "amount": "1500.00",
    "reason": "Customer returned item",
    "initiated_by": "admin_user_01",
    "pin": "9999"
  }'
{
  "success": true,
  "message": "Refund processed successfully",
  "refund_id": "rfnd_abc789",
  "original_transaction_id": "txn_pos_12345",
  "refunded_amount": "1,500.00 SLE",
  "timestamp": "2025-01-20T15:00:00Z"
}
Refunds must be initiated by an authorized user/admin. Funds are reversed from merchant to subscriber.

Request

Authorization
string
required
Bearer olive_live_xxx

Body Parameters

original_transaction_id
string
required
ID of transaction to refund
amount
string
required
Amount to refund (can be partial)
reason
string
required
Reason for refund
initiated_by
string
required
Admin/User ID authorizing refund
pin
string
Merchant PIN/Password for authorization

Response

success
boolean
Whether refund succeeded
refund_id
string
Refund transaction ID
original_amount
string
Original payment amount
refunded_amount
string
Amount refunded

Examples

curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/pos/refund" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "original_transaction_id": "txn_pos_12345",
    "amount": "1500.00",
    "reason": "Customer returned item",
    "initiated_by": "admin_user_01",
    "pin": "9999"
  }'
{
  "success": true,
  "message": "Refund processed successfully",
  "refund_id": "rfnd_abc789",
  "original_transaction_id": "txn_pos_12345",
  "refunded_amount": "1,500.00 SLE",
  "timestamp": "2025-01-20T15:00:00Z"
}

Errors

StatusCodeDescription
400INVALID_AMOUNTMore than original amount
400ALREADY_REFUNDEDRefund limit reached
403UNAUTHORIZEDUser cannot perform refunds
404TXN_NOT_FOUNDOriginal transaction missing
500INTERNAL_ERRORServer error