Refunds
Create Refund
Changed onCreates a refund for a previously succeeded payment intent and returns the resulting Refund.
The referenced payment intent must have a succeeded status. If amount is omitted, the full amount of the payment intent is refunded. A refund.created event is emitted, and the returned refund's status may still be pending; subsequent status changes are delivered via webhooks.
post/v1/refunds
Request
- Base URLhttps://api.withflex.com
- URLhttps://api.withflex.com/v1/refunds
- AuthHTTP bearer
Request body
Example request
{
"refund": {
"payment_intent_id": "fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"amount": 2500,
"reason": "duplicate",
"metadata": {
"order_id": "8842",
"channel": "shopify"
}
}
}Response
An envelope wrapping a single refund object.
Example response
{
"refund": {
"refund_id": "fre_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"payment_intent_id": "fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"amount": 2500,
"created_at": "2026-06-15T14:30:00Z",
"reason": "duplicate",
"status": "pending",
"test_mode": false,
"metadata": {
"order_id": "8842",
"channel": "shopify"
},
"reference_id": "obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"reference_type": "acquirer_reference_number",
"reference_status": "available",
"items": [
{
"amount_refunded": 2500,
"payment_intent": "fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"payment_method_id": "fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"reference_id": "obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"reference_type": "acquirer_reference_number",
"reference_status": "available"
}
],
"subscription_id": "fsub_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"invoice_id": "fin_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"balance_transaction": "fbtxn_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"failure_balance_transaction": "fbtxn_01J9XR8M3K7VZ8N2YB4WJ6T0RA"
}
}Changes
- warning
the
/request property's max was set to2147483647.00 - warning
the
/request property's min was set to-2147483648.00
- warning