# Refund Transaction

A refund transaction is the process where money is returned to a customer for a purchase they previously made. In the context of fraud detection, refund transactions can be flagged for investigation if they exhibit suspicious or unusual patterns, such as an unusually high frequency of refunds, refunds of large amounts, or discrepancies between the refund request and the original purchase details. These flags help identify potential fraudulent activity, ensuring the integrity and security of the transaction process.

## Refund Transaction

**POST** `https://secctrl.tutelar.io/api/v1/fraud-detector/transaction/refund`

### Body

`application/json`

| Field     | Type          | Required | Description                                                                                                                                                                                                                                               | Example             | Possible values          |
| --------- | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------------ |
| `status`  | string · enum | Required | It is used to request the status of a refund for a transaction. The value should be one of the following: `'requested'`: Indicates that the refund has been requested but not yet processed. `'processed'`: Indicates that the refund has been processed. | `requested`         | `requested`, `processed` |
| `orderId` | string        | Required | This key represents the Transaction Order ID. It is a unique identifier for the transaction associated with the order for which the refund is being requested.                                                                                            | `ORD_10726`         |                          |
| `reason`  | string        | Required | This key is used to provide the reason for the refund. It explains why the refund is being requested, such as due to a product issue, service dissatisfaction, or any other relevant reason.                                                              | `Product Defective` |                          |

### Responses

#### 200 — Refund status updated successfully

`application/json`

| Field     | Type    | Required | Example                              |
| --------- | ------- | -------- | ------------------------------------ |
| `success` | boolean | Optional | `true`                               |
| `message` | string  | Optional | `Refund status updated successfully` |
| `data`    | object  | Optional |                                      |

#### 422 — Invalid status

## Example Request

```http
POST /api/v1/fraud-detector/transaction/refund HTTP/1.1
Host: secctrl.tutelar.io
Content-Type: application/json
Accept: */*
Content-Length: 73

{
  "status": "requested",
  "orderId": "ORD_10726",
  "reason": "Product Defective"
}
```

## Example Response

```json
{
  "success": true,
  "message": "Refund status updated successfully",
  "data": {
    "orderId": "ORD_10726",
    "requestedDateTime": "2024-04-17T11:54:00.466Z",
    "responseDateTime": "2024-04-17T11:54:00.474Z",
    "processedTime": 8
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.v2.tutelar.io/refund-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
