# Sales E-Invoices: Create & Generate

To e-invoice a sale, create a **draft** in Octa, then **generate** its IRN on the E-Invoice Portal. Drafts are listed in
**Pending**, under **Sales E-Invoices** in the E-Invoicing & E-Waybills module's sidebar.

Set up the GSTIN first: see [Configuration](/octa/docs/app/einvoicing/setup/configuration). To learn the rules, see
[About E-Invoicing](/octa/docs/app/einvoicing/introduction/einvoicing).

## Create Drafts

### Import

Most businesses import their invoices from their ERP:

1. Click **Import** and choose a format:
   - **Octa E-Invoice (Light)**: a simple template with the fields most invoices need;
   - **Octa E-Invoice (Full)**: every field of the e-invoice, such as export, payment and reference details;
   - **Govt Excel**: the Excel file of the E-Invoice Portal's offline tool, for one GSTIN;
   - **Govt JSON**: the JSON file of the E-Invoice Portal's format.
2. Click **Download Template** for the Octa formats, fill it in, and choose your file.
3. Octa checks every row and lists the errors. Fix them in your file and choose it again, then click **Import**.

Rows without supplier details take them from the branch's or GSTIN's e-invoice details.

### Add

Click **Add** to enter an invoice by hand:

- **Document**: the GSTIN, branch, supply type (B2B, SEZ, export, deemed export, B2C), document type, number and date,
  reverse charge, and the e-commerce operator, if any.
- **From** and **To**: the supplier (filled from the GSTIN's or branch's e-invoice details), the customer (pick one, or
  enter the details), and where different, the dispatch-from and ship-to addresses.
- **Items**: pick an item, or enter the description, HSN, quantity, unit, price, discount and GST rate. Octa works out
  the taxable value, taxes and total.
- **Details**, where needed: export details, e-way bill details (transport), payment details, the preceding document,
  references and the billing period.

Octa checks every field against the E-Invoice Portal's rules when you save. **Save & Generate** saves the draft and
generates its IRN at once.

Click **Check GSTIN** to check a customer's GSTIN on the GST Portal before you invoice.

## Generate

1. Tick the drafts, or select all the drafts that match the filters.
2. Click **Generate** and choose:
   - **Online**: Octa sends the drafts to the E-Invoice Portal and saves the signed e-invoices;
   - **Offline**: Octa makes a JSON file of the drafts, to upload on the E-Invoice Portal yourself.
3. Leave **Check every field before generating** ticked to have Octa check the drafts first.

Online, Octa shows the progress one draft at a time, with the portal's message for each one that fails. Generated
e-invoices move to **Published**. Correct the failed drafts (click **Edit**) and generate them again.

Offline, upload the JSON file on the E-Invoice Portal, download the signed file it returns, and add it to Octa with
**Import** on the Published page.

For a B2C invoice, **Generate** makes its payment QR code from the GSTIN's UPI details.

{/* SCREENSHOT: einvoicing/generate: the Generate window with Online and Offline */}

## Other Actions

- **View** and **Print** a draft, to check it before generating.
- **Export** downloads the drafts to Excel.
- **Delete** deletes drafts. Nothing changes on the E-Invoice Portal.