Accept Payments via UPI
Integrate with Pine Labs Online UPI payments for instant bank-to-bank transfers.
Overview
Unified Payments Interface [UPI] is India's most popular payment method with billions of monthly transactions. Pine Labs Online supports all major UPI flows — Collect, Intent, and QR — so your customers can pay instantly from any UPI app.
Pine Labs Online UPI Payment is available in both Hosted Checkout and Custom Checkout. Get configured for the UPI payment method by our Integrations Team.
Integration Steps remain the same for the Hosted Checkout Flow. Follow the below steps for Custom Checkout Flow.
Prerequisites: Create a Pine Labs Online Account
Before integrating with Pine Labs Online, you must create a Pine Labs Online Account.
- To create an Account SignUp Here.
- Fill in the contact details to proceed with the registration process.
- Verify your email address.
- Login to Pine Labs Online Dashboard.
Integration Steps
Follow the below steps to integrate with Pine Labs Online UPI payments.
- Generate Token
- Create Order
- Create Payment
- Intent
- Collect
- QR
- Handle Callbacks
1. Generate Token
Pine Labs Online payment APIs use bearer tokens to authenticate. Use this API to generate an access token from your backend.
Below are the sample request and sample response
--url https://pluraluat.v2.pinepg.in/api/auth/v1/token \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--data '
{
"client_id": "a17ce30e-f88e-4f81-ada1-c3b4909ed232",
"client_secret": "fgwei7egyhuggwp39w8rh",
"grant_type": "client_credentials"
}
'
Sample Response
{
"access\_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5c",
"expires\_in": 3600
}
Note: Use the `access_token` received to authenticate Pine Labs Online payments APIs.
2. Create Order
To create an Order, use our Create Order API, for authentication use the generated access token in the headers of the API request.
Below are the sample request and response
curl --location 'https://pluraluat.v2.pinepg.in/api/pay/v1/orders' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--header 'accept: application/json' \
--data '
{
"merchant_order_reference":112345,
"order_amount":{
"value":1100,
"currency":"INR"
},
"pre_auth":false,
"allowed_payment_methods":[
"CARD",
"UPI",
"NETBANKING",
"POINTS",
"WALLET"
],
"notes":"order1",
"callback_url":"https://sample-callback-url",
"failure_callback_url": "https://sample-failure-callback-url",
"purchase_details":{
"customer":{
"email_id":"kevin.bob@example.com",
"first_name":"Kevin",
"last_name":"Bob",
"customer_id":"123456",
"mobile_number":"9876543210",
"country_code": "91",
"billing_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",,
"full_name": "Kevin Bob",
"adddress_type": "Home",
"address_category": "billing"
},
"shipping_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",,
"full_name": "Kevin Bob",
"adddress_type": "Home",
"address_category": "shipping"
}
},
"merchant_metadata":{
"key1":"DD",
"key2":"XOF"
}
}
}
'
Sample Response
{
"data": {
"order_id": "v1-4405071524-aa-qlAtAf",
"merchant_order_reference": "112345",
"type": "CHARGE",
"status": "CREATED",
"merchant_id": "104359",
"order_amount": {
"value": 1100,
"currency": "INR"
},
"pre_auth": false,
"allowed_payment_methods": [
"CARD",
"UPI",
"NETBANKING",
"POINTS",
"WALLET"
],
"notes": "order1",
"callback_url": "https://sample-callback-url",
"failure_callback_url": "https://sample-failure-callback-url",
"purchase_details": {
"customer": {
"email_id": "kevin.bob@example.com",
"first_name": "Kevin",
"last_name": "Bob",
"customer_id": "123456",
"mobile_number": "9876543210",
"country_code": "91",
"billing_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full_name": "Kevin Bob",
"adddress_type": "Home",
"address_category": "billing"
},
"shipping_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full_name": "Kevin Bob",
"adddress_type": "Home",
"address_category": "shipping"
}
},
"merchant_metadata": {
"key1": "DD",
"key2": "XOF"
}
},
"payments": [],
"created_at": "2024-07-15T05:44:51.174Z",
"updated_at": "2024-07-15T05:44:51.174Z"
}
}
3. Create Payment
To create a payment, use our Create Payment API, use the order_id returned in the response of a Create Order API to link the payment against an order.
3.1. Intent
Below are the sample requests and response
\--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5c' \\
\--header 'Content-Type: application/json' \\
\--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \\
\--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \\
\--header 'accept: application/json' \\
\--data '
{
"payments": \[
{
"merchant\_payment\_reference": "008cf04b-a770-4777-854e-b1e6c1230609",
"payment\_method": "UPI",
"payment\_amount": {
"value": 1100,
"currency": "INR"
},
"payment\_option": {
"upi\_details": {
"txn\_mode": "INTENT"
}
}
}
\]
}
'
Sample Response
{
"data": {
"order\_id": "v1-240820090251-aa-xwuI7J",
"merchant\_order\_reference": "8200c7f7-4490-4970-b6bb-40ffa05d47e5",
"type": "CHARGE",
"status": "PENDING",
"challenge\_url": "upi://pay?mode=04\&pa=pinelabs.24092@hdfcbank\&pn=Pine%20Test\&mc=6012\&cu=INR\&am=1.00\&tr=68706\&tn=Payment%20for%20v1",
"merchant\_id": "110047",
"order\_amount": {
"value": 100,
"currency": "INR"
},
"pre\_auth": false,
"allowed\_payment\_methods": \[
"CARD",
"UPI",
"NETBANKING",
"POINTS",
"WALLET"
\],
"notes": "order1",
"callback\_url": "https://sample-callback-url",
"failure\_callback\_url": "https://sample-failure-callback-url",
"purchase\_details": {
"customer": {
"email\_id": "kevin.bob@example.com",
"first\_name": "Kevin",
"last\_name": "Bob",
"customer\_id": "192212",
"mobile\_number": "9876543210",
"country\_code": "91",
"billing\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "billing"
},
"shipping\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "shipping"
}
},
"merchant\_metadata": {
"key1": "DD",
"key2": "XOF"
}
},
"payments": \[
{
"id": "v1-240820090251-aa-xwuI7J-up-6",
"merchant\_payment\_reference": "008cf04b-a770-4777-854e-b1e6c1230609",
"status": "PENDING",
"payment\_amount": {
"value": 100,
"currency": "INR"
},
"payment\_method": "UPI",
"payment\_option": {
"upi\_details": {
"txn\_mode": "INTENT"
}
},
"acquirer\_data": {
"approval\_code": "",
"acquirer\_reference": "",
"rrn": "",
"is\_aggregator": true
},
"created\_at": "2024-08-20T09:02:51.265Z",
"updated\_at": "2024-08-20T09:03:01.208Z"
}
\],
"created\_at": "2024-08-20T09:02:51.265Z",
"updated\_at": "2024-08-20T09:03:01.208Z"
}
}
3.2. Collect
Below are the sample requests and response
curl \--location 'https://pluraluat.v2.pinepg.in/api/pay/v1/orders/{order\_id}/payments' \\
\--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5c' \\
\--header 'Content-Type: application/json' \\
\--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \\
\--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \\
\--header 'accept: application/json' \\
\--data '
{
"payments": \[
{
"merchant\_payment\_reference": "008cf04b-a770-4777-854e-b1e6c1230609",
"payment\_method": "UPI",
"payment\_amount": {
"value": 100,
"currency": "INR"
},
"payment\_option": {
"upi\_details": {
"txn\_mode": "COLLECT",
"payer": {
"vpa": "kevin.bob@examplebank.com"
}
}
}
}
\]
}
'
Sample Response
{
"data": {
"order\_id": "v1-240820090251-aa-xwuI7J",
"merchant\_order\_reference": "8200c7f7-4490-4970-b6bb-40ffa05d47e5",
"type": "CHARGE",
"status": "PENDING",
"challenge\_url": "upi://pay?mode=04\&pa=pinelabs.24092@hdfcbank\&pn=Pine%20Test\&mc=6012\&cu=INR\&am=1.00\&tr=68706\&tn=Payment%20for%20v1",
"merchant\_id": "110047",
"order\_amount": {
"value": 100,
"currency": "INR"
},
"pre\_auth": false,
"allowed\_payment\_methods": \[
"CARD",
"UPI",
"NETBANKING",
"POINTS",
"WALLET"
\],
"notes": "order1",
"callback\_url": "https://sample-callback-url",
"failure\_callback\_url": "https://sample-failure-callback-url",
"purchase\_details": {
"customer": {
"email\_id": "kevin.bob@example.com",
"first\_name": "Kevin",
"last\_name": "Bob",
"customer\_id": "192212",
"mobile\_number": "9876543210",
"country\_code": "91",
"billing\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "billing"
},
"shipping\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "shipping"
}
},
"merchant\_metadata": {
"key1": "DD",
"key2": "XOF"
}
},
"payments": \[
{
"id": "v1-240820090251-aa-xwuI7J-up-6",
"merchant\_payment\_reference": "008cf04b-a770-4777-854e-b1e6c1230609",
"status": "PENDING",
"payment\_amount": {
"value": 100,
"currency": "INR"
},
"payment\_method": "UPI",
"payment\_option": {
"upi\_details": {
"txn\_mode": "COLLECT",
"payer": {
"vpa": "kevin.bob@examplebank.com"
}
},
"acquirer\_data": {
"approval\_code": "",
"acquirer\_reference": "",
"rrn": "",
"is\_aggregator": true
},
"created\_at": "2024-08-20T09:02:51.265Z",
"updated\_at": "2024-08-20T09:03:01.208Z"
}
}
\],
"created\_at": "2024-08-20T09:02:51.265Z",
"updated\_at": "2024-08-20T09:03:01.208Z"
}
}
3.3. QR
Below are the sample request and response
curl --location 'https://pluraluat.v2.pinepg.in/api/pay/v1/orders/{order_id}/payments' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--header 'accept: application/json' \
--data '
{
"payments": [
{
"merchant_payment_reference": "008cf04b-a770-4777-854e-b1e6c1230609",
"payment_method": "UPI",
"payment_amount": {
"value": 100,
"currency": "INR"
},
"payment_option": {
"upi_details": {
"txn_mode": "INTENT",
"upi_qr": true
}
}
}
]
}
'
Sample Response
{
"data": {
"order\_id": "v1-250102053141-aa-TRBQR6",
"merchant\_order\_reference": "f5cba4a4-1c46-4b23-b0a8-7fd6b8027f63",
"type": "CHARGE",
"status": "PENDING",
"challenge\_url": "upi://pay?mode=04\&pa=pinelabs.1068@hdfcbank\&pn=Saklani%20Bhai%20Upi\&mc=6012\&cu=INR\&am=1.00\&tr=3562571\&tn=Payment%20for%20v1",
"merchant\_id": "110939",
"order\_amount": {
"value": 100,
"currency": "INR"
},
"pre\_auth": false,
"callback\_url":"https://sample-callback-url",
"failure\_callback\_url": "https://sample-failure-callback-url",
"allowed\_payment\_methods":\[
"CARD",
"UPI",
"NETBANKING",
"POINTS",
"WALLET"
\],
"purchase\_details": {
"customer": {
"email\_id": "aayush.sam@gmail.com",
"first\_name": "joe",
"last\_name": "kumar",
"customer\_id": "192212",
"mobile\_number": "192192883",
"country\_code": "91",
"billing\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",,
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "billing"
},
"shipping\_address": {
"address1": "10 Downing Street Westminster London",
"address2": "Oxford Street Westminster London",
"address3": "Baker Street Westminster London",
"pincode": "51524036",
"city": "Westminster",
"state": "Westminster",
"country": "London",,
"full\_name": "Kevin Bob",
"adddress\_type": "Home",
"address\_category": "shipping"
}
},
"merchant\_metadata": {
"key1": "value1",
"key2": "value2"
}
},
"payments": \[
{
"id": "v1-250102053141-aa-TRBQR6-up-a",
"merchant\_payment\_reference": "2c8f71b3-2eb0-47af-a18a-52699785f153",
"status": "PENDING",
"payment\_amount": {
"value": 100,
"currency": "INR"
},
"payment\_method": "UPI",
"payment\_option": {
"upi\_data": {
"txn\_mode": "INTENT"
}
},
"acquirer\_data": {
"approval\_code": "",
"acquirer\_reference": "",
"rrn": "",
"is\_aggregator": true
},
"created\_at": "2025-01-02T05:32:08.847Z",
"updated\_at": "2025-01-02T05:32:11.798Z"
}
\],
"created\_at": "2025-01-02T05:31:41.687Z",
"updated\_at": "2025-01-02T05:32:11.799Z",
"image\_url": "https://upi-gateway-service-bucket.s3.ap-south-1.amazonaws.com/qr\_images/110939/2025-01-02/3562571.png?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEPb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCmFwLXNvdXRoLTEiRzBFAiEAtxkyw5wTlnnU1YO%2FCCMoce1%2BK1MsaRStLaa8JcSywhcCIBmqqVHbdrmRaaTskcFJ2aQXvMoLWeXBRVcHgNu036P1Kp0FCM%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQABoMMzA1NzE0MjgxODMwIgw%2FI8Yx5QqHlvdZSmUq8QS1o4FILej9eD96%2FSFv7vcS%2BxR8ink0aM5I0JT9TmDzgIZxAm0eszCWY%2BbLzffWlGDdtn806WJN2pieXpDuxOBmchQssqbcOP%2FIk%2BuQ5imve75JNCx7G%2FnVFnbKOYo4ct5LP%2BC5TIzzYxYC4IPid7xgehDKeVcu%2Bcvv03xwoqs19NHfVDqnGZ1lT%2Fqtj1EyP18zd1HqXI5AXGud2FvPqpwmno6%2F11i2JxytTHm%2B%2BhKVgSwYnUqygrOxjfDsb57EEWNwKQmnZ1a4%2BSTfk67PlQ%2FTpCWA61f72yzdFlIJ3ehQTkVI7vyBSX%2FnlyWN0mfI1VB3OhUHiPbjHlAMRKm5dKT6ewujM3q9jbip6a9XUk%2F3JR%2B%2BHxn0ygvGdP3VJhEIlCK7%2FRWmaozqKEKblkDGTokpqdA6ma4SS40GY4KQsWlkHnL8yjtz%2B1BtkToWy5W8S1%2BkpbmFP0Y745gYLE2U2wD3hVVDJdZUYskZjjCmUhbYa%2BiXOpjnWEulK795XKau3B7jovIoexKR%2Fnmw5FzsL9VhSuMsv75QWsqopztCSWWJN9DKaHZQ3asyjEZJj95Xz3H3cV%2FVRmcAxfD9YmtsdJ8EwBT36RJYr8mJo4fJOWswCQWa0NJ7gTzPWMK7aQhzMqDOeDGrzi72R3TQzkxNR7jYxoYggrHtsv%2BFY1XM3rhxn5ayVQ%2FfglQ1VaNmKDNPTK6CUzIILTg2csb%2FS5Xy0LyR2IR4r2S4%2BIqL66dUyRRlPVvXgv6Qv3kSivJ6YafhcSbDZAfxd3%2F%2BUcqVnJh3k7BnRoA5DnMzUtX5oN2SMyXOvwd5TcGVCVDF2AcoQRD%2ByatYMNvJ2LsGOpsBiR4DGjV%2FDkHj1IYcZTEm2STYa5v43ga5J7x%2BUfR9vPxlaYIAMqr4hc9sediH585AP%2FQ8Xfa9ynuZ9j210J6bMvIjycUjwzReD1jo%2B6rcDcOoZRF8tu3sqTjUuGFCDl5H0I5wqJ8XuAY1ZvYIliiA0szPwoazo%2BgRzUZjv7wCEkwk7bvyzSjM0P19SgAJYPewfmbPWabEhk7bWFI%3D\&X-Amz-Algorithm=AWS4-HMAC-SHA256\&X-Amz-Date=20250102T053211Z\&X-Amz-SignedHeaders=host\&X-Amz-Credential=ASIAUOLP5XVTC44HP7KZ%2F20250102%2Fap-south-1%2Fs3%2Faws4\_request\&X-Amz-Expires=1200\&X-Amz-Signature=39ab101fb90f02314fdcf32d9786b2c78484dc729b80b186e84250400612933f",
"integration\_mode": "SEAMLESS"
}
}
4. Handle Callback
In the response of our Create Order API, a redirect_url is returned. Use this URL to redirect your customers to the Pine Labs - infinity checkout page to accept payment.
4.1. Store Payment Details on Your Server
On a successful and failed payment we return the following fields to the return url.
- We recommend you to store the payment details on your server.
- You must validate the authenticity of the payment details returned. You can authenticate by verifying the signature.
####Success Callback
{
"order\_id": "v1-4405071524-aa-qlAtAf",
"status": "AUTHORIZED",
"signature": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
}
Failure Callback
{
"order\_id": "v1-4405071524-aa-qlAtAf",
"status": "AUTHORIZED",
"error\_code": "USER\_AUTHENTICATION\_REQUIRED",
"error\_message": "Consumer Authentication Required",
"signature": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
}
4.2. Verify Payment Signature
Ensure you follow this as a mandatory step to verify the authenticity of the details returned to the checkout form for successful payments.
Follow the below steps to verify the signature.
- Create a signature on your server using the following parameters using the SHA256 algorithm.
- order_id: Unique Identifier generated for an order request on Pine Labs database.
- payment_status: Payment status.
- error_code: Short code for the error returned.
- error_message: Corresponding error message for the code.
- secret_key: The Onboarding team has provided you with this information as part of the onboarding process.
If the signature generated on your server matches the Pine Labs signature returned in the return URL, it confirms that the payment details are from Pine Labs.
5. Go Live
Before switching from UAT to production:
- Verify your merchant account — complete KYC verification in the Dashboard
- Switch base URL — replace pluraluat.v2.pinepg.in with api.pluralonline.com
- Update credentials — use production Client ID and Client Secret
- Configure production webhooks — point to your live server
- Test on production — make a small real payment and refund it
- Set up signature verification — mandatory for all callbacks
- Enable TLS 1.2+ — required for all API communication
