> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tazapay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Document to a Resource

> This lets you attach a document to any Tazapay resource like payout, entity etc



## OpenAPI

````yaml post /v3/document
openapi: 3.1.0
info:
  title: sandbox
  version: '3'
servers:
  - url: https://service-sandbox.tazapay.com
security:
  - sec0: []
paths:
  /v3/document:
    post:
      summary: Upload Document
      operationId: upload-document
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - type
                - reference
              properties:
                url:
                  type: string
                  description: >-
                    Dynamically downloadable URL for document OR Shipment
                    tracking URL
                type:
                  type: string
                  description: >-
                    Type of document uploaded. for example - delivery_proof,
                    invoice etc. If you are uploading a document against a
                    particular document request, please make sure the document
                    name matches to the exact document requested.
                name:
                  type: string
                  description: Name of the type in case the type is 'other'
                reference:
                  type: string
                  description: >-
                    ID of the object for which the document is being submitted
                    (checkout, escrow, payin)
                description:
                  type: string
                  description: Additional information about the document uploaded
                metadata:
                  type: string
                  description: Set of key-value pairs to attach to the document
                  format: json
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: success
                    message: ''
                    data:
                      created_at: '2023-09-13T10:22:12.711645400Z'
                      description: This is a sample document
                      id: doc_ck0oql7oclf1aqlh4jdg
                      metadata: null
                      name: Purchase proof
                      object: document
                      reference: esc_ck0og8noclf1aqlh4icg
                      type: tracking_url
                      url: >-
                        https://drive.google.com/file/d/1q5kk5YKcCojdTYir-rONXjN7szuXE16m/view?usp=sharing
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      Indicates whether the document upload or retrieval
                      operation was successful.
                  message:
                    type: string
                    description: Additional message or status detail for the API response.
                  data:
                    type: object
                    description: >-
                      Contains detailed information about the uploaded or
                      retrieved document.
                    properties:
                      created_at:
                        type: string
                        description: >-
                          Timestamp when the document was created (ISO 8601
                          format).
                      description:
                        type: string
                        description: Description or note associated with the document.
                      id:
                        type: string
                        description: Unique identifier for the document in the system.
                      metadata:
                        $ref: '#/components/schemas/Metadata'
                      name:
                        type: string
                        description: Display name or title of the document.
                      object:
                        type: string
                        description: >-
                          Indicates the type of object returned, typically
                          'document'.
                      reference:
                        type: string
                        description: >-
                          ID of the object (such as escrow or payout) that this
                          document is associated with.
                      type:
                        type: string
                        description: >-
                          Type of the document (e.g., 'invoice',
                          'proof_of_payment', 'tracking_url').
                      url:
                        type: string
                        description: >-
                          Public or signed URL for accessing or downloading the
                          document.
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false
components:
  schemas:
    Metadata:
      type: object
      description: Custom metadata key-value pairs attached to the object
      additionalProperties:
        type: string
      nullable: true
    ErrorResponse:
      type: object
      description: Standard error response structure
      properties:
        status:
          type: string
          enum:
            - error
          description: Always 'error' for error responses
        message:
          type: string
          description: High-level error message
        errors:
          type: array
          description: Array of detailed error objects
          items:
            type: object
            properties:
              code:
                type: integer
                description: Specific error code
              message:
                type: string
                description: Detailed error message
              remarks:
                type: string
                description: Additional context or suggestions for resolution
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````