> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eximpe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# S2S Net Banking Payment

> Accept net banking payments server-to-server with EximPe — get an ACS redirect template directly from your backend

# Introduction

The Server-to-Server (S2S) Net Banking integration lets you initiate net banking payments entirely from your backend. EximPe returns an ACS (Access Control Server) template that you render in the customer's browser, which automatically redirects them to their bank's net banking portal to authorise the payment.

<CardGroup cols={3}>
  <Card title="18+ Banks Supported" icon="university" href="#supported-banks">
    SBI, HDFC, ICICI, Axis, Kotak and many more
  </Card>

  <Card title="ACS Redirect" icon="arrow-right-arrow-left" href="#step-2-render-acs-template">
    Seamlessly redirect customers to their bank's portal via Base64-encoded HTML
  </Card>

  <Card title="Real-time Callbacks" icon="server" href="#step-4-server-to-server-callback">
    Receive instant payment status updates via server-to-server webhooks
  </Card>
</CardGroup>

## Prerequisites

Before you begin, ensure you have:

* **Credentials**: Your Client ID and Client Secret
* **Domain Whitelist**: Whitelisted your website domain in the EximPe dashboard
* **Webhook URL**: A secure endpoint to receive payment status updates
* **Callback URL**: A publicly accessible URL configured in your EximPe dashboard for server-to-server callbacks
* **HTTPS Endpoint**: All S2S endpoints must be served over HTTPS

The following steps allow you to integrate S2S net banking payments:

1. **Initiate payment** with the customer's selected bank code
2. **Render the ACS template** to redirect the customer to their bank
3. **Check payment transaction status**
4. **EximPe sends Server-to-Server callback response**

## Step 1: Initiate Payment

Send a `POST` request to the Create Order endpoint with `collection_mode` set to `"s2s"` and `mop_type` set to `"net_banking"`. Include the customer's chosen bank code in `netbanking_details`.

```bash theme={null}
POST /pg/orders/
```

```json theme={null}
{
  "amount": "1000.00",
  "currency": "INR",
  "reference_id": "S2SNB_REF123",
  "return_url": "https://yoursite.com/payment/callback/",
  "collection_mode": "s2s",
  "mop_type": "net_banking",
  "netbanking_details": {
    "bank_name": "State Bank of India"
  },
  "buyer": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+919876543210",
    "address": {
      "line_1": "123 Main Street",
      "line_2": "Apt 4B",
      "city": "Mumbai",
      "state": "Maharashtra",
      "postal_code": "400001"
    },
    "ip_address": "192.168.1.100",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
  },
  "product": {
    "name": "Sample Product",
    "description": "This is a sample product description",
    "hs_code": "98051000",
    "hs_code_description": "Portable automatic data processing machines",
    "type_of_goods": "physical_goods"
  },
  "invoice": {
    "number": "INV_NB001",
    "date": "2025-09-04"
  }
}
```

<Note>
  Required parameters for S2S Net Banking:

  * `collection_mode`: must be `"s2s"`
  * `mop_type`: must be `"net_banking"`
  * `netbanking_details.bank_name`: name of the selected bank (see [Supported Banks](#supported-banks))
  * `buyer.ip_address`: customer's device IP address (used for fraud prevention)
  * `buyer.user_agent`: customer's browser user-agent string (used for fraud prevention)
</Note>

### Request Headers

```bash theme={null}
X-Client-ID: YOUR_CLIENT_ID
X-Client-Secret: YOUR_CLIENT_SECRET
X-Merchant-ID: YOUR_MERCHANT_ID   # Required for PSP merchants
X-API-Version: 2.0.0
Content-Type: application/json
```

### Response

```json theme={null}
{
  "success": true,
  "message": "S2S Net Banking Payment Request created successfully",
  "data": {
    "order_id": "OD9123456789",
    "acs_template": "PGh0bWw+PGJvZHk+PGZvcm0gbmFtZT0icGF5bWVudF9wb3N0..."
  }
}
```

* `order_id`: Unique order identifier for tracking the transaction
* `acs_template`: Base64-encoded HTML form that redirects the customer to their bank's net banking portal

## Step 2: Render ACS Template

Decode the Base64 `acs_template` and render it in the customer's browser. The embedded form auto-submits and takes the customer directly to their bank's authentication page.

```javascript theme={null}
function handleACSTemplate(acsTemplate) {
  // Decode Base64 HTML
  const decodedHTML = atob(acsTemplate);

  // Open in a new window or write into the current page
  const authWindow = window.open('', 'NetBanking_Auth', 'width=800,height=600');
  authWindow.document.write(decodedHTML);
  authWindow.document.close();

  // Poll for window close (customer completed / cancelled payment)
  const checkClosed = setInterval(() => {
    if (authWindow.closed) {
      clearInterval(checkClosed);
      checkPaymentStatus();
    }
  }, 1000);
}
```

<Warning>
  Always decode and render the ACS template in a secure HTTPS context. Never modify the decoded HTML before rendering — doing so may break the bank redirect.
</Warning>

## Step 3: Check Payment Transaction Status

Use the Order Status API to retrieve the current payment status:

```bash theme={null}
curl -X GET https://api-pacb.eximpe.com/pg/orders/{order_id}/status/ \
  -H "X-Client-ID: YOUR_CLIENT_ID" \
  -H "X-Client-Secret: YOUR_CLIENT_SECRET" \
  -H "X-Merchant-ID: YOUR_MERCHANT_ID" \
  -H "X-API-Version: 2.0.0"
```

<Note>
  For detailed parameters and response formats, see the [Get Order API](/api-reference/v2/order/get)
</Note>

### Payment Status Values

| Status               | Description                            |
| -------------------- | -------------------------------------- |
| `payment_pending`    | Payment initiated, awaiting completion |
| `payment_successful` | Payment completed successfully         |
| `failed`             | Payment failed or was declined         |

## Step 4: Server-to-Server Callback Response

EximPe sends real-time webhook notifications when payment status changes:

```json theme={null}
{
    "event_type": "PAYMENT_SUCCESSFUL",
    "event_time": "2024-02-15 16:53:15",
    "version": "1.0",
    "sequence_number": "e40552bf-ed12-4f35-9a97-162d97e6fa34",
    "data": {
        "utr": null,
        "amount": 1000,
        "status": "CAPTURED",
        "message": "Payment Captured",
        "mop_type": "NET_BANKING",
        "order_id": "OD9123456789",
        "payment_id": "PR6938527534",
        "bank_ref_num": "OD9123456789-PR6938527534",
        "extended_status": "SUCCESS",
        "payment_message": null,
        "subscription_id": null,
        "virtual_account_id": null,
        "payment_completed_at": "2025-06-24T12:30:44.000000Z",
        "merchant_reference_id": "S2SICR1QPJ"
    }
}
```

For more webhook details, see:

* [Payment Successful](/api-reference/v2/webhooks/payment-successful)
* [Payment Failed](/api-reference/v2/webhooks/payment-failed)

## Supported Banks

* Airtel Payments Bank
* Andhra Pragathi Grameena Bank
* AU Small Finance Bank
* Axis Bank
* Axis Bank - Corporate
* Bandhan Bank - Retail Banking
* Bank of Bahrain and Kuwait
* Bank of Baroda - Corporate
* Bank of Baroda - Retail Banking
* Bank of India
* Bank of India - Corporate
* Bank of Maharashtra
* Barclays - Corporate
* Canara Bank
* Capital Small Finance Bank
* Central Bank of India
* City Union Bank
* Cosmos Bank
* CSB Bank Limited
* DBS Bank Ltd
* DCB Bank - Personal
* Deutsche Bank
* Dhanlaxmi Bank
* Dhanlaxmi Bank - Corporate
* Equitas Small Finance Bank
* ESAF Small Finance Bank
* Federal Bank
* Fincare Bank
* Gujarat State Co-operative Bank Limited
* HDFC Bank
* HDFC Corporate
* HSBC Retail NetBanking
* ICICI Bank
* ICICI Bank - Corporate
* IDBI Bank
* IDBI Bank - Corporate
* IDFC FIRST Bank
* Indian Bank
* Indian Overseas Bank
* Indian Overseas Bank - Corporate
* IndusInd Bank
* Jammu and Kashmir Bank
* Jana Small Finance Bank
* Janata Sahakari Bank Ltd Pune
* Kalyan Janata Sahakari Bank
* Karnataka Bank Ltd
* Karnataka Gramin Bank
* Karnataka Vikas Grameena Bank
* Karur Vysya Bank
* Kotak Mahindra Bank
* Maharashtra Gramin Bank
* Mehsana urban Co-op Bank
* NKGSB Co-op Bank
* Nutan Nagarik Sahakari Bank Limited
* Punjab & Sind Bank
* Punjab National Bank - Corporate
* Punjab National Bank - Retail Banking
* RBL Bank
* RBL Bank Limited - Corporate
* Saraswat Bank
* SBM Bank India
* Shamrao Vithal Bank - Corporate
* Shamrao Vithal Co-operative Bank
* Shivalik Small Finance Bank
* South Indian Bank
* Standard Chartered Bank
* State Bank Of India
* State Bank of India - Corporate
* Suryoday Small Finance Bank
* Tamil Nadu State Co-operative Bank
* Tamilnad Mercantile Bank Ltd
* Thane Bharat Sahakari Bank Ltd
* The Kalupur Commercial Co-Operative Bank
* The Surat Peoples Co-operative Bank Ltd
* The Sutex Co-op Bank Ltd
* TJSB Bank
* UCO Bank
* UCO Bank Corporate
* Ujjivan Small Finance Bank
* Union Bank of India
* Union Bank of India - Corporate
* Utkarsh Small Finance Bank
* Varachha Co-operative Bank Limited
* Yes Bank - Corporate
* Yes Bank Ltd
* Zoroastrian Co-Operative Bank Ltd

## Next Steps

* **Go Live**: Switch to production credentials after thorough testing
* **Monitor**: Track success rates and error patterns via your EximPe dashboard

For additional support, see the [API Reference](/api-reference/v2/) or contact our integration team.
