e-Way Bill Cancellation API

Cancel a previously-generated e-Way Bill within the 24-hour window. Returns the cancellation acknowledgment from NIC.

Get sandbox keys → View OpenAPI docs Talk to sales

What is the e-Way Bill Cancellation API?

The e-Way Bill Cancellation API submits a cancellation request to NIC for a previously-generated EWB. NIC permits cancellation within 24 hours of generation, provided the consignment has not already been verified by tax authorities at a checkpoint.

The API takes the EWB number and a cancellation reason (NIC codes: 1=Duplicate, 2=Order Cancelled, 3=Data Entry Mistake, 4=Others). Cancellation eligibility is checked before submission and a clear error is returned if outside the window or if the EWB has been verified.

Quick spec

Code examples

curl Node.jsPythonJava
curl -X POST 'https://apisandbox.whitebooks.in/eway/api/v1/eway/cancel' \
  -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/cancel', {
  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/cancel',
    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/cancel"))
    .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 cancellation window?

24 hours from EWB generation, provided the goods haven't been verified at a checkpoint.

How do I check if an EWB is cancellable?

GET /api/v1/eway/{ewb_no}/status returns is_cancellable + reason if not.

What if cancellation fails because of verification?

API returns HTTP 409 with reason=goods_verified. Goods movement must complete normally — no cancellation possible.

Can I cancel a Part-B-only update?

Part-B updates are not separately cancellable; cancelling the EWB cancels the full record.

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 Generation API → Part-B Update API → e-Way Bill Validity Extension API → Consolidated e-Way Bill API →