# Get Settlements by UTR

**Method:** `GET`

**Path:** `/api/settlements/v1/detail/{utr}`

**Category:** Settlements

**Authentication:** Required

## Description

Retrieves detailed settlement information for a specific UTR (Unique Transaction Reference).

**Notes:**
- Maximum date range for retrieving settlement data is 60 days.
- API supports a maximum of 10 records per page, one page at a time.


## Path Parameters

- `utr` (`string`) **required** — Unique Transaction Reference number.

## Query Parameters

- `page` (`string`) — Page number to retrieve.
- `per_page` (`string`) — Number of records per page (max 10).

## Responses

- `200` — Settlement details retrieved successfully.
- `400` — 
- `401` — 
- `500` — 

### Response Schema

- `utr_number` (`string`) — Unique Transaction Reference provided by the bank.
- `bank_name` (`string`) — Settlement bank name.
- `bank_acc_number` (`string`) — Settlement bank account number.
- `programs` (`string[]`)
- `total_transaction_count` (`integer`) — Total number of transactions in this UTR.
- `total_transaction_amount` (`number`) — Total transaction amount settled after deductions.
- `actual_transaction_amount` (`number`) — Total transaction amount without deductions.
- `total_refund` (`number`) — Total refund amount deducted.
- `total_chargeback_recovery_amount` (`number`) — Total chargeback recovery amount.
- `total_loan_recovery_amount` (`number`) — Total loan recovery amount.
- `total_mdr_amount` (`number`) — Total MDR (Merchant Discount Rate) amount.
- `total_gst_amount` (`number`) — Total GST amount charged.
- `total_late_settlement_fee` (`number`) — Total late settlement fee.
- `total_settled_amount` (`number`) — Total settled amount.
- `total_mar_amount` (`number`) — Total Merchant Acquisition Rate charged.
- `split_fund_amount` (`number`) — Split amount of the transaction.
- `total_platform_fee` (`number`) — Total platform fee charged.
- `other_deductions` (`number`) — Other deductions.
- `additional_mdr_amount` (`number`) — Additional MDR amount deducted.
- `total_convenience_fee` (`number`) — Total convenience fee charged.
- `total_gst_on_c_c_f` (`number`) — GST charged on convenience fees.
- `total_cashback_amount` (`number`) — Total cashback amount provided.
- `total_merchant_cashback` (`number`) — Total merchant cashback amount.
- `total_merchant_convenience_fee` (`number`) — Total merchant convenience fee.
- `transactions` (`SettlementTransaction[]`) — Array of individual transaction details.
  - `transaction_id` (`string`) — Unique identifier for the transaction.
  - `system` (`string`) — Constant system identifier.
  - `processed_date` (`string`) — Date when the transaction was processed.
  - `transaction_date` (`string`) — Date of the transaction.
  - `transaction_amount` (`number`) — Transaction amount.
  - `actual_transaction_amount` (`number`) — Total transaction amount without deductions.
  - `total_deduction_amount` (`number`) — Total deduction amount.
  - `settled_amount` (`number`) — Settled amount for this transaction.
  - `store_address` (`string`) — Address of the store (applicable for POS transactions).
  - `acquirer_name` (`string`) — Name of the acquirer.
  - `tid` (`string`) — Terminal ID for the transaction.
  - `is_emi` (`boolean`) — Whether the transaction was an EMI.
  - `utr_number` (`string`) — UTR number.
  - `program` (`string`) — Payment method used.
  - `payout_status` (`string`) — Status of the payout.

- `pagination` (`object`)
  - `total_pages` (`integer`) — Total number of pages.
  - `current_page` (`string`) — Current page number.


### Example Response

```json
{
  "utr_number": "410092786849",
  "bank_name": "HDFC Bank Ltd",
  "bank_acc_number": "04992990009595",
  "programs": [
    "UPI"
  ],
  "total_transaction_count": 2,
  "total_transaction_amount": 2,
  "actual_transaction_amount": 2,
  "total_refund": 0,
  "total_chargeback_recovery_amount": 0,
  "total_loan_recovery_amount": 0,
  "total_mdr_amount": 0.04,
  "total_gst_amount": 0,
  "total_late_settlement_fee": 0,
  "total_settled_amount": 0.96,
  "total_mar_amount": 0,
  "split_fund_amount": 0,
  "total_platform_fee": 0,
  "other_deductions": 0,
  "additional_mdr_amount": 0,
  "total_convenience_fee": 0,
  "total_gst_on_c_c_f": 0,
  "total_cashback_amount": 0,
  "total_merchant_cashback": 0,
  "total_merchant_convenience_fee": 0,
  "transactions": [
    {
      "transaction_id": "v1-241008182747-aa-8JwMy9-up-k",
      "system": "PG",
      "processed_date": "2024-10-09T07:00:00",
      "transaction_date": "2024-10-08T00:00:00",
      "transaction_amount": 1,
      "actual_transaction_amount": 1,
      "total_deduction_amount": 0.02,
      "settled_amount": 0,
      "store_address": "sec 62 noida",
      "acquirer_name": "UPI_HDFC",
      "tid": "HDFC000028502654",
      "is_emi": false,
      "utr_number": "410092786849",
      "program": "UPI",
      "payout_status": "Success"
    }
  ],
  "pagination": {
    "total_pages": 2,
    "current_page": "1"
  }
}
```

---

Reference: https://localhost:3000/api/settlements/get-settlements-by-utr
