Skip to main content
PayHubDeveloper docs
简体中文

List refunds

API contract v1.0.0

listRefunds
GET/v1/refunds
Required scopesrefunds:read

Lists refunds for the current merchant and environment, filtered by original payment, merchant refund ID and status. Results are ordered by creation time descending, with ties broken by id descending, so the order is stable. It uses cursor pagination; created_gte is inclusive and created_lt is exclusive. Platform exception refunds (where the platform returns a duplicate charge, or an overcharge caused by an amount mismatch, to the cardholder's original payment method) aren't returned by the open API: retrieving one returns 404, and they don't count toward the Payment's refunded_amount or refund_status.

Request headers

Request headersRequiredFormatDescription
AuthorizationYesBearer <API_KEY>

Server-side key, to be used only on the merchant's server. The merchant and environment are derived from the key. A missing, invalid, revoked or expired key returns 401.

Query parameters

NameTypeRequiredDescription
payment_id
stringNo

Filter by original payment ID.

Constraints: Length 1–64

Example: pay_demo_001

merchant_refund_no
stringNo

Exact match on the merchant refund ID.

Constraints: Format ^[A-Za-z0-9._:-]{1,64}$

Example: REFUND-DEMO-001

status
stringNo

Filter by refund status.

  • pending_review: Accepted and waiting for review; the funds stay reserved
  • processing: Approved and submitted, or the provider's result is being confirmed; the funds stay reserved
  • succeeded: The provider confirmed the refund succeeded; the reserved funds become a final deduction
  • failed: The refund clearly did not succeed; the reserved funds are released
  • rejected: Rejected in review and not submitted to the provider; the reserved funds are released
  • canceled: Canceled by an authorized person before submission to the provider; the reserved funds are released
  • returned: All or part of the funds were actually returned after a refund that had been confirmed as succeeded
  • More values may be added in the future. Don't treat a status you don't recognize as success.

Example: pending_review

limit
integerNo

Number of items per page. The default is 20 and the maximum is 100.

Constraints: 1–100Default 20

cursor
stringNo

The next_cursor from the previous page's response. An opaque string: don't parse it or build one yourself. Send the same filters as for the first page.

Constraints: Length 1–512

created_gte
string(date-time)No

Lower bound of the creation time (inclusive), as ISO 8601 with a time zone.

Example: 2026-09-23T00:00:00Z

created_lt
string(date-time)No

Upper bound of the creation time (exclusive), as ISO 8601 with a time zone.

Example: 2026-09-24T00:00:00Z

Request example

curl
curl -X GET 'https://api.fluxan.co/v1/refunds?limit=20' \
  -H 'Authorization: Bearer <TEST_SERVER_API_KEY>'

Placeholders to replace

  • <TEST_SERVER_API_KEY>: Test-environment server API key, created on the "API Key" page of the merchant portal

Note

Server API keys must only be used on your own server, so the docs site doesn't offer interactive API testing. Get a test key: API Key page in the merchant portal (opens the merchant portal in a new tab) (Test environment; Requires Owner, Admin or Developer)

Responses

The refund list.

Refund list
{
  "data": [
    {
      "id": "ref_demo_001",
      "version": 1,
      "payment_id": "pay_demo_001",
      "merchant_refund_no": "REFUND-DEMO-001",
      "amount": 2500,
      "currency": "USD",
      "status": "succeeded",
      "reason": "requested_by_customer",
      "returned_amount": 0,
      "failure": null,
      "metadata": {
        "ticket": "CS-DEMO-001"
      },
      "created_at": "2026-09-24T02:00:00Z",
      "completed_at": "2026-09-24T02:00:09Z"
    },
    {
      "id": "ref_demo_003",
      "version": 1,
      "payment_id": "pay_demo_001",
      "merchant_refund_no": "REFUND-DEMO-003",
      "amount": 1000,
      "currency": "USD",
      "status": "processing",
      "reason": "requested_by_customer",
      "returned_amount": 0,
      "failure": null,
      "metadata": {
        "ticket": "CS-DEMO-001"
      },
      "created_at": "2026-09-24T01:00:00Z",
      "completed_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "request_id": "req_demo_027"
}

Response fields

Paginated list: data is an array of objects. When has_more is true, use next_cursor to fetch the next page. See the object section for field descriptions.

NameTypeRequiredDescription
data
array<Refund>Required
id
stringRequired

Platform refund ID.

Example: ref_demo_001

version
integer(int64)Required

Object version, which increases with every effective business change (status, failure reason, returned amount). Compare versions to discard older events, and don't order events by status name.

Constraints: ≥ 1

Example: 1

payment_id
stringRequired

Original payment ID.

Example: pay_demo_001

merchant_refund_no
stringRequired

Merchant refund ID, unique within one merchant and environment.

Example: REFUND-DEMO-001

amount
integer(int64)Required

Refund principal, in the smallest currency unit.

Constraints: ≥ 1

Example: 4000

currency
stringRequired

Refund currency, inherited from the original payment.

Constraints: Format ^[A-Z]{3}$

Example: USD

status
stringRequired

Refund status.

  • pending_review: accepted and waiting for review; the funds stay reserved
  • processing: approved and submitted, or the provider's result is being confirmed; the funds stay reserved
  • succeeded: the provider confirmed the refund succeeded; the reserved funds become a final deduction
  • failed: the refund clearly did not succeed; the reserved funds are released
  • rejected: rejected in review and not submitted to the provider; the reserved funds are released
  • canceled: canceled by an authorized person before submission to the provider; the reserved funds are released
  • returned: all or part of the funds were actually returned after a refund that had been confirmed as succeeded
  • pending_review: Accepted and waiting for review; the funds stay reserved
  • processing: Approved and submitted, or the provider's result is being confirmed; the funds stay reserved
  • succeeded: The provider confirmed the refund succeeded; the reserved funds become a final deduction
  • failed: The refund clearly did not succeed; the reserved funds are released
  • rejected: Rejected in review and not submitted to the provider; the reserved funds are released
  • canceled: Canceled by an authorized person before submission to the provider; the reserved funds are released
  • returned: All or part of the funds were actually returned after a refund that had been confirmed as succeeded
  • More values may be added in the future. Don't treat a status you don't recognize as success.

Example: pending_review

reason
stringRequired

Refund reason.

Example: requested_by_customer

returned_amount
integer(int64)Required

The cumulative principal actually returned after the refund succeeded.

Constraints: ≥ 0

Example: 0

failure
RefundFailureNullableRequired

The reason when status is failed or rejected; otherwise null.

metadata
objectNo

Custom key-value pairs set by the merchant: up to 20 keys. A key can be up to 40 characters, and a value is a string of up to 200 characters. Don't put sensitive data such as card numbers in it. The platform checks for such data and rejects the request.

Constraints: Up to 20 keysMax value length 200

Example: {"business_order_type":"one_time_purchase"}

created_at
string(date-time)Required

The time the request was accepted.

Example: 2026-09-23T10:00:00Z

completed_at
string(date-time)NullableRequired

The time the refund entered succeeded, failed, rejected or canceled; null if it hasn't ended yet.

Example: null

has_more
booleanRequired

Whether there is a next page.

Example: false

next_cursor
stringNullableRequired

The cursor for the next page; null when there is no next page.

Example: null

request_id
stringRequired

Unique identifier of this request.

Example: req_demo_003

Possible error codes

HTTPError codeWhen it occursHow to handle
400invalid_requestIdempotency-Key is missing; the order ID contains invalid characters; payment_method_data and payment_method_id are submitted together; confirm=false carries card details; confirm=true has no return_url; a checkout session request sends both groups of identity parameters, or neither; a browser_info / billing_details field the provider requires is missing; the cursor, time format or limit is invalidFix the request according to error.field and resubmit it; don't charge again automatically
401unauthenticatedCommonNo Authorization header was sent; the key was copied incompletely; the old key expired after a rotation; the key was revokedCheck your credentials: on the API Key page in the merchant portal, verify the key's status and environment
403forbiddenCommonCreating a refund with a read-only key; calling getEvent without the read scope for the event's business area; if the request's source IP isn't on the key's allowlist, the more specific ip_not_allowed is returnedUse a key that has the required scope; don't work around the restriction
429rate_limitedCommonA rate limit per merchant and per key; switching keys doesn't get around the merchant's overall limitWait for Retry-After seconds, then retry with the original idempotency key
500internal_errorCommon—Retry with the original idempotency key, or query by merchant order ID / refund ID; never charge again with a new key
502 / 503upstream_unavailableCommonA provider or platform dependency failed, and the platform can't confirm whether this request took effectSame as above

Notes

  • You can filter by original payment, merchant refund ID and status. Ordering and pagination work the same as for the payments list.
  • Platform exception refunds (the platform returns a duplicate charge, or an overcharge caused by an amount mismatch, to the cardholder's original payment method) don't appear in the list and don't count toward the payment's refunded_amount or refund_status. The platform notifies you separately with an in-app notification and an email.
Was this page helpful?