# Refund a Charge or a PaymentIntent in-person

Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/terminal/payments/regional.md?integration-country=CA#refund-an-interac-payment) for more details.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createPaymentIntent
POST /v1/payment_intents {"amount":2000,"currency":"usd","automatic_payment_methods":{"enabled":true}}

## Request

```curl
curl https://api.stripe.com/v1/terminal/readers/tmr_njDFG9Z5k7y7KeQI8RmZYDYT/refund_payment \
  -u "<<YOUR_SECRET_KEY>>" \
  -d payment_intent={{PAYMENT_INTENT_ID}}
```

### Response

```json
{
  "id": "tmr_njDFG9Z5k7y7KeQI8RmZYDYT",
  "object": "terminal.reader",
  "action": {
    "failure_code": null,
    "failure_message": null,
    "refund_payment": {
      "payment_intent": "pi_1NrpbFBHO5VeT9SUiCEDMdc8",
      "amount": 1000
    },
    "status": "in_progress",
    "type": "refund_payment"
  },
  "device_deploy_group": null,
  "device_sw_version": null,
  "device_type": "bbpos_wisepos_e",
  "ip_address": "192.168.2.2",
  "label": "Blue Rabbit",
  "livemode": false,
  "location": null,
  "metadata": {},
  "serial_number": "123-456-789",
  "software": null,
  "status": "online"
}
```

## Returns

Returns an updated `Reader` resource

## Parameters

- `amount` (integer, optional)
  A positive integer in **cents** representing how much of this charge to refund.

- `charge` (string, optional)
  ID of the Charge to refund.

- `metadata` (map, optional)
  Set of [key-value pairs](https://docs.stripe.com/api/metadata.md) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

- `payment_intent` (string, optional)
  ID of the PaymentIntent to refund.

- `refund_application_fee` (boolean, optional)
  Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.

- [`refund_payment_config`](https://docs.stripe.com/api/terminal/readers/refund_payment.md?query=refund_payment_config) (object, optional)
  Configuration overrides for this refund, such as customer cancellation settings.

- `reverse_transfer` (boolean, optional)
  Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge.
