Refunds
The Refunds API lets merchants return funds to a payer after a payment request reaches a refundable state. Refunds are scoped to the organization or account that owns the payment request's point of sale.
Overview
When you create a refund, Fluxis:
- Validates that your API credentials can access the payment request's POS
- Checks that the payment request is in an eligible status
- Creates a refund record in
processingstatus - Sends a
refundwebhook (if configured) with the initial status
On-chain execution is not yet implemented. Refund records are created and webhooks are dispatched, but the blockchain transfer that sends funds to refund_to_address is still pending implementation in the refund processing service.
Eligible payment request statuses
Refunds can only be created when the payment request is in one of these statuses:
| Status | Typical use |
|---|---|
completed | Full payment received; refund the paid amount |
overpaid | Payer sent more than requested |
underpaid | Payer sent less than requested |
confirmed | Ledger transaction created after payment |
Payment requests in pending, created, processing, expired, or failed are not eligible.
Authentication
All refund endpoints require both headers:
Authorization: Bearer <access_token>x-fluxis-api-key: <your_api_key>
See Authentication & Configuration for token exchange.
Create a refund
Code
Request body
| Field | Required | Description |
|---|---|---|
refund_to_address | Yes | Blockchain address that will receive the refund |
amount | No | Decimal string. If omitted, defaults to the payment request's recorded amount |
reason | No | Free-text reason for audit purposes |
Example
Code
Response (200)
Code
When amount is omitted, the refund uses the payment request's stored amount. For overpaid or underpaid requests, that value reflects the amount actually received on chain.
Get refund details
Code
Returns full refund metadata including network, asset, original payment transaction hash, and refund_transaction_hash once on-chain processing completes.
| Field | Description |
|---|---|
status | processing, completed, or failed |
payment_transaction_hash | Hash of the original inbound payment |
refund_transaction_hash | Outbound refund hash (present after on-chain execution) |
unique_asset_id | Asset identifier (e.g. Polygon USDC) |
network | Blockchain network for the refund |
You can only retrieve refunds that were created by the same authenticated entity (organization or account).
Refund statuses
| Status | Meaning |
|---|---|
processing | Refund record created; on-chain transfer pending |
completed | Refund transaction confirmed on chain |
failed | Refund could not be completed |
Today, newly created refunds remain in processing until on-chain execution is implemented.
Webhooks
Register a webhook with event_type: "refund" at the account level. On create, Fluxis sends:
Code
Verify every delivery using Webhook Signature Verification. See Webhook Events for the full event catalog.
Common errors
| HTTP | Cause |
|---|---|
400 | Invalid payment request ID, amount, or ineligible payment request status |
403 | API credentials lack permission for the payment request's POS |
404 | Refund not found (GET only) |
Related documentation
- Payment Requests — lifecycle and edge-case states
- Webhook Events —
refundevent payload - Transactions — ledger records after payment confirmation