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

# E-Way Bills

> Generate GST e-way bills for your documents and download their PDFs.

An e-way bill is the GST transport document required for moving goods. In the Swipe API, an e-way bill is generated **for an existing document** — create the invoice first, then request its e-way bill with the transport details.

## Before you start

<Steps>
  <Step title="Enable the plan">
    E-way bill APIs need the **E-Invoices & EwayBills plan** on your account.
    Mail [api@getswipe.in](mailto:api@getswipe.in) for a trial and integration support.
  </Step>

  <Step title="Connect to the e-way bill portal">
    Open [E-way bills in your dashboard](https://app.getswipe.in/ewaybills) and click
    **Connect to E-way Bill Portal**.
  </Step>

  <Step title="Know which government portal you're on">
    By default the API points to the **Government sandbox portal** — generated
    bills aren't legally valid until you switch. Mail
    [api@getswipe.in](mailto:api@getswipe.in) to connect to the production portal.
  </Step>
</Steps>

## Generate an e-way bill

Call [`POST /v2/ewaybill/{doc_hash_id}`](/api-reference/ewaybill/create-eway-bill) with the document's `hash_id` (from [document creation](/api-reference/document-v2/create-a-document)) and the transport details. The required fields are `supply_type`, `sub_supply_type`, `transport_mode`, `transporter_doc_date`, and the `dispatch_from` / `dispatch_to` addresses; vehicle and transporter details complete the bill:

```bash theme={null}
curl --request POST \
  --url https://app.getswipe.in/api/partner/v2/ewaybill/PUlgCNPb \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "supply_type": "Outward",
    "sub_supply_type": "Supply",
    "transport_mode": "Road",
    "vehicle_number": "KA01AB1234",
    "transporter_doc_date": "26-08-2026",
    "dispatch_from": { },
    "dispatch_to": { }
  }'
```

Errors from the government portal are passed through as `PORTAL_ERROR_{code}` — see [Error codes](/api-reference/error-codes) for how to look them up.

## Download the PDF

[`GET /v2/ewaybill/pdf/{doc_hash_id}`](/api-reference/ewaybill/get-ewaybill-pdf) returns the e-way bill PDF for the same `doc_hash_id`.

<Frame caption="A generated e-way bill PDF">
  <img src="https://vx-erp-resources.s3.ap-south-1.amazonaws.com/1742535622-Screenshot_2025-03-21_at_11.png" alt="E-way bill PDF example" />
</Frame>

## Endpoints

<CardGroup cols={2}>
  <Card title="Create Eway Bill" icon="plus" href="/api-reference/ewaybill/create-eway-bill">
    Generate an e-way bill for a document.
  </Card>

  <Card title="Get EwayBill PDF" icon="file-pdf" href="/api-reference/ewaybill/get-ewaybill-pdf">
    Download the e-way bill PDF.
  </Card>
</CardGroup>
