Lewati ke konten utama

Refund Order

Issue a full or partial refund for a paid order.

Endpoint

POST /v1/orders/:ref_code/refund

Prerequisites

  • Order status must be PAID or PARTIALLY_REFUNDED
  • amount_minor must not exceed the remaining refundable amount
  • Refund availability depends on your aggregator's vendor configuration — contact support if refunds are not available for your account

Request

Path Parameters

ParameterDescription
ref_codeThe PGA reference code of the order to refund

Body

FieldTypeRequiredDescription
amount_minorintegerYesRefund amount in minor units (min: 1, max: order amount_minor)
reasonstringNoRefund reason category (e.g., CUSTOMER_REQUEST, DUPLICATE)
reason_detailstringNoFree-text description
idempotency_keystringYesUnique key to prevent duplicate refunds (e.g., refund-INV-2026-00123-01)

Example

cURL
curl -X POST https://api.nusio-saka.com/v1/orders/ORD-260601103045-A1B2/refund \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"amount_minor": 5000000,
"reason": "CUSTOMER_REQUEST",
"reason_detail": "Customer changed their mind",
"idempotency_key": "refund-INV-2026-00123-01"
}'

Response

HTTP 201 Created

{
"success": true,
"data": {
"id": "uuid",
"order_ref_code": "ORD-260601103045-A1B2",
"amount_minor": 5000000,
"reason": "CUSTOMER_REQUEST",
"status": "PENDING",
"created_at": "2026-06-01T11:00:00Z"
}
}

Error Codes

CodeHTTPDescription
INVALID_STATUS422Order is not in a refundable state
AMOUNT_EXCEEDS_ORDER422Refund amount exceeds the remaining refundable amount
ORDER_NOT_FOUND404Order not found
info

Refund processing time depends on the original payment method and vendor. QRIS refunds typically process within 1-3 business days.