> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Complaints

> Retrieve the status of a specific complaint or fetch all complaints for a customer.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
</div>

Use this endpoint to fetch the status of a specific complaint or retrieve a list of complaints.

<RequestExample>
  ```bash Curl theme={null}
  curl -X GET 'https://api.rzp.<bank>.com/v1/complaints?upi_transaction_id=1232341412&refresh=true&limit=4&offset=10&status=success' \
  -u [YOUR_KEY_ID]:[YOUR_SECRET] \
  -H "Content-type: application/json" \
  -H "Authorization: Bearer <token>" \
  -H "x-device-fingerprint: <device_fingerprint>" \
  -H "x-device-fingerprint-timestamp: 1496918882000" \
  -H "x-customer-reference: customer-id-from-customer" \
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "entity": "collection",
    "count": 1,
    "items": [
      {
        "entity": "upi.complaint",
        "reference_id": "123214121",
        "upi_reference_id": "123214121",
        "request_adjustment_amount": 500,
        "request_adjustment_code": "U010",
        "request_adjustment_flag": "PBRB",
        "upi_customer_reference_number": "CRN987654321",
        "adjustment_amount": 500,
        "adjustment_code": "102",
        "adjustment_flag": "PR2C",
        "payee": {
          "vpa": "acme.corp@rzp",
          "name": "AcmeCorp Pvt. Ltd."
        },
        "status": "success",
        "description": "Complaint for failed transaction under review",
        "upi_transaction_id": "1232341412",
        "upi_original_transaction_id": "1232341412",
        "created_at": 1705411200
      }
    ]
  }
  ```

  ```json Failure theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "upi_original_transaction_id is mandatory",
      "source": "internal",
      "step": "",
      "reason": "",
      "field": "upi_original_transaction_id",
      "metadata": null
    }
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="upi_transaction_id" type="string">
  Fetch the complaint status for the specific transaction id.

  <Warning>
    **Watch Out!**

    This value should be alphanumeric and a maximum of 35 characters are allowed. The value should start with a prefix given by NPCI to Switch.
  </Warning>
</ParamField>

<ParamField query="refresh" type="boolean">
  Determines whether to fetch payment status from NPCI. Possible values:

  * `true`: If set to true, fetch payment status from NPCI.
  * `false` (default): If set to false, return payment from the local database.
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of records to return. Used for pagination.
</ParamField>

<ParamField query="offset" type="integer">
  Offset value for pagination.
</ParamField>

<ParamField query="status" type="string">
  The status of the complaint. Possible values:

  * `initiated`
  * `success`
  * `failure`
</ParamField>

## Response Parameters

<ResponseField name="entity" type="string">
  The entity type. Here, it is `collection`.
</ResponseField>

<ResponseField name="count" type="integer">
  Indicates the number of items in the entity type.
</ResponseField>

<ResponseField name="items" type="object">
  The complaint details.
</ResponseField>

<ResponseField name="entity" type="string">
  Entity type. Here it is `upi.complaint`.
</ResponseField>

<ResponseField name="reference_id" type="string">
  Business-generated complaint reference id.
</ResponseField>

<ResponseField name="upi_reference_id" type="string">
  Identifier returned by Razorpay for the complaint.
</ResponseField>

<ResponseField name="request_adjustment_amount" type="integer">
  The amount of the transaction sent by NPCI (in paise), when the complaint was raised.
</ResponseField>

<ResponseField name="request_adjustment_code" type="string">
  Code representing complaint reason from NPCI, when the complaint was raised..
</ResponseField>

<ResponseField name="request_adjustment_flag" type="string">
  Flag associated with the complaint reason from NPCI, when the complaint was raised..
</ResponseField>

<ResponseField name="upi_customer_reference_number" type="string">
  Complaint id shared by NPCI.
</ResponseField>

<ResponseField name="adjustment_amount" type="integer">
  The amount of the transaction sent by NPCI, in paise.
</ResponseField>

<ResponseField name="adjustment_code" type="string">
  Code representing complaint reason from NPCI.
</ResponseField>

<ResponseField name="adjustment_flag" type="string">
  Flag associated with the complaint reason from NPCI.
</ResponseField>

<ResponseField name="payee" type="object">
  The payee details.
</ResponseField>

<ResponseField name="vpa" type="string">
  The VPA of the payee.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the payee.
</ResponseField>

<ResponseField name="status" type="string">
  Indicates the complaint status. Possible values:

  * `initiated`
  * `active`
  * `completed`
  * `paused`
  * `failed`
</ResponseField>

<ResponseField name="description" type="string">
  Acknowledgement or status description.
</ResponseField>

<ResponseField name="upi_transaction_id" type="string">
  UPI transaction id related to the complaint.
</ResponseField>

<ResponseField name="upi_original_transaction_id" type="string">
  Original UPI transaction id used at the time of payment.
</ResponseField>

<ResponseField name="created_at" type="string">
  The UNIX timestamp at which the complaint was created.
</ResponseField>
