> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flouci.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund Payment

> Refund a completed standard payment and return funds to the customer.

This endpoint refunds a completed payment. Once processed, the funds are returned to the original payment method used by the customer.

<Warning>
  Exclusive feature. Only completed payments in a refundable state can be refunded. A payment that has already been refunded or is still pending cannot be refunded again.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://developers.flouci.com/api/v2/refund_payment' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <PUBLIC_KEY>:<PRIVATE_KEY>' \
    -d '{
      "payment_id": "FoPKKHqfQIKfBqhEj8M47A"
    }'
  ```
</RequestExample>

### Body

<ParamField body="payment_id" type="string" required>
  The ID of the payment to refund. This must be a valid `payment_id` from a previously completed payment.
</ParamField>

<ResponseExample>
  ```json Success theme={null}
  {
    "result": {
      "refund_id": "ref_a1b2c3d4",
      "payment_id": "FoPKKHqfQIKfBqhEj8M47A",
      "amount": "10000",
      "status": "success",
      "refunded_at": "2025-01-15T10:30:00Z"
    },
    "status": "success"
  }
  ```

  ```json Error theme={null}
  {
    "status": "error",
    "message": "Payment cannot be refunded",
    "code": "REFUND_NOT_ALLOWED"
  }
  ```
</ResponseExample>
