UPI
QP Integration option
This integration option supports the following transaction types:
Payment
Request
Info
Check the supported currencies and countries with your manager.
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
method | object | A section of the payment method. |
type * required |
string | upi |
account * required |
string | A UPI account. |
customer | object | A section of information about your customer. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
email * required |
string | The customer's email address. |
Response
The upi
response section will have parameters copied from the request. Additionally, you'll get the form
parameter to build a form where the customer should be redirected to finalize the payment.
Payout
Request
Send a payout request with the following data:
Parameter | Type | Description |
---|---|---|
method | object | A section of the payment method. |
type * required |
string | upi |
account * required |
string | A UPI account. |
customer | object | A section of information about your customer. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
email * required |
string | The customer's email address. |
address * required |
string | The customer's address. |
phone * required |
string | 10 digits of the customer's phone number without the country code. |
Response
The upi
response section will have parameters copied from the request.
EA Integration option
This integration option supports the following transaction types:
Payment
The payment flow includes the following steps:
- Your customer initiates a payment.
- You send a payment request with the additional required parameters described below.
- The system processes your request.
-
Depending on the submitted parameters, you receive one of the following parameters:
- a deep link to the UPI mobile application, where you should redirect your customer to;
- a QR-code which you should show to your customer.
-
Your customer follows the deep link or scan the QR-code to complete the payment.
- You receive a webhook notification on the payment status, if
notification_url
is submitted in your request.
Info
The deep link received directly in the response or retrieved from the QR-code is valid for 15 minutes only.
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
method | object | A section of the payment method. |
type * required |
string | upi |
account * required |
string | The customer's VPA/UPI account ID. |
customer | object | A section of the customer's details. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
email * required |
string | The customer's email address. |
phone * required |
string | The customer's phone number with the area code. |
additional_data | object | A section of additional transaction parameters. |
browser | object | A section of the customer's browser parameters. |
user_agent * conditionally required |
string | User agent string for the browser. Equals the navigator.userAgent parameter of JavaScript.Required to get a QR-code. If the parameter is not submitted, the system returns a deep link to the UPI mobile application. |
Info
A minimum payment amount is 300 Indian rupees (submitted as 30000
).
Response
The upi
response section have parameters copied from the request.
Additionally, depending on the submitted parameters, the response body contains the following:
- a deep link to the UPI mobile application as a value of the
form. action
parameter; - a base64-encoded PNG-file of the QR-code as a value of the
additional_data.payment_method.qr_code
parameter.
AP Integration option
This integration option supports the following transaction types:
Payment
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
method | object | A section of the payment method. |
type * required |
string | upi |
customer | object | A section of information about the customer. |
email * required |
string | The customer's email address. |
Sample request
curl --location --request POST 'https://api.constantpos.com/beyag/transactions/payments' \
--header 'Authorization: Basic {base-64-encoded Shop ID:Secret key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"request":{
"amount":300,
"currency":"INR",
"description":"your_description",
"test": true,
"tracking_id":"your_unique_number",
"language":"en",
"notification_url":"https://your_notification_url.com",
"return_url":"https://your_return_url.com",
"customer":{
"email": "test@test.com"
},
"method":{
"type": "upi"
}
}
}'
Response
The response additionally contains the upi
section with the parameters of the payment method, and the form
section with the parameters to build a form. Redirect the customer to the built form to finalize the payment.
Sample response
{
"transaction": {
"uid": "d2d123f0-7b63-48fc-1234-30c768fe1234",
"type": "payment",
"status": "pending",
"amount": 300,
"currency": "INR",
"description": "your_description",
"created_at": "2023-04-26T06:50:04Z",
"updated_at": "2023-04-26T06:50:05Z",
"method_type": "upi",
"receipt_url": "https://my.constantpos.com/customer/transactions/d2d123f0-7b63-48fc-1234-30c768fe1234/1bc5bee2ccb03a7616944dd8092778e02f399135f0963d9ea8963c04371acc40?language=en",
"payment": {
"status": "pending",
"gateway_id": 2707,
"message": "Transaction was initialized."
},
"upi": {
"type": "upi"
},
"customer": {
"email": "test@test.com",
"ip": null
},
"message": "Transaction was initialized.",
"tracking_id": "your_unique_number",
"test": true,
"language": "en",
"billing_address": {
"email": "test@test.com"
},
"additional_data": {
"payment_method": {
"type": "alternative"
}
},
"gateway": {
"iframe": false
},
"form": {
"action": "{form_url}",
"method": "GET",
"fields": [
{
"type": "hidden",
"name": "PAY_ID",
"value": "1234567890123456"
},
{
"type": "hidden",
"name": "ORDER_ID",
"value": "d2d123f0-7b63-48fc-1234-30c768fe1234"
},
{
"type": "hidden",
"name": "AMOUNT",
"value": 300
},
{
"type": "hidden",
"name": "CURRENCY_CODE",
"value": "356"
},
{
"type": "hidden",
"name": "CUST_EMAIL",
"value": "test@test.com"
},
{
"type": "hidden",
"name": "RETURN_URL",
"value": "https://api.constantpos.com/beyag/transactions/returns/e5d848535e2d7db10b6c341d238bab8a206dbbba770cde85071f0f83bb30382c/d2d123f0-7b63-48fc-1234-30c768fe1234"
},
{
"type": "hidden",
"name": "HASH",
"value": "C123B3D09E0123D4F130B9B040AB928FC22871C9237FA7CD335DB9B121A45EB4"
}
]
}
}
}
Payment status query
Request
If you specify notification_url
in the payment or payout request, Constantpos sends a webhook notification about a transaction status. Please note, it might take some time for Constantpos to get the transaction status confirmation from the payment method provider.
If needed, send a status query request to get the current transaction status.
Response
The response contains the transaction status, a section of the payment method as well as other details related to the transaction according to the description of a transaction status query.
PF Integration Option
This integration option supports the payment transaction:
Payment
Payment flow
- Customer selects UPI as a payment method on the merchant's website and submits their VPA (Virtual Payment Address).
- Merchant sends the payment request to Constantpos.
- Constantpos returns the payment status to the merchant:
pending
orfailed
. - Customer receives a payment confirmation request in their UPI application.
- Customer confirms the payment in their UPI application.
- Constantpos sends a webhook notification with
successful
,failed
orpending
status.
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
method | object | A section of the payment method. |
type * required |
string | upi |
account * required |
string | VPA/UPI ID of the customer. |
customer * required |
object | A section of information about the customer. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
state * required | string (2) | The customer's billing state. Set as the 2 last symbols of the code in the ISO 3166-2 format. |
city * required | string (100) | The customer's billing city. |
zip * required | string | The post code of the customer's billing address. |
address * required | string (100) | The customer's address. |
phone * required |
string (14) | The customer's phone number. |
email * required |
string | The customer's email address. |
Request example
{
"request": {
"amount": 10042,
"currency": "INR",
"description": "description",
"test": false,
"customer": {
"first_name": "John",
"last_name": "Doe",
"state": "KA",
"city": "Bangalore",
"zip": "560002",
"address": "1st Street",
"phone": "17777777777",
"email": "user@example.com"
},
"method": {
"type": "upi",
"account": "1234"
}
}
}
Response
The upi
response section will have the same parameters as in the request.
PFR Integration option
Payment flow
- Customer initiates UPI payment on the merchant's website.
- Merchant sends the payment request to Constantpos
- Constantpos returns a link to the payment page to the merchant.
- The merchant redirects the customer to the payment page.
- The customer enters their VPA ID on the payment page.
- If requested, the customer also enters the confirmation code.
- Constantpos sends a webhook notification to the merchant.
- Constantpos finalizes the transaction
- Constantpos sends email notification about the payment status to the merchant and to the customer if the corresponding options are enabled in the settings.
This integration option supports the payment transaction type:
Payment
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
request | object | |
return_url * required |
string | URL to return the customer to when the transaction is completed. |
method | object | A section of the payment method. |
type * required |
string | upi |
customer * required |
object | A section of information about the customer. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
city | string (100) | The customer's billing city. |
zip | string | The post code of the customer's billing address. |
phone | string (10) | The customer's phone number. |
country | string (3) | The customer's country. If sent, must be IND . |
email * required |
string | The customer's email address. |
Info
The minimal payment amount is 200 Indian rupees. The maximum transaction amount is 99999 Indian rupees. The value in the `amount` field must be specified in minimal currency units. For example, 200 INR must be sent as 20000.
Request example
{
"request": {
"amount": 20000,
"currency": "INR",
"description": "description",
"test": false,
"return_url":"https://your_return_url.com",
"customer": {
"first_name": "John",
"last_name": "Doe",
"city": "Bangalore",
"zip": "560002",
"phone": "177777777",
"email": "user@example.com"
},
"method": {
"type": "upi"
}
}
}
Response
The upi
response section will have parameters copied from a request. Additionally, you'll get the form
parameter to build a form where the customer should be redirected to finalize the payment.
Response example
{
"transaction": {
"uid": "773f2cf2-8c63-9728-b1d8-7817eefb2bc8",
"type": "payment",
"status": "pending",
"amount": 20000,
"currency": "INR",
"description": "description",
"created_at": "2023-07-24T14:34:24Z",
"updated_at": "2023-07-24T14:34:24Z",
"method_type": "upi",
"receipt_url": "https://my.constantpos.com/customer/transactions/e8db4900-500a-46d7-b3fc-9f0068975458/7f20310d5d02582ff3afg3db9c26a67906b0684a9a61dc41f3147f04e1068e79?language=en",
"payment": {
"status": "pending",
"gateway_id": 3031,
"ref_id": "5927ef2093710ce8c65f9e5ee15c41",
"message": "Initialized"
},
"upi": {
"type": "upi"
},
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"city": "Bangalore",
"zip": "560002",
"phone": "177777777",
"ip": null
},
"message": "Initialized",
"test": true,
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"city": "Bangalore",
"zip": "560002",
"phone": "177777777"
},
"additional_data": {
"payment_method": {
"type": "alternative"
}
},
"form": {
"action": "https://pfr.in/v2/executepaymentrequesturl/dejai9db-ef74-4cdc-ba66-197951409a21",
"method": "GET",
"fields": []
}
}
}
II Integration option
Payment flow
- Customer initiates the payment on the merchant's website and selects UPI as a payment method.
- Merchant sends the payment request to Constantpos.
- Constantpos returns a link to the payment page to the merchant.
- The merchant redirects the customer to the payment page.
- The customer completes the payment.
- Constantpos sends a webhook notification to the merchant.
Payment
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
request | object | |
return_url * required |
string | URL to return the customer to when the transaction is completed. |
method | object | A section of the payment method. |
type * required |
string | upi |
account * required |
string | The customer's VPA/UPI account ID. |
customer * required |
object | A section of information about the customer. |
first_name * required |
string | The customer's first name. |
last_name * required |
string | The customer's last name. |
email * required |
string (100) | The customer's email address. |
phone * required |
string (10) | The customer's phone number. |
country | string (2) | The customer's country in the ISO 3166-1 Alpha-2 format. |
city | string(60) | The customer's billing city. |
zip | string | The customer's billing ZIP or postal code. |
address | string(255) | The customer's billing address. |
Request example
{
"request": {
"amount": 20000,
"currency": "INR",
"description": "description",
"test": false,
"return_url": "https://someurl.com",
"customer": {
"first_name": "John",
"last_name": "Doe",
"country": "IN",
"phone": "1770000077",
"email": "user@example.com"
},
"method": {
"type": "upi",
"account": "1234"
}
}
}
Response
The upi
response section will have parameters copied from a request. Additionally, you'll get the form
parameter to build a form where the customer should be redirected to finalize the payment.
Response example
{
"transaction": {
"uid": "9c27d028-7b0e-4ced-9a32-d65a623c07a7",
"type": "payment",
"status": "pending",
"amount": 20000,
"currency": "INR",
"description": "description",
"created_at": "2023-12-22T11:26:59Z",
"updated_at": "2023-12-22T11:27:00Z",
"method_type": "upi",
"receipt_url": "https://my.constantpos.com/customer/transactions/9c27d028-7b0e-4ced-9a32-d65a623c07a7/9567f4ebd9d2d7ca21b07642c236ae7d3eb892fb2c75d972ce431857771e44d8",
"payment": {
"status": "pending",
"gateway_id": 3559,
"message": "Transaction was initialized."
},
"upi": {
"type": "upi"
},
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"country": "IN",
"phone": "17700000777777",
"ip": null
},
"manually_corrected_at": null,
"message": "Transaction was initialized.",
"test": false,
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"country": "IN",
"phone": "17700000777777"
},
"additional_data": {
"payment_method": {
"type": "alternative"
}
},
"gateway": {
"iframe": true
},
"form": {
"action": "payment-url/9c27d028-7b0e-4ced-9a32-d65a623c07a7",
"method": "POST",
"fields": []
}
}
}
GP Integration option
Payment flow
- Customer initiates UPI payment on the merchant's website.
- Merchant sends the payment request to Constantpos
- Constantpos returns a payment link to the merchant.
- The merchant redirects the customer to the payment link that opens in the corresponding application on the customer's device.
- The customer confirms the payment.
- Constantpos sends a webhook notification to the merchant.
Info
This integration option only supports INR
currency.
Payment
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
request | object | |
amount * required |
bigInteger | Transaction amount, must be an integer amount specified in minimal currency units, for example, 50000 (500 rupees). The submitted value must end in 00 . |
return_url * required |
string | URL to return the customer to when the transaction is completed. |
method | object | A section of the payment method. |
type * required |
string | upi |
Request example
{
"request": {
"amount": 20000,
"currency": "INR",
"description": "description",
"test": false,
"return_url": "https://your_return_url.com",
"method": {
"type": "upi"
}
}
}
Response
The upi
response section will have parameters copied from the request. Additionally, you'll get the form
parameter to build a form where the customer should be redirected to finalize the payment.
Response example
{
"transaction": {
"uid": "e9237813-c728-4e1b-9173-cb87648b2a13",
"type": "payment",
"status": "pending",
"amount": 20000,
"currency": "INR",
"description": "description",
"created_at": "2023-12-27T12:19:50Z",
"updated_at": "2023-12-27T12:19:51Z",
"method_type": "upi",
"receipt_url": "https://my.constantpos.com/customer/transactions/e9237813-c728-4e1b-9173-cb87648b2a13/03a18687d5632f35bc743a503b05925640ad5db54ba9baef5d1b7c563163237f",
"payment": {
"status": "pending",
"gateway_id": 3572,
"ref_id": "5R6R5L2023122754950",
"message": "Transaction Initiated Successfully",
"bank_code": "200"
},
"upi": {
"type": "upi"
},
"customer": {
"email": null,
"ip": null
},
"manually_corrected_at": null,
"message": "Transaction Initiated Successfully",
"test": false,
"additional_data": {
"payment_method": {
"type": "alternative"
}
},
"gateway": {
"iframe": true
},
"form": {
"action": "upi://pay?ver=01&mode=15&am=200.00&mam=200.00&cu=INR&pa=payee1@example1&pn=1SHOP&mc=5816&tr=PAYEE1PPTK5eA6QJLxuxMkWQety1eY&mid=PARB6332&msid=WES-4382&mtid=WES-4382&tn=PRB",
"method": "GET",
"fields": [
{
"name": "deep_link",
"value": "upi://pay?ver=01&mode=15&am=200.00&mam=200.00&cu=INR&pa=payee1@example1&pn=1SHOP&mc=5816&tr=PAYEE1PPTK5eA6QJLxuxMkWQety1eY&mid=PARB6332&msid=WES-4382&mtid=WES-4382&tn=PRB"
}
]
}
}
}