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

# Upload File

> Uploads a single document or image to the server. Supports specific categories such as invoices and contracts. Returns a unique file ID and the accessible URL upon successful storage.



## OpenAPI

````yaml /openapi.json post /api/files/upload
openapi: 3.0.1
info:
  title: AxisFi API 接口文档
  description: 认证需同时提供 API Key 和 Secret
  version: v1.0.0
servers:
  - url: http://127.0.0.1:8083
    description: Generated server url
security:
  - X-API-Key: []
    X-API-Secret: []
paths:
  /api/files/upload:
    post:
      tags:
        - Files
      summary: Upload File
      description: >-
        Uploads a single document or image to the server. Supports specific
        categories such as invoices and contracts. Returns a unique file ID and
        the accessible URL upon successful storage.
      operationId: uploadFile
      parameters:
        - name: file_type
          in: query
          description: >-
            File Type Code. Valid values vary based on the specific business
            scenario:


            ### 1. Customer Corporate Documents

            * `Business Registration`: Official business license.

            * `Article of Association`: Corporate constitutional documents.


            ### 2. Customer Legal Representative ID

            * `Main page`: Front side of the ID card or Passport bio-data page.

            * `Back page`: Back side of the ID card.


            ### 3. Transfer Documents Or Recipient Documents

            * `Invoice`: Billing document for payment request.

            * `Contract`: Supporting service/goods contract.


            > **Note**: Ensure the uploaded `file_type` matches the specific
            business context (Customer,Recipient,Transfer).
          required: true
          schema:
            pattern: >-
              ^(Invoice|Contract|Business Registration|Article of
              Association|Main page|Back page)$
            type: string
            description: >-
              File Type Code. Valid values vary based on the specific business
              scenario:


              ### 1. Customer Corporate Documents

              * `Business Registration`: Official business license.

              * `Article of Association`: Corporate constitutional documents.


              ### 2. Customer Legal Representative ID

              * `Main page`: Front side of the ID card or Passport bio-data
              page.

              * `Back page`: Back side of the ID card.


              ### 3. Transfer Documents Or Recipient Documents

              * `Invoice`: Billing document for payment request.

              * `Contract`: Supporting service/goods contract.


              > **Note**: Ensure the uploaded `file_type` matches the specific
              business context (Customer,Recipient,Transfer).
            example: Business Registration
            enum:
              - Invoice
              - Contract
              - Business Registration
              - Article of Association
              - Main page
              - Back page
          example: Business Registration
      requestBody:
        content:
          application/json:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  description: file
                  format: binary
      responses:
        '200':
          description: Operation Successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FileRespVo'
        '400':
          description: Invalid Parameter
          content:
            application/json:
              example:
                errors:
                  - detail: <string>
                    code: <string>
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                errors:
                  - detail: <string>
                    code: <string>
        '403':
          description: Forbidden (No Permission)
          content:
            application/json:
              example:
                errors:
                  - detail: <string>
                    code: <string>
        '404':
          description: Not Found
          content:
            application/json:
              example:
                errors:
                  - detail: <string>
                    code: <string>
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorRespVo'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                errors:
                  - detail: <string>
                    code: <string>
components:
  schemas:
    FileRespVo:
      type: object
      properties:
        file_id:
          type: string
          description: File ID
    ErrorRespVo:
      type: object
      properties:
        errors:
          type: array
          description: 错误信息列表
          items:
            $ref: '#/components/schemas/ErrorDetailRespVo'
      description: 错误响应结果
    ErrorDetailRespVo:
      type: object
      properties:
        detail:
          type: string
          description: 错误详细描述
          example: Invalid organizationId
        code:
          type: string
          description: 错误码
          example: ORG_ID_INVALID
      description: 错误详情
  securitySchemes:
    X-API-Key:
      type: apiKey
      description: Includes an API key in the HTTP headers to authenticate the client.
      name: X-API-Key
      in: header
    X-API-Secret:
      type: apiKey
      description: Includes an API secret in the HTTP headers to authenticate the client.
      name: X-API-Secret
      in: header

````