Chiwa Pay

Refund Payment

Start a refund and track its status.

View as Markdown
POST/payments/:id/refund

Starts a refund for a transaction that is already paid and has not entered settlement. The ShopeePay Partner SDK does not support refunds; this endpoint applies to GoPay transactions only. When the request succeeds, the transaction status changes to refund_processing.

Status Rules

Initial statusResult
paidrefund_processing
created, pending, expired, failed, cancelled, settled, refund_processing, refund_failed, refundedCannot be refunded.

Refund Calculation

The main refund amount is the customer-paid amount (total_amount). The customer receives that amount in full. The merchant settlement balance is still reduced by fee_amount as the transaction service fee.

Fee payerCustomer paysMain refund amountNotes
buyeramount + fee_amountamount + fee_amountThe customer-paid amount is refunded through the provider; fee_amount still reduces merchant settlement.
merchantamountamountfee_amount remains the merchant fee and reduces settlement.

Path Params

ParamTypeRequiredDescription
idstringYesTransaction UUID or reference_id.

Request Example

cURL
curl -X POST "https://api.chiwapay.com/payments/f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001/refund" \  -H "Authorization: Bearer sk_xxx"

Response

{
  "payment": {
    "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
    "reference_id": "PAY-LXAMPLE",
    "merchant_reference_id": "ORDER-1024",
    "payment_method_code": "qris",
    "currency": "IDR",
    "amount": 150000,
    "fee_amount": 1050,
    "net_amount": 150000,
    "total_amount": 151050,
    "status": "refund_processing"
  }
}

HTTP Error Code

HTTPCodeDescription
400payment_refund_failedTransaction cannot be refunded from its current status.
401invalid_api_keySecret key is invalid.
403merchant_not_approvedMerchant is not active.
404not_foundTransaction was not found.

On this page