Skip to main content


This document describes integration of a channel (like payment gateways) with BharatX using the standard approach where the payment gateway can take advantage of the BharatX's white-labelled user journey by redirecting the customer to our platform if they opt to use Pay In 3 option offered.

Integration Workflow#

Onboarding a merchant#

The Payment Gateway needs to onboard a merchant to BharatX before creating transactions for the merchant. Payment gateways can follow these steps to get a merchant onboarded:

  1. Create a new merchant using Create a Merchant API.
  2. Upload KYC documents for a merchant using Upload KYC for merchant API.

Once a merchant is created, the payment gateway can fetch authentication information for transactional APIs using Get a merchant API.

Processing transactions for a merchant#

Before showing the BharatX powered Pay-in-3 option to the user, the payment gateway needs to:

  1. Call the Create new transaction API and push all the relevant data for the preapproval check to be performed.
  2. Fetch the preapproval check result using the Get transaction with preapproval check API.
  3. If the transaction is pre-approved then the payment gateway can display the Pay In 3 option to the user.

If the user opts to use the Pay in 3 option, then:

  1. The payment gateway can redirect the customer to the uri (transaction.uri) obtained either in the response of Create new transaction API or Get Transaction API.
  2. Once the user completes the transaction, the user is redirected to the createConfiguration.successRedirectUrl supplied by the payment gateway while creating the transaction.
  3. Payment gateway can further verify the status of the transaction by either polling the Get Transaction API or using the webhook event received to the url configured in the dashboard or while creating the transaction using the createConfiguration.webhookUrl parameter.

In case a transaction needs to be refunded:

  1. The payment gateway can call the Create a refund API. Partial refunds are supported as well.
  2. The payment gateway can get the status of the refund either via Get a refund API or by subscribing to webhook events.


We support configuration of a webhook uri for subscribing to various status change events. A default webhook can be configured while onboarding (both PG onboarding and merchant onboarding). Apart from this, entity level webhooks can be configured using the createConfiguration.webhookUrl parameter in the subsequent Create APIs.

The payloads for various events are described under Webhooks section.