> ## 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.

# Create e-way bill

> Generates an e-way bill for an existing document, identified by its `hash_id`. Requires the transport details: supply type, transport mode, dispatch addresses, and transporter document date. Your account must be connected to the e-way bill portal; portal rejections are returned as `PORTAL_ERROR_{code}`. By default this points to the government sandbox portal.

<Note>
  To create an EwayBill first connect to [EwayBill Portal](https://app.getswipe.in/ewaybills).
</Note>


## OpenAPI

````yaml post /v2/ewaybill/{doc_hash_id}
openapi: 3.0.1
info:
  title: SwipeAPI
  version: '2.0'
  description: >-
    The Swipe Partner API — invoicing, payments, and GST compliance for your
    application. Create GST invoices and other documents, manage customers,
    vendors, products and inventory, record payments, and generate e-invoices
    and e-way bills.


    - Docs & guides: https://developers.getswipe.in

    - Quickstart: https://developers.getswipe.in/quickstart

    - Rate limit: 1 request/second per API key

    - All dates are DD-MM-YYYY
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
paths:
  /v2/ewaybill/{doc_hash_id}:
    parameters:
      - name: doc_hash_id
        in: path
        description: The hash id of the document
        required: true
        schema:
          type: string
    post:
      tags:
        - EwayBill
      summary: Create e-way bill
      description: >-
        Generates an e-way bill for an existing document, identified by its
        `hash_id`. Requires the transport details: supply type, transport mode,
        dispatch addresses, and transporter document date. Your account must be
        connected to the e-way bill portal; portal rejections are returned as
        `PORTAL_ERROR_{code}`. By default this points to the government sandbox
        portal.
      operationId: post_eway_bill
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EwayBillModel'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponseEwayBill'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEwayBill'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEwayBill'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEwayBill'
components:
  schemas:
    EwayBillModel:
      required:
        - dispatch_from
        - dispatch_to
        - sub_supply_type
        - supply_type
        - transport_mode
        - transporter_doc_date
      properties:
        supply_type:
          type: string
          description: Supply Type
          example: Outward
          enum:
            - Outward
            - Inward
        sub_supply_type:
          type: string
          description: Sub Supply Type
          example: Supply
          enum:
            - Supply
            - Export
            - Job Work
            - SKD/CKD/Lots
            - Recipient Not Known
            - For Own Use
            - Job Work Returns
            - Sales Returns
            - Exhibition or fairs
            - Line Sales
            - Others
        transporter_doc_date:
          type: string
          description: DD-MM-YYYY
          example: 05-03-2025
        dispatch_from:
          description: Dispatch From Address
          allOf:
            - $ref: '#/components/schemas/EwayBillAddress'
        dispatch_to:
          description: Dispatch To Address
          allOf:
            - $ref: '#/components/schemas/EwayBillAddress'
        vehicle_type:
          type: string
          description: Vehicle Type
          example: Regular
          enum:
            - Regular
            - Over Dimensional Cargo
        transaction_type:
          type: string
          description: Transaction Type
          example: Regular
          enum:
            - Regular
            - Bill To - Ship To
            - Bill From - Dispatch From
            - Combination of 2 and 3
        transport_mode:
          type: string
          description: Transport Mode
          example: Road
          enum:
            - Road
            - Rail
            - Air
            - Ship or Ship Cum Road/Rail
        ship_to_gstin:
          type: string
          description: >-
            Ship To GSTIN of the consignee, or 'URP' if unregistered. Required
            for 'Bill To - Ship To' and 'Combination of 2 and 3' transaction
            types.
          example: 29ABCDE1234F1Z5
        sub_supply_type_description:
          type: string
          description: Sub Supply Type Description
          example: Supply of goods
        transporter_id:
          type: string
          description: Transporter ID
          example: '123456'
        transporter_name:
          type: string
          description: Transporter Name
          example: Transporter Name
        vehicle_number:
          type: string
          description: Vehicle Number
          example: KA01AB1234
        transporter_doc_number:
          type: string
          description: Transporter Document Number
          example: '123456'
      type: object
    SuccessResponseEwayBill:
      properties:
        success:
          type: boolean
          description: Success
          example: true
        message:
          type: string
          description: Message
          example: Eway Bill created successfully
      type: object
    ErrorEwayBill:
      properties:
        success:
          type: boolean
          default: false
          example: false
        error_code:
          type: string
          description: >-
            Error Code unique for a specific error. For ewaybill portal errors,
            error_code will be PORTAL_ERROR_[ewaybill_portal_errorcode] ex:
            PORTAL_ERROR_2247, we can refer description for error code from here
            https://einvoice1.gst.gov.in/others/geterrorcodes/EWB
          example: INVALID_HASH_ID
        message:
          type: string
          description: Error message
          example: Some error occurred
        errors:
          type: object
          description: Error details
      type: object
    EwayBillAddress:
      required:
        - addr_id
        - address_line1
        - address_line2
        - city
        - country
        - pincode
        - state
      properties:
        addr_id:
          type: integer
          description: >-
            Address ID. Value should be n >= 0 and n <= 999999, It will
            automatically update the existing address if the address ID already
            exists.
                                              
          example: -1
        address_line1:
          type: string
          description: Address Line 1
          example: 123 Street
        address_line2:
          type: string
          description: Address Line 2
          example: Apt 4B
        city:
          type: string
          description: City
          example: City Name
        state:
          type: string
          description: |-
            State.
                                           Select OTHER TERRITORY for countries other than India.
                                           You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details
                                           
          example: State Name
          enum:
            - JAMMU AND KASHMIR
            - HIMACHAL PRADESH
            - PUNJAB
            - CHANDIGARH
            - UTTARAKHAND
            - HARYANA
            - DELHI
            - RAJASTHAN
            - UTTAR PRADESH
            - BIHAR
            - SIKKIM
            - ARUNACHAL PRADESH
            - NAGALAND
            - MANIPUR
            - MIZORAM
            - TRIPURA
            - MEGHALAYA
            - ASSAM
            - WEST BENGAL
            - JHARKHAND
            - ODISHA
            - CHHATTISGARH
            - MADHYA PRADESH
            - GUJARAT
            - DADRA & NAGAR HAVELI & DAMAN & DIU
            - MAHARASHTRA
            - ANDHRAPRADESH(BEFOREADDED)
            - KARNATAKA
            - GOA
            - LAKSHWADEEP
            - KERALA
            - TAMIL NADU
            - PUDUCHERRY
            - ANDAMAN & NICOBAR
            - TELANGANA
            - ANDHRA PRADESH
            - LADAKH(NEWLYADDED)
            - LADAKH(NEWLY ADDED)
            - OTHER TERRITORY
        country:
          type: string
          description: >-
            Country. You can copy the country details from
            https://developers.getswipe.in/api-reference/references#country-array
          example: Country Name
          enum:
            - Afghanistan
            - Albania
            - Algeria
            - Andorra
            - Angola
            - Antigua and Barbuda
            - Argentina
            - Armenia
            - Australia
            - Austria
            - Azerbaijan
            - Bahamas
            - Bahrain
            - Bangladesh
            - Barbados
            - Belarus
            - Belgium
            - Belize
            - Benin
            - Bhutan
            - Bolivia
            - Bosnia and Herzegovina
            - Botswana
            - Brazil
            - Brunei
            - Bulgaria
            - Burkina Faso
            - Burundi
            - Cabo Verde
            - Cambodia
            - Cameroon
            - Canada
            - Central African Republic
            - Chad
            - Chile
            - China
            - Colombia
            - Comoros
            - Congo, Democratic Republic of the
            - Congo, Republic of the
            - Costa Rica
            - Croatia
            - Cuba
            - Cyprus
            - Czechia
            - Denmark
            - Djibouti
            - Dominica
            - Dominican Republic
            - Ecuador
            - Egypt
            - El Salvador
            - Equatorial Guinea
            - Eritrea
            - Estonia
            - Eswatini
            - Ethiopia
            - Fiji
            - Finland
            - France
            - Gabon
            - Gambia
            - Georgia
            - Germany
            - Ghana
            - Greece
            - Grenada
            - Guatemala
            - Guinea
            - Guinea-Bissau
            - Guyana
            - Haiti
            - Honduras
            - Hungary
            - Iceland
            - India
            - Indonesia
            - Iran
            - Iraq
            - Ireland
            - Israel
            - Italy
            - Jamaica
            - Japan
            - Jordan
            - Kazakhstan
            - Kenya
            - Kiribati
            - Republic of Korea (South Korea)
            - Kosovo
            - Kuwait
            - Kyrgyzstan
            - Laos
            - Latvia
            - Lebanon
            - Lesotho
            - Liberia
            - Libya
            - Liechtenstein
            - Lithuania
            - Luxembourg
            - Madagascar
            - Malawi
            - Malaysia
            - Maldives
            - Mali
            - Malta
            - Marshall Islands
            - Mauritania
            - Mauritius
            - Mexico
            - Micronesia
            - Moldova
            - Monaco
            - Mongolia
            - Montenegro
            - Morocco
            - Mozambique
            - Myanmar
            - Namibia
            - Nauru
            - Nepal
            - Netherlands
            - New Zealand
            - Nicaragua
            - Niger
            - Nigeria
            - North Macedonia
            - Norway
            - Oman
            - Pakistan
            - Palau
            - Palestine
            - Panama
            - Papua New Guinea
            - Paraguay
            - Peru
            - Philippines
            - Poland
            - Portugal
            - Qatar
            - Romania
            - Russia
            - Rwanda
            - Saint Kitts and Nevis
            - Saint Lucia
            - Saint Vincent and the Grenadines
            - Samoa
            - San Marino
            - Sao Tome and Principe
            - Saudi Arabia
            - Senegal
            - Serbia
            - Seychelles
            - Sierra Leone
            - Singapore
            - Slovakia
            - Slovenia
            - Solomon Islands
            - Somalia
            - South Africa
            - South Sudan
            - Spain
            - Sri Lanka
            - Sudan
            - Suriname
            - Sweden
            - Switzerland
            - Syria
            - Taiwan
            - Tajikistan
            - Tanzania
            - Thailand
            - Timor-Leste
            - Togo
            - Tonga
            - Trinidad and Tobago
            - Tunisia
            - Turkey
            - Turkmenistan
            - Tuvalu
            - Uganda
            - Ukraine
            - United Arab Emirates
            - United Kingdom
            - United States
            - Uruguay
            - Uzbekistan
            - Vanuatu
            - Vatican City
            - Venezuela
            - Vietnam
            - Yemen
            - Zambia
            - Zimbabwe
        pincode:
          type: string
          description: Pincode
          example: '123456'
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is an API key from the [API
        Integration](https://app.getswipe.in/user?tab=api_integration) section
        of your dashboard. Keys are scoped to the company they are generated in
        — for testing, [add a separate test
        company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191)
        and generate the key there, so requests never touch your real books.

````