> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Dual-IRP routing

> Route e-Invoice and E-Way Bill API requests to NIC1 or NIC2 with x-source and x-proxy.

The e-Invoice and E-Way Bill APIs support NIC1 and NIC2. Two optional headers control which session and server a request uses.

## x-source

`x-source` selects the NIC server when you authenticate. On later requests, it selects that server's stored session.

| Value | Server |
| :- | :- |
| `primary` | NIC1 |
| `secondary` | NIC2 |

If omitted, `x-source` defaults to `primary` on each request. Authenticating with NIC2 does not change this default.

A request with `x-source: secondary` needs an existing NIC2 session for the same workspace and GSTIN. Changing the header does not create a session.

## x-proxy

`x-proxy` sends the request to the other NIC server with the session selected by `x-source`. If omitted, the request goes to the server selected by `x-source`.

It accepts `primary` or `secondary` and must differ from `x-source`. An invalid or matching value returns HTTP 422 with `Invalid x-proxy`.

## Examples

Each example requires the session shown below for the same workspace and GSTIN.

| `x-source` | `x-proxy` | Required session | Destination |
| :- | :- | :- | :- |
| Omitted or `primary` | Omitted | NIC1 | NIC1 |
| `secondary` | Omitted | NIC2 | NIC2 |
| Omitted or `primary` | `secondary` | NIC1 | NIC2 |
| `secondary` | `primary` | NIC2 | NIC1 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.