# Submit UTR for Approval

You need to create a 'pay link' to receive fiat payments through Ninjapay UPI payment gateway. A pay link contains <mark style="color:red;">Payment info</mark> added in the dashboard by the merchant(you), capable of accepting payments through the UPI protocol or bank transfers from customers.

#### **Method**

```

POST https://prod.ninjapay.me/uapi/v1/p2p/paymentLink/submitUTR

```

#### **Parameters**

```javascript

Body (application/json)
 {
  utr: string; // Add the 12 digit UTR number after successful UPI payment
  payer_info: string; // "phone" or "email" info of the customer paying.
  callback_url?: string; // Your webhook url for getting response on successuful approval.
  extra?: {} // You can add other extra details like customer name, etc.. here. 
}

```

#### **Response**

```json
{
  "status": <bool>, // true or false
   "data": {
      "tid": "198A60SO23PN99N7",
  },
  "message": <sting>
}
```

### Payment Success Response

Upon successful approval, the Ninjapay platform sends the fiat amount to the provided UPI ID and gives a success response to the **callback\_url**.

#### Callback Response

```json

{
  "tid": string, // The transaction ID for the successful payment.
  "status": int, // approve(1), decline(2)
  "link_id": int, 
  "utr": string, // The utr number of the transaction added by payer or payment gateway.
  "payer_info": string, // The email or phone added by payer when paying.
}
```

#### **Code Example**

{% code overflow="wrap" %}

```javascript

const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'API_KEY'
  },
  body: '{"utr":"11H97837829M","payer_info":"myemailid@gmail.com","callback_url":"https://yourwebhook.com"}'
};

fetch('https://prod.ninjapay.me/uapi/v1/p2p/paymentLink/submitUTR', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  
```

{% endcode %}
