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

# Approve a Collect Request

> Approve a collect request using the Razorpay TPAP Pro API.

<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 approve a collect request.  A collect request is approved if this API returns the Success 200 response code. The response contains the payment `status` returned by NPCI. Status can be `pending`, `successful` or `failed`.

<RequestExample>
  ```bash Curl theme={null}
  curl -X POST 'api.rzp.<bank>.com/v1/payments/:upi_transaction_id/approve' \
  -u [YOUR_KEY_ID]:[YOUR_SECRET] \
  -H "Content-type: application/json" \
  -H "x-device-fingerprint: <device_fingerprint>" \
  -H "x-device-fingerprint-timestamp: 1496918882000" \
  -H "x-customer-reference: customer-id-from-customer" \
  -d '{
    "device": {
      "geocode": "1234.1213",
      "ip": "198.1.1.1"
    },
    "upi_credentials": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "entity":"upi.payment",
    "upi_transaction_id":"RZPc2ed455b797e4add8392110cfc528acc",
    "reference_id":"ord_somfv432nsa",
    "upi_customer_reference_number":"804813039157",
    "upi_reference_url":"https://www.test.com",
    "upi_reference_category":"00",
    "upi_initiation_mode":"00",
    "upi_purpose_code":"00",
    "currency":"INR",
    "amount":10024,
    "type":"pay | collect",
    "description":"flight tickets",
    "payer":{
      "vpa":"gaurav.kumar@exampleupi",
      "fundsource":{
        "ifsc":"AXIS0000058",
        "masked_account_number":"XXXXXXXXXXX3000"
      },
      "name":"Gaurav Kumar",
      "mcc":"0000",
      "upi_response_code":"00",
      "upi_reversal_response_code":"string"
    },
    "payees":[
      {
        "vpa":"acme.corp@rzp",
        "fundsource":{
          "ifsc":"HDFC0000058",
          "masked_account_number":"XXXXXXXXXXX6000"
        },
        "name":"AcmeCorp Pvt. Ltd.",
        "mcc":"6765",
        "upi_response_code":"00",
        "upi_reversal_response_code":"string"
      }
    ],
    "status":"pending | success | failed",
    "created_at":"1722317078",
    "expire_at":"1722317078"
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="upi_transaction_id" type="string" required>
  The unique identifier of the transaction across all entities in UPI created by the originator. In payments, the lifecycle starts from CL, so it is mandatory for the originator to create it. All further actions regarding this payment will be done using this 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>

## Request Parameters

<ParamField body="device" type="object" required>
  The device details.
</ParamField>

<ParamField body="geocode" type="string">
  The location coordinates of the device.
</ParamField>

<ParamField body="ip" type="string">
  The IP address of the device.
</ParamField>

<ParamField body="upi_credentials" type="object" required>
  Encrypted credentials as created by NPCI.
</ParamField>

## Response Parameters

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

<ResponseField name="upi_transaction_id" type="string">
  The unique identifier of the transaction across all entities in UPI created by the originator. In payments, the lifecycle starts from CL, so it is mandatory for the originator to create it. All further actions regarding this payment will be done using this 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>
</ResponseField>

<ResponseField name="reference_id" type="string">
  Indicates the transaction ID used by merchants for their reference. It is used at the business level and not in the UPI ecosystem. This value should be alphanumeric and between 1 and 35 characters.
</ResponseField>

<ResponseField name="upi_customer_reference_number" type="string">
  Indicates the UPI customer reference number. This is present in bank account statements as UTR. Additionally, this ID is shared with customers on TPAPs.
</ResponseField>

<ResponseField name="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.
</ResponseField>

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

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

<ResponseField name="upi_initiation_mode" type="enum">
  Indicates the 2-digit code defined by NPCI present in the intent URL or QR codes. 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.
</ResponseField>

<ResponseField name="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
</ResponseField>

<ResponseField name="currency" type="string">
  The currency of the amount. Here, it is `INR`.
</ResponseField>

<ResponseField name="amount" type="integer">
  The amount in paise.
</ResponseField>

<ResponseField name="type" type="string">
  The type of the payment. Possible values:

  * `pay`
  * `collect`
</ResponseField>

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

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

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

<ResponseField name="fundsource" type="object">
  The payer's payment source details.
</ResponseField>

<ResponseField name="ifsc" type="string">
  The IFSC of the payment source.
</ResponseField>

<ResponseField name="masked_account_number" type="string">
  The masked account number of the payment source.
</ResponseField>

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

<ResponseField name="upi_response_code" type="string">
  The response code issued by NPCI to the payer.
</ResponseField>

<ResponseField name="upi_reversal_response_code" type="string">
  The reversal response code issued by NPCI to the payer. This is an optional parameter received as a response.
</ResponseField>

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

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

<ResponseField name="fundsource" type="object">
  The payer's payment source details.
</ResponseField>

<ResponseField name="ifsc" type="string">
  The IFSC of the payment source.
</ResponseField>

<ResponseField name="masked_account_number" type="string">
  The masked account number of the payment source.
</ResponseField>

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

<ResponseField name="upi_response_code" type="string">
  The response code issued by NPCI to the payee.
</ResponseField>

<ResponseField name="upi_reversal_response_code" type="string">
  The reversal response code issued by NPCI to the payee. This is an optional parameter received as a response.
</ResponseField>

<ResponseField name="status" type="string">
  The status of the payment. Possible values:

  * `created`
  * `initiated`
  * `pending`
  * `success`
  * `failed`
</ResponseField>

<ResponseField name="created_at" type="integer">
  The UNIX timestamp of the payment creation.
</ResponseField>

<ResponseField name="expire_at" type="integer">
  The UNIX timestamp of the collect request.
</ResponseField>
