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

> Returns the rendered PDF file for a document. The PDF uses the invoice templates and document settings configured on your Swipe account. Pass `delivery_challan=1` to get a delivery-challan copy instead.



## OpenAPI

````yaml get /v2/doc/pdf/{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/pdf/{doc_hash_id}:
    parameters:
      - name: doc_hash_id
        in: path
        description: The hash id of the document to be fetched
        required: true
        schema:
          type: string
      - name: delivery_challan
        in: query
        description: Set to 1 if you want to get a delivery challan copy of the document
        schema:
          type: integer
          default: 0
    get:
      tags:
        - Document V2
      summary: Get document PDF
      description: >-
        Returns the rendered PDF file for a document. The PDF uses the invoice
        templates and document settings configured on your Swipe account. Pass
        `delivery_challan=1` to get a delivery-challan copy instead.
      operationId: get_pdf
      responses:
        '200':
          description: File will be downloaded
        '400':
          description: Invalid Document Hash ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
components:
  schemas:
    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
    Data:
      properties:
        hash_id:
          type: string
          description: Hash ID
          example: SL123
      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.

````