> For the complete documentation index, see [llms.txt](https://docs.morpara.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.morpara.com/tr/en/api-documentation/bincheck/refund.md).

# Refund

Refund service, **has entered the end-of-day process** that is, allows reversing a transaction that has been financialized.

With this service:

* Full payment or **partial refund** can be made.
* Bank and merchant records are updated.
* Transaction tracking is provided.

> ⚠️ For non-financialized transactions **Cancel (Void)** service should be used.

***

### Endpoint

```http
POST /v1/Payment/DoPayment
```

***

### Request Body

| Field                              | Required | Type    | Description                                         | Example                                      |
| ---------------------------------- | -------- | ------- | --------------------------------------------------- | -------------------------------------------- |
| merchantId                         | ✅        | String  | Seller's unique identification number               | 100000000000004                              |
| language                           | ✅        | String  | Transaction language                                | tr                                           |
| conversationId                     | ✅        | String  | Unique identifier for transaction tracking          | MSD000011                                    |
| sign                               | ✅        | String  | Digital signature to verify the request             | NN6JMMJANWWQ6DN5M+DUGIZW4DS2WHX0NI2JRJ0XT3O= |
| orderId                            | ✅        | String  | Order's unique identification number                | 100000000000004202402140269                  |
| paymentId                          | ✅        | String  | Identification number of the payment to be refunded | 32423424                                     |
| transactionDetails.transactionType | ✅        | String  | Transaction type                                    | REFUND                                       |
| transactionDetails.currencyCode    | ✅        | String  | Currency code (ISO 4217)                            | 949                                          |
| transactionDetails.amount          | ✅        | Decimal | Amount to be refunded                               | 1.00                                         |

***

### Response Body

If the refund transaction is successful, the system returns the following response:

#### Sample Request

```http
POST /v1/Payment/DoPayment
Content-Type: application/json
```

```json
{
  "merchantId": "100000000000004",
  "language": "tr",
  "conversationId": "MSD000011",
  "sign": "NN6JMMJANWWQ6DN5M+DUGIZW4DS2WHX0NI2JRJ0XT3O=",
  "orderId": "100000000000004202402140269",
  "paymentId": "32423424",
  "transactionDetails": {
    "transactionType": "REFUND",
    "currencyCode": "949",
    "amount": 1.00
  }
}

```

#### Sample Response

```json
{
  "code": "00",
  "message": "Approved",
  "resultCode": "00",
  "resultDescription": "Successful",
  "responseDate": "12/03/2024 12:34:40",
  "conversationId": "MSD2024030500000000120",
  "orderId": "100000000000004202402140269",
  "paymentId": "100000000000004202402140269",
  "bankUniqueReferenceNumber": "407100003684"
}

```
