# Creates a refund for this payment.

Creates a Refund object for this Payment.

Creating a refund will refund a certain amount back to the customer. This amount will be deducted from your balance.

You can choose to only refund a part of the total amount. You can do this multiple times, but the total refunded
amount can't exceed the payment amount.

Some pay methods require additional information, like IBAN and account holder name, to be supplied.

Endpoint: POST /payments/{id}/refunds
Version: v1
Security: apiKey

## Path parameters:

  - `id` (string, required)
    ID of the payment

## Request fields (application/json):

  - `amount` (integer, required)
    The amount that will be refunded to the customer. This can be an amount lower than the total amount to do a partial refund. You can't refund more than the total amount of the original payment.
    Example: 1000

  - `description` (string,null)
    The description of the refund. This will be shown to your customer and will be visible in the dashboard.
    Example: "Test Refund"

  - `reason` (string,null)
    The reason for this refund.
    Example: "Customer requested"

  - `account_holder_name` (string,null)
    Name of the account holder of the account where the refund will be credited. This is a required field for the pay methods 'bancontact' and 'creditcard'. For other pay methods we will use the orginal customer information provided by the pay method to do the refund.
    Example: "John Doe"

  - `iban` (string)
    IBAN of the account where the refund will be credited. required field for the pay methods 'bancontact' and 'creditcard'. For other pay methods we will use the orginal customer information provided by the pay method to do the refund.
    Example: "NL02ABNA0123456789"

  - `metadata` (object,null)
    You can put in random data that you like to save alongside the refund. When you fetch the refund this will be returned in the metadata field.

## Response 201 fields (application/json):

  - `id` (string, required)
    Example: "PRRNQH3PCD125Z"

  - `type` (string, required)
    Enum: "refund"

  - `amount` (integer, required)
    Example: 1000

  - `description` (string, required)
    Example: "Test Payment"

  - `reason` (string,null, required)

  - `currency` (string, required)
    Enum: "EUR"

  - `payment` (string, required)
    Example: "PPBLGEE6UG92MS"

  - `state` (string, required)
    Example: "refunded"

  - `metadata` (object, required)
    Example: {}

  - `refunded_at` (string,null, required)
    Example: "2023-06-30T12:44:35Z"

  - `fail_reason` (string,null)
    Enum: "Not enough balance in your PayPro account", "Missing details", "Declined (by PayPro or bank)", "Payment is not refundable anymore", "Unknown"

  - `created_at` (string, required)
    Example: "2023-06-30T12:40:10Z"

  - `_links` (object, required)
    Example: {"self":"https://api.paypro.nl/refunds/PRRNQH3PCD125Z","payment":"https://api.paypro.nl/payments/PPBLGEE6UG92MS"}

  - `_links.self` (string, required)
    Example: "https://api.paypro.nl/refunds/PRRNQH3PCD125Z"

  - `_links.payment` (string, required)
    Example: "https://api.paypro.nl/payments/PPBLGEE6UG92MS"


