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

# Register document

> Registers document metadata and returns a short-lived presigned upload URL.



## OpenAPI

````yaml /openapi/payfi-v1.json post /v1/operations/{operationId}/documents
openapi: 3.0.0
info:
  title: PayFi Partner API
  description: >-
    Partner API for PayFi compliance document automation. Dashboard Partner
    access is the admin role for exactly one partner integration; public API
    requests remain authenticated with signed partner API keys.
  version: 0.1.0
  contact: {}
servers:
  - url: https://sandbox.payfi.global
    description: Sandbox
  - url: https://api.payfi.global
    description: Production
security: []
tags:
  - name: Customers
    description: Signed partner endpoints for customer records.
  - name: Operations
    description: Signed partner endpoints for operations, documents, and upload completion.
  - name: Webhooks
    description: Partner-managed webhook endpoints and signed callback tests.
paths:
  /v1/operations/{operationId}/documents:
    post:
      tags:
        - Operations
      summary: Register document
      description: >-
        Registers document metadata and returns a short-lived presigned upload
        URL.
      operationId: PartnerApiController_registerDocument
      parameters:
        - name: operationId
          in: path
          required: true
          description: Operation ID.
          schema:
            type: string
          example: op_example
      requestBody:
        required: true
        description: Document metadata.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterDocumentRequest'
            examples:
              invoice:
                value:
                  documentType: invoice
                  fileName: invoice-123.pdf
                  contentType: application/pdf
                  sizeBytes: 123456
      responses:
        '201':
          description: Document registered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterDocumentResponse'
              examples:
                registered:
                  value:
                    documentId: doc_example
                    status: UPLOAD_PENDING
                    uploadUrl: https://storage.example.com/presigned-upload
                    uploadUrlExpiresInSeconds: 300
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidRequest:
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: The request payload is invalid.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    error:
                      code: UNAUTHORIZED
                      message: Authentication failed.
      security:
        - PayFiApiKey: []
          PayFiNonce: []
          PayFiSignature: []
          PayFiIdempotencyKey: []
components:
  schemas:
    RegisterDocumentRequest:
      type: object
      properties:
        documentType:
          type: string
          enum:
            - invoice
            - bill_of_lading
            - packing_list
            - di_duimp
            - bank_details
            - proforma
            - service_contract
            - insurance_policy
          example: invoice
        fileName:
          type: string
          example: invoice-123.pdf
        contentType:
          type: string
          example: application/pdf
        sizeBytes:
          type: number
          example: 123456
      required:
        - documentType
        - fileName
        - contentType
        - sizeBytes
    RegisterDocumentResponse:
      type: object
      properties:
        documentId:
          type: string
          example: doc_example
        status:
          type: string
          enum:
            - REGISTERED
            - UPLOAD_PENDING
            - UPLOADED
            - SCANNING
            - CLEAN
            - REJECTED
            - PROCESSING
            - PROCESSED
            - PROCESSING_FAILED
          example: UPLOAD_PENDING
        uploadUrl:
          type: string
          example: https://storage.example.com/presigned-upload
        uploadUrlExpiresInSeconds:
          type: number
          example: 300
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: INVALID_SIGNATURE
            message:
              type: string
              example: The request signature is invalid.
  securitySchemes:
    PayFiApiKey:
      type: apiKey
      in: header
      name: X-PayFi-Api-Key
    PayFiNonce:
      type: apiKey
      in: header
      name: X-PayFi-Nonce
    PayFiSignature:
      type: apiKey
      in: header
      name: X-PayFi-Signature
    PayFiIdempotencyKey:
      type: apiKey
      in: header
      name: Idempotency-Key

````