SettleFlow API

Refund

Refund a previously captured payment with POST /v1/refund/direct

Endpoint

POST https://api.settleflow.io/v1/refund/direct

V1 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

HeaderValue
epro-api-keyYour API key
Content-Typeapplication/json

Body

Provide one of the following identifiers. When both are supplied, Reference takes precedence.

FieldTypeDescription
ReferencestringThe SettleFlow payment request ID returned at payment time (pr_...).
TidstringYour 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

FieldTypeDescription
OperationTypestringAlways "refund".
Statusstringcaptured when the refund succeeded, failed otherwise.
TidstringYour original transaction reference.
ReferencestringSettleFlow refund ID (distinct from the original payment Reference).
AmountnumberRefunded amount in major currency units.
UserIdstringThe Uid supplied on the original payment.
MessagestringHuman-readable result.
DatestringServer time, YYYY-MM-DD HH:mm:ss (UTC).

Errors

CodeMeaning
1Neither Tid nor Reference supplied
3Invalid API key
4API key missing
102Transaction not found for the given Tid / Reference
103Invalid 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_SUCCEEDED event is delivered to the CallbackUrl registered at payment time (mapped to OperationType=refund in E-PRO payloads). See Webhooks.
  • Timing. Refunds are processed synchronously against the underlying PSP. Response time typically matches the PSP's own refund latency.

On this page