Refund
Refund a previously captured payment with POST /v1/refund/direct
Endpoint
POST https://api.settleflow.io/v1/refund/directV1 refunds are full refunds only — the entire captured amount is returned to the customer. If you need partial refunds, contact your SettleFlow account manager about the V2 API.
Request
Headers
| Header | Value |
|---|---|
epro-api-key | Your API key |
Content-Type | application/json |
Body
Provide one of the following identifiers. When both are supplied, Reference takes precedence.
| Field | Type | Description |
|---|---|---|
Reference | string | The SettleFlow payment request ID returned at payment time (pr_...). |
Tid | string | Your own transaction reference sent during the original payment. |
Example request
curl -X POST https://api.settleflow.io/v1/refund/direct \
-H "epro-api-key: sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"Reference": "pr_abc123"
}'Or by your own reference:
curl -X POST https://api.settleflow.io/v1/refund/direct \
-H "epro-api-key: sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"Tid": "order-2026-001"
}'Response
Success
{
"Code": 0,
"Result": {
"OperationType": "refund",
"Status": "captured",
"Tid": "order-2026-001",
"Reference": "ref_xyz789",
"Amount": 49.99,
"UserId": "customer-42",
"Message": "Payment refunded",
"Date": "2026-04-23 09:12:03"
}
}Result fields
| Field | Type | Description |
|---|---|---|
OperationType | string | Always "refund". |
Status | string | captured when the refund succeeded, failed otherwise. |
Tid | string | Your original transaction reference. |
Reference | string | SettleFlow refund ID (distinct from the original payment Reference). |
Amount | number | Refunded amount in major currency units. |
UserId | string | The Uid supplied on the original payment. |
Message | string | Human-readable result. |
Date | string | Server time, YYYY-MM-DD HH:mm:ss (UTC). |
Errors
| Code | Meaning |
|---|---|
1 | Neither Tid nor Reference supplied |
3 | Invalid API key |
4 | API key missing |
102 | Transaction not found for the given Tid / Reference |
103 | Invalid transaction (e.g. already refunded, not captured) |
Example error response:
{ "Code": 102, "Error": "Transaction not found" }Notes
- Idempotency. A second refund call on the same payment returns error
103— a captured payment can only be refunded once in V1. - Webhook. A
REFUND_SUCCEEDEDevent is delivered to theCallbackUrlregistered at payment time (mapped toOperationType=refundin E-PRO payloads). See Webhooks. - Timing. Refunds are processed synchronously against the underlying PSP. Response time typically matches the PSP's own refund latency.