Refund Order
Issue a full or partial refund for a paid order.
Endpoint
POST /v1/orders/:ref_code/refund
Prerequisites
- Order status must be
PAIDorPARTIALLY_REFUNDED amount_minormust 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
| Parameter | Description |
|---|---|
ref_code | The PGA reference code of the order to refund |
Body
| Field | Type | Required | Description |
|---|---|---|---|
amount_minor | integer | Yes | Refund amount in minor units (min: 1, max: order amount_minor) |
reason | string | No | Refund reason category (e.g., CUSTOMER_REQUEST, DUPLICATE) |
reason_detail | string | No | Free-text description |
idempotency_key | string | Yes | Unique 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
| Code | HTTP | Description |
|---|---|---|
INVALID_STATUS | 422 | Order is not in a refundable state |
AMOUNT_EXCEEDS_ORDER | 422 | Refund amount exceeds the remaining refundable amount |
ORDER_NOT_FOUND | 404 | Order not found |
info
Refund processing time depends on the original payment method and vendor. QRIS refunds typically process within 1-3 business days.