# Refund Completed Payment

**POST** `/v2/payments/{payId}/refund`

Creates a refund request for an existing payment. The refund can be **full** or **partial** (based on the `amount` parameter).

***

#### Request parameters

**Path parameters**

| Name    | Type          | Required | Description                                                |
| ------- | ------------- | -------- | ---------------------------------------------------------- |
| `payId` | string (GUID) | yes      | Unique identifier of the payment registered in the system. |

**Body parameters**

| Name          | Type             | Required | Description                                                                                                                         |
| ------------- | ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `amount`      | number (decimal) | no       | Refund amount. If provided, a **partial refund** is initiated for the specified amount. If omitted, a **full refund** is initiated. |
| `reason`      | string           | yes      | Reason for initiating the refund (recommended max. 500 characters).                                                                 |
| `callbackUrl` | string (URL)     | no       | HTTPS URL where the system will send a callback when the refund is **accepted/processed**.                                          |

#### Request example

```json
{
  "amount": 50.61,
  "reason": "Reason for payment refund.",
  "callbackUrl": "https://www.example.com"
}
```

***

#### Response parameters

**`result` object**

| Name       | Type          | Description                                            |
| ---------- | ------------- | ------------------------------------------------------ |
| `refundId` | string (GUID) | Unique identifier of the refund created in the system. |
| `status`   | string (enum) | Refund request status. Possible value: `Created`.      |

**Other fields**

| Name     | Type         | Description                                               |
| -------- | ------------ | --------------------------------------------------------- |
| `ok`     | boolean      | Indicates whether the request was processed successfully. |
| `errors` | array / null | Contains error details if any occurred; otherwise `null`. |

#### Response example

```json
{
  "result": {
    "refundId": "8ce09e40-2948-4225-a9c4-f277dbd587ea",
    "status": "Created"
  },
  "ok": true,
  "errors": null
}
```
