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

# Create a new contract



## OpenAPI

````yaml /openapi.json post /api/v1/documents/contracts
openapi: 3.1.0
info:
  title: HEVN API
  description: Backend API for HEVN mobile neobank
  version: 0.1.2
servers:
  - url: https://api.hevn.finance
    description: Production
security: []
paths:
  /api/v1/documents/contracts:
    post:
      tags:
        - contracts
      summary: Create a new contract
      operationId: create_contract_api_v1_documents_contracts_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContractRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateContractRequest:
      properties:
        contractorEmail:
          anyOf:
            - type: string
              maxLength: 320
              minLength: 3
            - type: 'null'
          title: Contractoremail
        clientEmail:
          anyOf:
            - type: string
              maxLength: 320
              minLength: 3
            - type: 'null'
          title: Clientemail
        label:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Label
        type:
          $ref: '#/components/schemas/ContractType'
          default: service
        period:
          anyOf:
            - $ref: '#/components/schemas/ContractPeriod'
            - type: 'null'
        activationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Activationat
        expirationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirationat
        status:
          anyOf:
            - $ref: '#/components/schemas/ContractStatus'
            - type: 'null'
        fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Fields
        documentId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Documentid
        priorityMethods:
          items:
            $ref: '#/components/schemas/TransactionType'
          type: array
          title: Prioritymethods
        paymentMethods:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Paymentmethods
        requireClientKyc:
          type: boolean
          title: Requireclientkyc
          default: false
        requireClientW89:
          type: boolean
          title: Requireclientw89
          default: false
        requireContractorKyc:
          type: boolean
          title: Requirecontractorkyc
          default: false
        requireContractorW89:
          type: boolean
          title: Requirecontractorw89
          default: false
      type: object
      title: CreateContractRequest
      description: |-
        Request to create a new contract.

        Exactly one of ``contractor_email`` or ``client_email`` must be set.
        * ``contractor_email`` — the creator is the **client**.
        * ``client_email`` — the creator is the **contractor**.
    ContractResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        clientId:
          type: string
          format: uuid
          title: Clientid
        contractorId:
          type: string
          format: uuid
          title: Contractorid
        client:
          anyOf:
            - $ref: '#/components/schemas/ContractParty'
            - type: 'null'
        contractor:
          anyOf:
            - $ref: '#/components/schemas/ContractParty'
            - type: 'null'
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        documentId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Documentid
        documentName:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentname
        documentFileName:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentfilename
        documentDownloadLink:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentdownloadlink
        type:
          $ref: '#/components/schemas/ContractType'
        status:
          $ref: '#/components/schemas/ContractStatus'
        amount:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Amount
        currency:
          anyOf:
            - $ref: '#/components/schemas/Currency'
            - type: 'null'
        period:
          anyOf:
            - type: string
            - type: 'null'
          title: Period
        activationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Activationat
        expirationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirationat
        signatureRequestId:
          anyOf:
            - type: string
            - type: 'null'
          title: Signaturerequestid
        signed:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Signed
        clientAcceptance:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Clientacceptance
        contractorAcceptance:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Contractoracceptance
        creatorId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Creatorid
        fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Fields
        priorityMethods:
          items:
            $ref: '#/components/schemas/TransactionType'
          type: array
          title: Prioritymethods
        paymentMethods:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Paymentmethods
        lastInvoice:
          anyOf:
            - $ref: '#/components/schemas/ContractLastInvoice'
            - type: 'null'
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - id
        - clientId
        - contractorId
        - type
        - status
        - createdAt
        - updatedAt
      title: ContractResponse
      description: Contract response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContractType:
      type: string
      enum:
        - service
        - employment
        - nda
        - contractor
        - default_contractor
        - custom
        - vendor
        - milestone
        - msa
        - other
      title: ContractType
      description: Contract type.
    ContractPeriod:
      type: string
      enum:
        - weekly
        - biweekly
        - monthly
        - quarterly
        - yearly
      title: ContractPeriod
      description: Recurring billing period of a contract.
    ContractStatus:
      type: string
      enum:
        - pending_approval_by_contractor
        - pending_approval_by_client
        - active
        - completed
        - cancelled
        - paused
      title: ContractStatus
      description: Contract status.
    TransactionType:
      type: string
      enum:
        - sepa
        - swift
        - ach
        - uaefts
        - fedwire
        - swift-usd
        - swift-eur
        - wire
        - pix
        - crypto
        - card
        - internal
        - refund
      title: TransactionType
      description: |-
        Transaction type - payment rail.

        Includes all ``FiatPaymentType`` values (sepa/swift/ach/uaefts) plus
        extended fiat variants (wire/swift-usd/swift-eur/fedwire/pix) and
        non-fiat rails (crypto/card/internal/refund).
    ContractParty:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        entityName:
          anyOf:
            - type: string
            - type: 'null'
          title: Entityname
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatarurl
        isBusiness:
          type: boolean
          title: Isbusiness
          default: false
        address:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Address
      type: object
      required:
        - id
      title: ContractParty
      description: Minimal user data embedded in contract responses.
    Currency:
      type: string
      enum:
        - USD
        - EUR
        - GBP
        - JPY
        - CHF
        - CAD
        - AUD
        - NZD
        - SEK
        - NOK
        - AED
        - HKD
      title: Currency
      description: Supported invoice/contract currencies. G10 majors + AED/HKD.
    ContractLastInvoice:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        clientId:
          type: string
          format: uuid
          title: Clientid
        contractorId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Contractorid
        contractorEmail:
          anyOf:
            - type: string
            - type: 'null'
          title: Contractoremail
        clientEmail:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientemail
        contractId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Contractid
        onchainTransactionId:
          anyOf:
            - type: string
            - type: 'null'
          title: Onchaintransactionid
        invoiceDocumentId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Invoicedocumentid
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        discount:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Discount
        currency:
          $ref: '#/components/schemas/Currency'
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        emailMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Emailmessage
        invoiceNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoicenumber
        issuedDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Issueddate
        dueDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Duedate
        status:
          type: string
          title: Status
        paidAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Paidat
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - id
        - clientId
        - amount
        - currency
        - status
        - createdAt
        - updatedAt
      title: ContractLastInvoice
      description: Flat last invoice data embedded in contract responses.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      x-default: Bearer <token>

````