> ## 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.

# Raise a Complaint

> Register a complaint related to a UPI payment transaction.

<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 register a complaint for a failed or unsatisfactory UPI transaction.

<RequestExample>
  ```bash Curl theme={null}
  curl -X POST 'https://api.rzp.<bank>.com/v1/complaints/raise' \
  -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" \
  -d '{
    "reference_id": "123214121",
    "upi_transaction_id": "1234567890",
    "upi_original_transaction_id": "1231312321412",
    "upi_initiation_mode": "00",
    "upi_purpose_code": "01",
    "upi_reference_category": "00",
    "upi_reference_url": "https://www.abcxyz.com/",
    "request_adjustment_amount": "500",
    "request_adjustment_code": "U010",
    "request_adjustment_flag": "PBRB",
    "description": "Amount not credited"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "entity": "upi.complaint",
    "reference_id": "123214121",
    "upi_reference_id": "123214121",
    "upi_transaction_id": "1234567890",
    "upi_response_code": "01",
    "upi_customer_reference_number": "123214121",
    "payee": {
      "vpa": "acme.corp@rzp",
      "name": "AcmeCorp Pvt. Ltd."
    },
    "description": "Your Complaint is Raised",
    "status": "initiated",
    "request_adjustment_amount": "500",
    "request_adjustment_code": "U010",
    "request_adjustment_flag": "PBRB"
  }
  ```
</ResponseExample>

## Request Parameters

<ParamField body="reference_id" type="string" required>
  Unique id generated by the business for the complaint.
</ParamField>

<ParamField body="upi_transaction_id" type="string" required>
  Unique transaction id on which the complaint is raised.
</ParamField>

<ParamField body="upi_original_transaction_id" type="string" required>
  Original UPI transaction id used at the time of payment.
</ParamField>

<ParamField body="upi_initiation_mode" type="enum">
  Indicates the 2-digit code defined by NPCI. Possible values:

  * `00`: Default - When no specific code is assigned or for general default scenarios.
  * `01`: QR Code - For making payments by scanning a standard QR code.
  * `02`: Secure QR Code - For payments that require additional security with QR codes.
  * `03`: Bharat QR Code - For interoperable payments across various payment networks using Bharat QR.
  * `04`: Intent - For payments initiated by an intent from an application or browser.
  * `05`: Secure Intent - For payments initiated by a secure intent from an app or browser.
  * `06`: NFC (Near Field Communication) - For contactless payments using NFC technology.
  * `07`: BLE (Bluetooth) - For payments made through Bluetooth Low Energy technology.
  * `08`: UHF (Ultra High Frequency) - For payments made using UHF technology, typically for toll payments.
  * `09`: Aadhaar - For payments authenticated using an Aadhaar number and biometric verification.
  * `10`: SDK (Software Development Kit) - For payments initiated through an SDK embedded in an app.
  * `11`: UPI-Mandate - For setting up recurring payments or mandates using UPI.
  * `12`: FIR (Foreign Inward Remittance) - For receiving remittances from foreign countries.
  * `13`: QR Mandate - For setting up recurring payments using a QR code.
  * `14`: BBPS - For making bill payments through the Bharat Bill Payment System.
</ParamField>

<ParamField body="upi_purpose_code" type="enum">
  The 2-digit code defined by NPCI present in the intent URL or QR codes. Possible values:

  * `01`: SEBI
  * `02`: AMC
  * `03`: Travel
  * `04`: Hospitality
  * `05`: Hospital
  * `06`: Telecom
  * `07`: Insurance
  * `08`: Education
  * `09`: Gifting
  * `10`: BBPS
  * `11`: Global UPI
  * `12`: Metro ATM QR
  * `13`: Non-metro ATM QR
  * `14`: Standing Instruction
  * `15`: Corporate disbursement
</ParamField>

<ParamField body="upi_reference_category" type="string" required>
  The 2-digit code defined by NPCI present in the intent URL or QR codes. Possible values:

  * `00`: NULL
  * `01`: Advertisement
  * `02`: Invoice
</ParamField>

<ParamField body="upi_reference_url" type="string">
  Indicates a URL that, upon clicking, provides the customer with further transaction details such as bill details, bill copy, order copy, ticket details, and so on. When used, this URL should be related to the particular transaction and not be used to send unsolicited information irrelevant to the transaction.
</ParamField>

<ParamField body="request_adjustment_amount" type="integer">
  Complaint amount in paisa.
</ParamField>

<ParamField body="request_adjustment_code" type="string">
  NPCI-defined reason code for complaint.
</ParamField>

<ParamField body="request_adjustment_flag" type="string">
  NPCI-defined flag associated with the complaint reason.
</ParamField>

<ParamField body="description" type="string">
  Description for the complaint.
</ParamField>

## Response Parameters

<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="upi_transaction_id" type="string">
  UPI transaction id related to the complaint.
</ResponseField>

<ResponseField name="upi_response_code" type="string">
  Code returned by NPCI indicating complaint status.
</ResponseField>

<ResponseField name="upi_customer_reference_number" type="string">
  Complaint id shared by 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="description" type="string">
  Acknowledgement or status description.
</ResponseField>

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

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

<ResponseField name="request_adjustment_amount" type="integer">
  The adjustment amount for the complaint, in paise.
</ResponseField>

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

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