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



## OpenAPI

````yaml get /v2/doc/{doc_hash_id}
openapi: 3.0.1
info:
  title: SwipeAPI
  description: Partner API
  version: '2.0'
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
tags:
  - name: Document
    description: Document related operations
  - name: Customer
    description: Customer related operations
  - name: Payment
    description: Payment related operations
  - name: Product
    description: Product related operations
  - name: Utility
    description: Generic operations
  - name: Subscriptions
    description: Subscriptions related operations
  - name: Document V2
    description: Document related operations
  - name: Customer V2
    description: Customer related operations
  - name: Payment V2
    description: Payment related operations
  - name: Product V2
    description: Product related operations
  - name: Subscriptions V2
    description: Subscriptions related operations
  - name: Utility V2
    description: Generic operations
  - name: Vendor V2
    description: Vendor related operations
  - name: EwayBill
    description: EwayBill related operations
  - name: Inventory V2
    description: Inventory related operations
paths:
  /v2/doc/{doc_hash_id}:
    get:
      tags:
        - Document V2
      summary: Get a document
      operationId: v2_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:
      type: object
      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
          properties: {}
          description: Error details
        data:
          $ref: '#/components/schemas/GetTransaction'
    DocResponseV2:
      type: object
      properties:
        success:
          type: boolean
          example: true
          default: true
        message:
          type: string
          description: Success Message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Error details
        data:
          $ref: '#/components/schemas/Data'
    GetTransaction:
      type: object
      properties:
        invoice_details:
          $ref: '#/components/schemas/TransactionModelV2'
    Data:
      type: object
      properties:
        hash_id:
          type: string
          description: Hash ID
          example: SL123
    TransactionModelV2:
      type: object
      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:
          type: object
          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
          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
        record_time:
          type: string
          description: Epoch Timestamp when the document was created
          example: '1764141027'
    Party:
      required:
        - id
        - name
        - type
      type: object
      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:
          type: object
          description: >-
            Party shipping to Address, refer Shipping Address Object for
            parameters
          allOf:
            - $ref: '#/components/schemas/ShippingAddressV2'
        billing_address:
          type: object
          description: >-
            Party billing to Address, refer Shipping Address Object for
            parameters
          allOf:
            - $ref: '#/components/schemas/ShippingAddressV2'
    DocItemV2:
      required:
        - id
        - item_type
        - name
        - net_amount
        - price_with_tax
        - quantity
        - total_amount
        - unit_price
      type: object
      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
          example: 10
        discount_amount:
          type: number
          description: Discount Amount, will be ignored if discount_percent is provided
          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'
    PaymentV2:
      required:
        - amount
        - method
      type: object
      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:
          type: object
          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'
    ShippingAddressV2:
      required:
        - address_line1
        - address_line2
        - city
        - country
        - pincode
        - state
      type: object
      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
        addr_id_v2:
          type: string
          description: >-
            Address ID. It must be alphanumeric, not empty, and up to 16
            characters long.
          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)
            - 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
            - Korea, North
            - Korea, South
            - 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'
    ItemCustomFields:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    BankDetails:
      required:
        - account_number
        - bank_name
        - branch
        - ifsc
      type: object
      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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````