---
title: ICB on UPI - Integration Steps
slug: affordability-suite/icb-on-upi/integration-steps
excerpt: >-
  Learn how to integrate the Pine Labs Online ICB on UPI to provide your
  merchants with an Instant Cashback offer for a seamless shopping experience.
hidden: false
sidebar_order: 99
sidebar_label: Integration Steps
metadata:
  title: Integrate Instant Cashback on UPI Payments | Pine Labs Online
  description: >-
    Learn how to integrate ICB on UPI with Pine Labs Online. Follow step-by-step
    API integration instructions, authentication, payment flow, testing, and
    go-live setup.
---
Follow the below steps to integrate with Pine Labs Online ICB on UPI.

1. [[Prerequisite] Generate Token](#generate-token)
2. [ICB Offer Discovery](#offer-discovery)
3. [ICB Offer Validation](#offer-validation)
4. [Validate VPA](#validate-vpa)
5. [Create ICB Order](#create-order)
6. [Create ICB Payment](#create-payment)
7. [Handle Payment](#handle-payment)
   1. [Store Payment Details on Your Server](#store-payment-details)
   2. [Verify Payment Signature](#verify-signature)
8. [Get Order by Order ID](#get-order-by-order-id)

> 📘 Note
>
> - Ensure you store your `client_id` and `client_secret` in your Backend securely.
> - Integrate our APIs on your backend system.
> - We strictly recommend not to call our APIs from the frontend.
> - Failure to adhere to the above guidelines may result in legal implications. In such cases, you will be held responsible for any damage or loss arising from non-compliance.

<h2 id="generate-token">1. [Prerequisite] Generate Token</h2>

Integrate our Generate Token API in your backend servers to generate the access token. Use the token generated to authenticate Pine Labs Online APIs.

Below are the sample requests and response for the Generate Token API.

```curl cURL – UAT
curl --location '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"
}
'
```
```curl cURL – PROD
curl --location 'https://api.pluralpay.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"
}
'
```
```json Sample Response
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "expires_in": 3600
}
```

<GenerateToken />

Refer to our [Generate Token API](/api/authentication/generate-token) documentation to learn more.

<h2 id="offer-discovery">2. ICB Offer Discovery</h2>

Use this API to check the Instant Cashback Offers for a UPI payment.

Below are the sample requests and response for the ICB Offer Discovery API.

```curl cURL – UAT
curl --request POST \
     --url https://pluraluat.v2.pinepg.in/api/affordability/v1/offer/discovery \
     --compressed \
     --header 'Accept-Encoding: gzip' \
     --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 '
{
  "product_details": [
    { "product_code": "SAM_BUNDLE_04", "product_amount": { "currency": "INR", "value": 1000000 } },
    { "product_code": "SAM_BUNDLE_05", "product_amount": { "currency": "INR", "value": 1000000 } },
    { "product_code": "SAM_BUNDLE_06", "product_amount": { "currency": "INR", "value": 1000000 } }
  ],
  "order_amount": { "currency": "INR", "value": 3000000 }
}
'
```
```curl cURL – PROD
curl --request POST \
     --url https://api.pluralpay.in/api/affordability/v1/offer/discovery \
     --compressed \
     --header 'Accept-Encoding: gzip' \
     --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 '
{
  "product_details": [
    { "product_code": "SAM_BUNDLE_04", "product_amount": { "currency": "INR", "value": 1000000 } },
    { "product_code": "SAM_BUNDLE_05", "product_amount": { "currency": "INR", "value": 1000000 } },
    { "product_code": "SAM_BUNDLE_06", "product_amount": { "currency": "INR", "value": 1000000 } }
  ],
  "order_amount": { "currency": "INR", "value": 3000000 }
}
'
```
```json Sample Response
{
  "issuers": [
    {
      "id": "23",
      "name": "INDUSIND CC",
      "issuer_type": "CC_BANK",
      "priority": 1,
      "tenures": [
        {
          "tenure_id": "1",
          "name": "3 Months",
          "tenure_type": "MONTH",
          "tenure_value": 3,
          "issuer_offer_parameters": [
            { "program_type": "BANK_EMI", "offer_id": "1563", "offer_parameter_id": "63813" }
          ],
          "details": [],
          "discount": {},
          "auth_amount": { "currency": "INR", "value": 1200000 },
          "loan_amount": { "currency": "INR", "value": 1200000 },
          "net_payment_amount": { "currency": "INR", "value": 1232139 },
          "monthly_emi_amount": { "currency": "INR", "value": 410713 },
          "total_emi_amount": { "currency": "INR", "value": 1232139 },
          "interest_amount": { "currency": "INR", "value": 32139 },
          "interest_rate_percentage": 16,
          "processing_fee_details": { "amount": { "currency": "INR", "value": 19900 } },
          "emi_type": "STANDARD"
        }
      ],
      "issuer_data": {}
    }
  ]
}
```

Refer to our [ICB Offer Discovery API](/api/affordability-suite/create-offer-discovery-v2) documentation to learn more.

> 📘 Note:
>
> - The **ICB Offer Discovery API** returns the list of available Instant Cashback offers for the selected product.
> - Select the offer that best meets your customer's requirements.
> - Validate the choice by passing the selected tenure to the **ICB Offer Validation API**.

<h2 id="offer-validation">3. ICB Offer Validation</h2>

Use this API for validating the offer which has to be applied.

Below is a sample request and response for the ICB Offer Validation API.

```curl cURL – UAT
curl --request POST \
     --url https://pluraluat.v2.pinepg.in/api/affordability/v1/offer/validate \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "merchant_payment_reference": "$guid",
  "payment_method": "UPI",
  "order_amount": { "value": 500, "currency": "INR" },
  "payment_amount": { "value": 400, "currency": "INR" },
  "payment_option": {
    "upi_details": {
      "txn_mode": "INTENT",
      "payer": { "phone_number": "9868608104", "vpa": "nikhiljha122-1@okhdfcbank" }
    }
  },
  "offer_data": {
    "offer_details": {
      "tenure": {
        "offer_ranking": 1,
        "issuer_offer_parameters": [
          { "program_type": "BRAND_EMI", "offer_id": "6040", "offer_parameter_id": "v1-37-10-7-1-6040-287177" }
        ],
        "details": [
          {
            "product_code": "ICB_BOSCH_001",
            "brand_id": "7",
            "product_offer_parameters": [
              { "program_type": "BRAND_OFFER", "offer_id": "6040", "offer_parameter_id": "v1-37-10-7-2-6040-287177" }
            ],
            "product_amount": { "currency": "INR", "value": 500 },
            "interest_rate": 0,
            "discount": {
              "discount_type": "INSTANT",
              "percentage": 0,
              "amount": { "currency": "INR", "value": 100 }
            }
          }
        ],
        "discount": { "discount_type": "INSTANT", "percentage": 0, "amount": { "currency": "INR", "value": 100 } },
        "loan_amount": { "currency": "INR", "value": 400 },
        "auth_amount": { "currency": "INR", "value": 400 },
        "total_discount_amount": { "currency": "INR", "value": 100 },
        "net_payment_amount": { "currency": "INR", "value": 500 },
        "interest_rate_percentage": 0,
        "emi_type": "STANDARD",
        "is_mobile_number_required_for_eligibility": true,
        "is_offer_auto_applied": true
      }
    }
  }
}
'
```
```curl cURL – PROD
curl --request POST \
     --url https://api.pluralpay.in/api/affordability/v1/offer/validate \
     --compressed \
     --header 'Accept-Encoding: gzip' \
     --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_payment_reference": "{{$guid}}",
  "payment_method": "UPI",
  "order_amount": { "value": 500, "currency": "INR" },
  "payment_amount": { "value": 400, "currency": "INR" },
  "payment_option": {
    "upi_details": {
      "txn_mode": "INTENT",
      "payer": { "phone_number": "9868608104", "vpa": "nikhiljha122-1@okhdfcbank" }
    }
  }
}
'
```
```json Sample Response
{
  "code": "ELIGIBLE",
  "message": "Offer is Eligible"
}
```

Refer to our [ICB Offer Validation API](/api/affordability-suite/offer-validation-create) documentation to learn more.

<h2 id="validate-vpa">4. Validate VPA</h2>

Use this API to validate the VPA handle of your customer with the registered VPA handle.

Below are the sample requests and response for Validate VPA API.

```curl cURL – UAT
curl --location 'https://pluraluat.v2.pinepg.in/payment-option' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Merchant-ID: {merchantId}' \
--header 'Correlation-ID: {correlationId}' \
--header 'Authorization: Bearer ' \
--data '{
  "payment_option": {
    "upi_details": {
      "payer": { "fetch_vpa": true, "phone_number": "{{phone-number}}" }
    }
  },
  "payment_method": "UPI"
}'
```
```curl cURL – PROD
curl --location 'https://api.pluralpay.in/payment-option' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Merchant-ID: {merchantId}' \
--header 'Correlation-ID: {correlationId}' \
--header 'Authorization: Bearer ' \
--data '{
  "payment_option": {
    "upi_details": {
      "payer": { "fetch_vpa": true, "phone_number": "{{phone-number}}" }
    }
  },
  "payment_method": "UPI"
}'
```
```json Sample Response
{
  "payment_method": "UPI",
  "is_eligible": false,
  "payment_option_metadata": {
    "upi_payment_option_data": {
      "fetched_vpa": "{{vpa}}"
    }
  }
}
```

Refer to our [Validate VPA API](/api/payment-option/get-payment-option) documentation to learn more.

<h2 id="create-order">5. Create ICB Order</h2>

To create an ICB Order, use our Create ICB Order API, for authentication use the generated access token in the headers of the API request.

Below are the sample requests and response for a Create ICB Order API.

```curl cURL – UAT
curl --request POST \
     --url 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": "{{$guid}}",
  "order_amount": { "value": 1000000, "currency": "INR" },
  "pre_auth": false,
  "callback_url": "https://www.google.com/",
  "failure_callback_url": "https://www.chatgpt.com",
  "purchase_details": {
    "account_details": {
      "bank_details": { "account_number": "41620100006421", "ifsc_code": "", "bank_name": "" }
    },
    "customer": {
      "email_id": "aayush1.sam@gmail.com",
      "first_name": "joe",
      "last_name": "kumar",
      "mobile_number": "9868608104",
      "billing_address": {
        "address1": "H.No 15, Sector 17", "address2": "", "address3": "",
        "pincode": "61232112", "city": "CHANDIGARH", "state": "PUNJAB", "country": "INDIA"
      },
      "shipping_address": {
        "address1": "H.No 15, Sector 17", "address2": "string", "address3": "string",
        "pincode": "144001123", "city": "CHANDIGARH", "state": "PUNJAB", "country": "INDIA"
      }
    },
    "merchant_metadata": { "key1": "", "key2": "" }
  }
}
'
```
```curl cURL – PROD
curl --request POST \
     --url https://api.pluralpay.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": "{{$guid}}",
  "order_amount": { "value": 1000000, "currency": "INR" },
  "pre_auth": false,
  "callback_url": "https://www.google.com/",
  "failure_callback_url": "https://www.chatgpt.com",
  "purchase_details": {
    "customer": {
      "email_id": "aayush1.sam@gmail.com",
      "first_name": "joe",
      "last_name": "kumar",
      "mobile_number": "9868608104"
    }
  }
}
'
```
```json 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", "CREDIT_EMI"],
    "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", "pincode": "51524036",
          "city": "Westminster", "state": "Westminster", "country": "London",
          "full_name": "Kevin Bob", "address_type": "Home", "address_category": "billing"
        },
        "shipping_address": {
          "address1": "10 Downing Street", "pincode": "51524036",
          "city": "Westminster", "state": "Westminster", "country": "London",
          "full_name": "Kevin Bob", "address_type": "Home", "address_category": "shipping"
        }
      }
    },
    "payments": [],
    "created_at": "2024-07-15T05:44:51.174Z",
    "updated_at": "2024-07-15T05:44:51.174Z"
  }
}
```

<CreateOrder />

Refer to our [Create ICB Order API](/api/orders/create-order) documentation to learn more.

<h2 id="create-payment">6. Create ICB Payment</h2>

To create a payment, use our Create ICB Payment API, use the `order_id` returned in the response of a Create ICB Order API to link the payment against an order.

Below are the sample requests and sample response for Create ICB Payment API.

```curl cURL – UAT
curl --request POST \
     --url 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": "{{$guid}}",
      "payment_method": "UPI",
      "payment_amount": { "value": 450, "currency": "INR" },
      "payment_option": {
        "upi_details": {
          "txn_mode": "INTENT",
          "payer": { "phone_number": "9868608104", "vpa": "nikhiljha122-1@okhdfcbank" }
        }
      }
    }
  ]
}
'
```
```curl cURL – PROD
curl --request POST \
     --url https://api.pluralpay.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": "{{$guid}}",
      "payment_method": "UPI",
      "payment_amount": { "value": 450, "currency": "INR" },
      "payment_option": {
        "upi_details": {
          "txn_mode": "INTENT",
          "payer": { "phone_number": "9868608104", "vpa": "nikhiljha122-1@okhdfcbank" }
        }
      }
    }
  ]
}
'
```
```json Sample Response
{
  "data": {
    "order_id": "v1-250124055307-aa-6OZ8sm",
    "status": "PENDING",
    "challenge_url": "https://pluraluat.v2.pinepg.in/web/auth/landing/?token=S50f2FXi%2FYAGe2bLZEW%2FA2VHzXthz0m9igmtsP61ODtY5u4pR6RYB5IlJwK0%2Fuo%2FBs9",
    "merchant_id": "111163",
    "order_amount": { "value": 1600000, "currency": "INR" },
    "integration_mode": "SEAMLESS",
    "payment_retries_remaining": 8
  }
}
```

<CreatePayment />

Refer to our [Create ICB Payment API](/api/affordability-suite/create-payment) documentation to learn more.

<h2 id="handle-payment">7. Handle Payment</h2>

In create ICB payment API response we return a `challenge_url`, use this challenge url to navigate your customers to the checkout page to accept payment.

> 📘 Note:
>
> - On successful payment we send the webhook event `ORDER_PROCESSED` and the status of the payment is updated to `processed`.

<h3 id="store-payment-details">7.1. Store Payment Details on Your Server</h3>

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.

```json Success Callback Response
{
  "order_id": "v1-4405071524-aa-qlAtAf",
  "status": "PROCESSED",
  "signature": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
}
```
```json Failure Callback Response
{
  "order_id": "v1-4405071524-aa-qlAtAf",
  "status": "PROCESSED",
  "error_code": "USER_AUTHENTICATION_REQUIRED",
  "error_message": "Consumer Authentication Required",
  "signature": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
}
```

<h3 id="verify-signature">7.2. Verify Payment Signature</h3>

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.

1. Create a signature on your server using the following parameters using the SHA256 algorithm.
   1. `order_id`: Unique Identifier generated for an order request on Pine Labs Online database.
   2. `payment_status`: Payment status.
   3. `error_code`: Short code for the error returned.
   4. `error_message`: Corresponding error message for the code.
   5. `secret_key`: The Onboarding team has provided you with this information as part of the onboarding process.

Use the below sample code to construct HashMap signature using the SHA256 algorithm.

```java Java
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public class hash {
    public static void main(String[] args) {
        String input = "<string>";
        String secretKey = "<secret_key>";
        String hash = GenerateHash(input, secretKey);
        System.out.println("Generated Hash: " + hash);
    }

    public static String GenerateHash(String input, String strSecretKey) {
        String strHash = "";
        try {
            if (!isValidString(input) || !isValidString(strSecretKey)) {
                return strHash;
            }
            byte[] convertedHashKey = new byte[strSecretKey.length() / 2];
            for (int i = 0; i < strSecretKey.length() / 2; i++) {
                convertedHashKey[i] =
                        (byte) Integer.parseInt(strSecretKey.substring(i * 2, (i * 2) + 2), 16);
            }
            strHash = hmacDigest(input, convertedHashKey, "HmacSHA256");
        } catch (Exception ex) {
            strHash = "";
        }
        return strHash.toUpperCase();
    }

    private static String hmacDigest(String msg, byte[] keyString, String algo) {
        String digest = null;
        try {
            SecretKeySpec key = new SecretKeySpec(keyString, algo);
            Mac mac = Mac.getInstance(algo);
            mac.init(key);
            byte[] bytes = mac.doFinal(msg.getBytes("UTF-8"));
            StringBuilder hash = new StringBuilder();
            for (byte b : bytes) {
                String hex = Integer.toHexString(0xFF & b);
                if (hex.length() == 1) {
                    hash.append('0');
                }
                hash.append(hex);
            }
            digest = hash.toString();
        } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
            // log error
        }
        return digest;
    }

    public static boolean isValidString(String str) {
        return str != null && !"".equals(str.trim());
    }
}
```

> 📘 Note:
>
> To create a request string, format the key-value pairs of data returned to the return URL. The pairs are separated by `&` and arranged in ascending order based on a lexicographical comparison of the keys.

Shown below is an example to create a request string.

```text Success
order_id=random_order_id&status=AUTHORIZED
```
```text Failed
error_code=USER_AUTHENTICATION_FAILED&error_message=Consumer Authentication required&order_id=<order_id>&status=FAILED
```

2. If the signature generated on your server matches the Pine Labs Online signature returned in the return URL, it confirms that the payment details are from Pine Labs Online.
3. Capture the status returned on your database.

<h2 id="get-order-by-order-id">8. Get Order by Order ID</h2>

Use this API to retrieve the order by order ID.

Below are the sample requests and sample response for Get Order by Order ID.

```curl cURL – UAT
curl --request GET \
     --url https://pluraluat.v2.pinepg.in/api/pay/v1/orders/v1-4405071524-aa-qlAtAf \
     --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'
```
```curl cURL – PROD
curl --request GET \
     --url https://api.pluralpay.in/api/pay/v1/orders/v1-4405071524-aa-qlAtAf \
     --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'
```
```json Sample Response
{
  "data": {
    "order_id": "v1-260316101246-aa-AIfoLK",
    "merchant_order_reference": "6ac6e0e6-7e3e-4c1c-9ec7-d83e44142ceb",
    "type": "CHARGE",
    "status": "PROCESSED",
    "merchant_id": "111643",
    "order_amount": { "value": 10000000, "currency": "INR" },
    "pre_auth": false,
    "allowed_payment_methods": ["CARD", "NETBANKING", "CREDIT_EMI", "UPI", "DEBIT_EMI", "BNPL", "CARDLESS_EMI"],
    "purchase_details": {
      "customer": {
        "email_id": "cashlesstechnologies@gmail.com",
        "first_name": "Sourabh",
        "customer_id": "6233",
        "mobile_number": "9044988837",
        "country_code": "91"
      }
    },
    "payments": [],
    "created_at": "2026-03-16T10:12:46.701Z",
    "updated_at": "2026-03-16T10:13:28.441Z",
    "integration_mode": "SEAMLESS"
  }
}
```

<GetOrderByOrderID />

Refer to our [Get Order by Order ID API](/api/orders/get-order-by-id) documentation to learn more.

## To Know Your Payment Status

To check your payment status, you can either rely on Webhook events or use our **Get Orders** APIs for real-time updates.

1. **Webhook Notification**: We send Webhook notifications on the successful payment or any changes to the payments object. Refer to our [Webhooks](/developer-tools/webhooks) documentation to learn more.
2. **Get Orders API**: Use our Get Orders API to know the real time status of the payment. Refer to our [Manage Orders](/api/orders/get-order-by-id) documentation to learn more.
3. **Refunds**: Pine Labs Online processes refund directly to the customer's original payment method to prevent chargebacks. Refer to our [Refunds](/api/refunds/create-refund) documentation to learn more.

<br />
