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

# Get a document

> Returns the full details of a document by its `hash_id` — party, items, amounts, and status.



## OpenAPI

````yaml get /v2/doc/{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/doc/{doc_hash_id}:
    get:
      tags:
        - Document V2
      summary: Get a document
      description: >-
        Returns the full details of a document by its `hash_id` — party, items,
        amounts, and status.
      operationId: get_invoice
      parameters:
        - name: doc_hash_id
          in: path
          description: The hash id of the document to be fetched
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetInvoice'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
components:
  schemas:
    GetInvoice:
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Message
          example: Details Fetched
        error_code:
          type: string
          description: Error code
          example: ''
        errors:
          type: object
          description: Error details
        data:
          $ref: '#/components/schemas/GetTransaction'
      type: object
    DocResponseV2:
      properties:
        success:
          type: boolean
          default: true
          example: true
        message:
          type: string
          description: Success Message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          description: Error details
        data:
          $ref: '#/components/schemas/Data'
      type: object
    GetTransaction:
      properties:
        invoice_details:
          $ref: '#/components/schemas/TransactionModelV2'
      type: object
    Data:
      properties:
        hash_id:
          type: string
          description: Hash ID
          example: SL123
      type: object
    TransactionModelV2:
      properties:
        serial_number:
          type: string
          description: Invoice number assigned to document
          example: INV-12
        document_type:
          type: string
          description: Document type
          example: invoice
        document_date:
          type: string
          description: Transaction date [DD-MM-YYYY]
          example: 11-06-2024
        party:
          description: Party Details for the document
          allOf:
            - $ref: '#/components/schemas/Party'
        due_date:
          type: string
          description: Transaction date [DD-MM-YYYY]
          example: 11-06-2024
        amount_paid:
          type: number
          description: Amount Paid for the document
          example: 28
        amount_pending:
          type: number
          description: Remaining amount to be paid for the document
          example: 90
        reference:
          type: string
          description: Reference Text
        notes:
          type: string
          description: Notes for the document
        terms:
          type: string
          description: Terms and Conditions
        items:
          type: array
          description: List of items in the document
          items:
            $ref: '#/components/schemas/DocItemV2'
        is_created_by_recurring:
          type: integer
          description: Is the invoice created from subscriptions
          default: 0
          example: 0
        net_amount:
          type: number
          description: Net amount of the transaction
          example: 100
        hash_id:
          type: string
          description: Hash id for the document
        payment_status:
          type: string
          description: Payment status of the document
          example: paid
          enum:
            - paid
            - pending
            - cancelled
        payments:
          type: array
          description: List of payments recorded for this document
          items:
            $ref: '#/components/schemas/PaymentV2'
        tax_amount:
          type: number
          description: Tax amount of the transaction
          example: 18
        total_amount:
          type: number
          description: Total amount of the transaction
          example: 118
        total_discount:
          type: number
          description: Discount given on this document
          example: 100
        document_custom_headers:
          type: array
          description: List of custom headers added for this document
          items:
            $ref: '#/components/schemas/CustomHeaders'
        record_time:
          type: string
          description: Epoch Timestamp when the document was created
          example: '1764141027'
      type: object
    Party:
      required:
        - id
        - name
        - type
      properties:
        id:
          type: string
          description: Unique id for each party.
          example: CUST123
        type:
          type: string
          description: |-
            Party type, use only specified values.
                                       Party type customer can be used for creating invoices, sales returns, estimates, pro forma invoices and delivery challans.
                                       Party type vendor can be used for creating purchases, purchase orders & purchase returns, .
                                       
          example: customer
          enum:
            - customer
            - vendor
        name:
          type: string
          description: Name of the Party
          example: John Doe
        country_code:
          type: string
          description: Party Phone Number Country code
          example: '91'
        phone_number:
          type: string
          description: Party Phone Number
          example: '1234567890'
        company_name:
          type: string
          description: Company Name
          example: Company Name
        email:
          type: string
          description: Party Email
          example: johndoe@example.com
        gstin:
          type: string
          description: GSTIN
          example: 27AARCS7202C1ZD
        shipping_address:
          description: >-
            Party shipping to Address, refer Shipping Address Object for
            parameters
          allOf:
            - $ref: '#/components/schemas/ShippingAddressV2'
        billing_address:
          description: >-
            Party billing to Address, refer Shipping Address Object for
            parameters
          allOf:
            - $ref: '#/components/schemas/ShippingAddressV2'
      type: object
    DocItemV2:
      required:
        - id
        - item_type
        - name
        - net_amount
        - price_with_tax
        - quantity
        - total_amount
        - unit_price
      properties:
        id:
          type: string
          description: >-
            Unique id for each item. If a new id  is sent, a new Item with the
            below details will be automatically created. if existing Item id is
            sent the details will not override the original item details. They
            will be applicable only to the current documents. Use update item to
            actually update the item details in swipe
          example: ITEM123
        name:
          type: string
          description: Name of the Product
          example: Item Name
        quantity:
          type: number
          description: Quantity
          example: 1
        unit_price:
          type: number
          description: Price per item without Tax
          example: 100
        tax_rate:
          type: number
          description: Tax percentage for each item . Only valid tax rates are accepted
          example: 18
        price_with_tax:
          type: number
          description: Price per item with Tax
          example: 118
        net_amount:
          type: number
          description: Net Amount
          example: 100
        total_amount:
          type: number
          description: |-
            Item total amount (Net Amount + Tax).
                                       We calculate the discount amount by multiplying the item's quantity, unit price, and discount percentage. If a discount amount is provided instead, we reverse-calculate the percentage. If no discount is given, it is set to 0.
                                    
          example: 118
        discount_percent:
          type: number
          description: Discount Percent
          default: 0
          example: 10
        discount_amount:
          type: number
          description: Discount Amount, will be ignored if discount_percent is provided
          default: 0
          example: 10
        description:
          type: string
          description: Item Description
          example: Item Description
        hsn_code:
          type: string
          description: HSN Code. HSN Code can only be of length 4,6 & 8
          example: '1234'
        item_type:
          type: string
          description: Product or Service enum
          example: Product
          enum:
            - Product
            - Service
        unit:
          type: string
          description: >-
            Item quantity unit. You can find the GST-approved units in the UQC
            Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.
          example: kg
        category:
          type: string
          description: Category
          example: Electronics
        custom_columns:
          type: array
          description: >-
            Item Custom Fields. Custom fields should already be added in Swipe
            Portal.
          example:
            - label: Custom Field 1
              value: Value 1
          items:
            $ref: '#/components/schemas/ItemCustomFields'
      type: object
    PaymentV2:
      required:
        - amount
        - method
      properties:
        amount:
          type: number
          description: Payment Amount
          example: 100
        method:
          type: string
          description: Payment method, use only specified values
          example: upi
          enum:
            - cash
            - card
            - upi
            - netBanking
            - cheque
            - emi
        notes:
          type: string
          description: Any internal notes for payment
          example: Payment notes
        bank_details:
          description: >-
            Bank Details, refer Bank Details Object below for parameters, If
            account_number, ifsc matched with existing bank details, it will be
            used, else new bank details will be added to your swipe account. It
            will link document payments to your company bank details.
          allOf:
            - $ref: '#/components/schemas/BankDetails'
      type: object
    CustomHeaders:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    ShippingAddressV2:
      required:
        - address_line1
        - address_line2
        - city
        - country
        - pincode
        - state
      properties:
        addr_id:
          type: integer
          description: Address ID. Value should be between 0 and 999999.
          example: -1
        addr_id_v2:
          type: string
          description: >-
            Address ID. Value should be not be empty,  It should be alphanumeric
            with length upto 16 characters.
          example: addr1
        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
    ItemCustomFields:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    BankDetails:
      required:
        - account_number
        - bank_name
        - branch
        - ifsc
      properties:
        account_number:
          type: string
          description: Account Number
          example: '1234567890'
        ifsc:
          type: string
          description: IFSC Code
          example: SBIN0000001
        bank_name:
          type: string
          description: Bank Name
          example: State Bank of India
        branch:
          type: string
          description: Branch
          example: Mumbai
      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.

````