e-Way Bill Generation API

Generate e-Way Bills via the NIC e-Way Bill portal. Returns EWB number, validity period, and Part-B status. Supports interstate + intrastate.

Get sandbox keys → View OpenAPI docs Talk to sales

What is the e-Way Bill Generation API?

The e-Way Bill Generation API submits movement-of-goods details (consignor, consignee, vehicle, document, value) to the NIC e-Way Bill portal and returns the EWB number — a 12-digit identifier valid for the journey. Validity is determined by distance: 1 day per 200km (cargo) or 1 day per 20km (overdimensional cargo).

WhiteBooks processes 30+ Crore e-Way Bills annually across logistics, manufacturing, and retail customers. The API validates payload locally (transporter ID, vehicle number format, distance) before forwarding to NIC, catching ~90% of common rejection causes.

Quick spec

Code examples

curl Node.jsPythonJava
curl -X POST 'https://apisandbox.whitebooks.in/eway/api/v1/eway/generate' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{ /* payload */ }'
Node.js
const res = await fetch('https://apisandbox.whitebooks.in/eway/api/v1/eway/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + accessToken,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(payload),
});
const data = await res.json();
Python
import requests

resp = requests.post(
    'https://apisandbox.whitebooks.in/eway/api/v1/eway/generate',
    headers={'Authorization': f'Bearer {access_token}'},
    json=payload,
)
data = resp.json()
Java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://apisandbox.whitebooks.in/eway/api/v1/eway/generate"))
    .header("Authorization", "Bearer " + accessToken)
    .header("Content-Type", "application/json")
    .post(BodyPublishers.ofString(payload))
    .build();
HttpResponse<String> resp = HttpClient.newHttpClient()
    .send(req, BodyHandlers.ofString());

Integrate in 3 steps

  1. Sign up at accounts.whitebooks.in — sandbox credentials issued instantly, no sales gate.
  2. Make your first call against the sandbox base URL using the code example above. Validate against your local model.
  3. Move to production once your tests pass — switch host to https://api.whitebooks.in/eway. Same payload, same response shape.

Frequently asked questions

What's the e-Way Bill threshold?

INR 50,000 for inter-state movement. Some states have lower thresholds for intrastate. Check /api/v1/eway/threshold/{state} for state-specific values.

How is validity calculated?

1 day per 200 km for normal cargo, 1 day per 20 km for ODC (overdimensional cargo). Returned in the API response as expires_at timestamp.

Can I generate EWB without a vehicle number (Part-A only)?

Yes — POST without vehicle details creates a Part-A EWB. Part-B (vehicle/transporter) can be added later via the Part-B Update API.

How long does p95 take?

p95 < 300ms for standard EWB generation. Higher for ODC due to NIC additional validation.

Explore the full e-Way Bill API

This is one endpoint inside the WhiteBooks e-Way Bill API suite. See the full documentation — every endpoint, every parameter, every error code.

Open the e-Way Bill API page →

Related e-Way Bill API endpoints

e-Way Bill Cancellation API → Part-B Update API → e-Way Bill Validity Extension API → Consolidated e-Way Bill API →