Recurring

UPI supports recurring payments, and we streamline this process for you with our payment agreements API.

Create the payment agreement

To create an UPI payment agreement, provide the following information when calling our payment agreements API:

Data FieldRequiredDescription
paymentMethodMUPI
consumer.nameMFull name of the consumer.
consumer.countryMThe country from which the consumer is shopping.
authenticationSettings.typeMSupply settings for the support authentication flows:SCAN_CODE, REDIRECT

You can also include the initialPaymentCharge object in this agreement creation call to immediately initiate the first payment without making a separate call. If you include this object, you'll need to specify:

  • The exact amount.value and amount.currency of the first payment

If you don't include an initialPaymentCharge during agreement creation, you'll need to make a separate API call to /v1/payment-agreements/{agreement_id}/payment-charges to create the first charge.

Request

POST /v1/payment-agreements

{
  "paymentMethod": "UPI",
  "consumer": {
    "name": "John Smith",
    "country": "IN"
  },
  "authenticationSettings": [
    {
      "type": "REDIRECT",
      "settings": {
        "returnUrl": "https://www.webshop.com/order-results-page"
      }
    },
    {
      "type": "SCAN_CODE"
    }
  ]
}
{
  "paymentMethod": "UPI",
  "consumer": {
    "name": "John Smith",
    "country": "IN"
  },
  "authenticationSettings": [
    {
      "type": "REDIRECT",
      "settings": {
        "returnUrl": "https://www.webshop.com/order-results-page"
      }
    }
  ],
  "initialPaymentCharge": {
    "amount": {
      "value": 100000,
      "currency": "INR"
    }
  }
}

Response

You'll receive our standard payment charge response with the available authentication methods:

{
  "id": "agr_fQhHOrlnlQzRgAOeYQptX",
  "status": "AUTHENTICATION_PENDING",
  "paymentMethod": "UPI",
  "startDate": "2025-04-15T18:12:17.508Z",
  "instrumentId": "instr_vAWxLY4auTZ0cwBfRpiWE",
  "consumer": {
    "name": "John Smith",
    "country": "IN"
  },
  "authenticationMethods": [
    {
      "details": {
        "requestUrl": "requestUrl": "https://redirection-target.ppro.com",
        "requestMethod": "GET"
      },
      "type": "REDIRECT"
    },
    {
      "details": {
        "codeType": "QR",
        "codeImage": "https://qr.ppro.com/image.png?payload=aWQ9YWJjJmFtb3Vuk9VVNEJmZyb209UVI",
        "codePayload": "upi://open/paymentrequest?amount=100000&currency=INR&from=QR",
        "codeDocument": "cdn.ppro.com//linktocodedocument"
      },
      "type": "SCAN_CODE"
    }
  ],
  "history": [
    {
      "id": "ahist_dpGdN1zoxgHglXtu2PU0y",
      "status": "AUTHENTICATION_PENDING",
      "createdAt": "2025-04-15T18:12:17.592Z"
    }
  ],
  "createdAt": "2025-04-15T18:12:17.592Z",
  "updatedAt": "2025-04-15T18:12:17.592Z"
}
TBC

Pick the desired authentication method

REDIRECT

Redirect your consumer to the returned $.authenticationMethods[?(@.type == "REDIRECT")].details.requestUrl For example, with the value of https://redirection-target.ppro.com/ using the returned $.authenticationMethods[?(@.type == "REDIRECT")].details.requestMethod HTTP method.


SCAN_CODE

  1. Render the QR code using one of the techniques available.
  2. The consumer will scan the QR code to complete the agreement and/or payment.

Handling the result

REDIRECT

  1. After the consumer completes the authentication, they are redirected to the returnUrl specified in the payment charge creation request.
  2. Upon redirect back to your site, retrieve the latest agreement status by performing a GET /v1/payment-agreements/{agreementId}. Use the returned status field to determine and display the final payment outcome to the consumer.
  3. Additionally, webhooks are triggered to notify you of the payment result. This ensures you receive the outcome even if the consumer closes their browser or fails to return to your website.

SCAN_CODE

  1. Check the agreement and/or payment status and use the Status that you received to display the outcome to the consumer.
    GET /v1/payment-agreements/{agreement-id}
    GET /v1/payment-charges/{paymentChargeId}
  2. Webhooks are also sent to inform you of the agreement and/or payment outcome.
  3. Store the Payment Agreement ID for subsequent payments.

Create a recurring payment

To initiate a subsequent recurring payment, send a request against an active agreement using our payment agreements API.

Request

POST /v1/payment-agreements/{agreement-id}/payment-charges

{
  "amount": {
    "value": 100000,
    "currency": "INR"
  }
}

Response

{
  "id": "charge_aOZID0uzh5MqnZmU8PeR8",
  "paymentMethod": "UPI",
  "currency": "INR",
  "country": "IN",
  "instrumentId": "instr_vAWxLY4auTZ0cwBfRpiWE",
  "status": "CAPTURED",
  "consumer": {
    "name": "John Smith",
    "country": "IN"
  },
  "authorizations": [
    {
      "id": "authz_9OzDwsaD25sirhd5J4iJS",
      "amount": 100000,
      "status": "AUTHORIZED",
      "createdAt": "2025-04-15T18:19:12.744Z",
      "updatedAt": "2025-04-15T18:19:12.744Z"
    }
  ],
  "captures": [
    {
      "id": "capture_c0zoJHT0T6eHsMiL57ZbR",
      "amount": 100000,
      "status": "CAPTURED",
      "createdAt": "2025-04-15T18:19:12.744Z",
      "updatedAt": "2025-04-15T18:19:12.744Z"
    }
  ],
  "refunds": [],
  "voids": [],
  "createdAt": "2025-04-15T18:19:12.661Z",
  "updatedAt": "2025-04-15T18:19:12.744Z"
}

Did this page help you?