> ## 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.

# Cancel a contract



## OpenAPI

````yaml /openapi.json delete /api/v1/documents/contracts/{contract_id}
openapi: 3.1.0
info:
  title: HEVN API
  description: Backend API for HEVN mobile neobank
  version: 0.1.2
servers: []
security: []
paths:
  /api/v1/documents/contracts/{contract_id}:
    delete:
      tags:
        - contracts
      summary: Cancel a contract
      operationId: cancel_contract_api_v1_documents_contracts__contract_id__delete
      parameters:
        - name: contract_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Contract Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          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:
    ContractResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        clientId:
          type: string
          format: uuid
          title: Clientid
        contractorId:
          type: string
          format: uuid
          title: Contractorid
        creatorId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Creatorid
        client:
          anyOf:
            - $ref: '#/components/schemas/ContractParty-Output'
            - type: 'null'
        contractor:
          anyOf:
            - $ref: '#/components/schemas/ContractParty-Output'
            - type: 'null'
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        type:
          $ref: '#/components/schemas/ContractType'
        status:
          $ref: '#/components/schemas/ContractStatus'
        terms:
          $ref: '#/components/schemas/ContractTermsInput-Output'
        clientAddress:
          anyOf:
            - $ref: '#/components/schemas/UserAddress'
            - type: 'null'
        contractorAddress:
          anyOf:
            - $ref: '#/components/schemas/UserAddress'
            - type: 'null'
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        currency:
          $ref: '#/components/schemas/Currency'
        billing:
          $ref: '#/components/schemas/BillingCycleInput'
        schedule:
          anyOf:
            - $ref: '#/components/schemas/ContractScheduleResponse'
            - type: 'null'
        documents:
          items:
            $ref: '#/components/schemas/ContractDocument'
          type: array
          title: Documents
        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
        - terms
        - amount
        - currency
        - billing
        - createdAt
        - updatedAt
      title: ContractResponse
      description: A recurring billing agreement.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContractParty-Output:
      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:
            - $ref: '#/components/schemas/UserAddress'
            - type: 'null'
      type: object
      required:
        - id
      title: ContractParty
      description: Minimal user data embedded in contract responses.
    ContractType:
      type: string
      enum:
        - service
        - employment
        - nda
        - contractor
        - vendor
        - msa
        - other
      title: ContractType
      description: What the recurring agreement is for. A label only — it drives no logic.
    ContractStatus:
      type: string
      enum:
        - active
        - paused
        - completed
        - cancelled
      title: ContractStatus
      description: Contract status. A contract is live the moment it is created.
    ContractTermsInput-Output:
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
          default: USD
        rateType:
          $ref: '#/components/schemas/ContractRateType'
          default: fixed
        items:
          items:
            $ref: '#/components/schemas/ContractLineItem-Output'
          type: array
          title: Items
        scope:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Scope
        jobTitle:
          anyOf:
            - type: string
              maxLength: 300
            - type: 'null'
          title: Jobtitle
        paymentTerms:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Paymentterms
      type: object
      title: ContractTermsInput
      description: Commercial terms a client sets on a contract.
    UserAddress:
      properties:
        streetAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Streetaddress
        addressLine2:
          anyOf:
            - type: string
            - type: 'null'
          title: Addressline2
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        country:
          anyOf:
            - $ref: '#/components/schemas/CountryCode'
            - type: 'null'
        zip:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip
      type: object
      title: UserAddress
      description: >-
        Address schema for user.


        Canonical field names: street_address, address_line_2, city, state,
        country, zip.

        Accepts legacy Align/IBAN field names (street_line_1, street_line_2,
        postal_code)

        for backward compatibility with existing JSONB data.
    Currency:
      type: string
      enum:
        - USD
        - EUR
        - GBP
        - JPY
        - CHF
        - CAD
        - AUD
        - NZD
        - SEK
        - NOK
        - AED
        - HKD
        - BRL
        - MXN
        - USDC
        - USDT
        - DAI
        - SOL
        - BTC
        - ETH
        - NEAR
        - BNB
        - XRP
        - ADA
        - DOGE
        - TRX
        - GRAM
        - AVAX
        - MATIC
        - DOT
        - LTC
        - LINK
        - ARB
        - OP
        - SUI
      title: Currency
      description: >-
        Supported invoice/contract currencies. G10 majors + AED/HKD, plus
        popular crypto tokens.
    BillingCycleInput:
      properties:
        period:
          $ref: '#/components/schemas/BillingCycle'
          default: once
        activationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Activationat
        expirationAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirationat
        firstPaymentAt:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Firstpaymentat
        endsOn:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Endson
      type: object
      title: BillingCycleInput
      description: >-
        The calendar schedule a contract bills on.


        ``endsOn`` anchors the cycle: a day of month (``"1".."31"`` or
        ``"last"``)

        for monthly/quarterly/yearly, a weekday name for weekly/biweekly. It is

        rejected for a one-time contract.
    ContractScheduleResponse:
      properties:
        period:
          $ref: '#/components/schemas/BillingCycle'
        endsOn:
          anyOf:
            - type: string
            - type: 'null'
          title: Endson
        firstPaymentAt:
          type: string
          format: date
          title: Firstpaymentat
        totalPeriods:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totalperiods
        currentPeriod:
          type: integer
          title: Currentperiod
        periods:
          items:
            $ref: '#/components/schemas/ContractSchedulePeriod'
          type: array
          title: Periods
      type: object
      required:
        - period
        - firstPaymentAt
        - currentPeriod
        - periods
      title: ContractScheduleResponse
      description: The resolved calendar schedule of a contract.
    ContractDocument:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        fileName:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        documentType:
          anyOf:
            - type: string
            - type: 'null'
          title: Documenttype
        downloadLink:
          anyOf:
            - type: string
            - type: 'null'
          title: Downloadlink
        createdAt:
          type: string
          format: date-time
          title: Createdat
      type: object
      required:
        - id
        - createdAt
      title: ContractDocument
      description: A document attached to a contract.
    TransactionType:
      type: string
      enum:
        - sepa
        - swift
        - ach
        - uaefts
        - fedwire
        - rtp
        - fednow
        - spei
        - pse
        - transfers_3_0
        - ukfps
        - swift-usd
        - swift-eur
        - wire
        - pix
        - crypto
        - card
        - internal
        - refund
        - oneclick
        - move
        - hevn_transfer
        - subscription
      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/oneclick/hevn_transfer).


        ``oneclick``, ``move`` and ``hevn_transfer`` are not stored on

        ``Transaction.type`` but are accepted as filter values for parity with
        the

        frontend ``TransactionType`` enum (otherwise selecting the "Transfers"

        category, which sends ``hevn_transfer``, would 400 in ``parse_csv``).
    ContractLastInvoice:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        contractId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Contractid
        invoiceNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoicenumber
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        currency:
          $ref: '#/components/schemas/Currency'
        status:
          type: string
          title: Status
        issuedDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Issueddate
        dueDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Duedate
        paidAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Paidat
        createdAt:
          type: string
          format: date-time
          title: Createdat
      type: object
      required:
        - id
        - amount
        - currency
        - status
        - createdAt
      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
    ContractRateType:
      type: string
      enum:
        - fixed
        - hourly
      title: ContractRateType
      description: How a contractor's fee is computed.
    ContractLineItem-Output:
      properties:
        name:
          type: string
          maxLength: 300
          minLength: 1
          title: Name
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          default: '1'
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          default: '0'
      type: object
      required:
        - name
      title: ContractLineItem
      description: One billable line of a contract.
    CountryCode:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - CV
        - KH
        - CM
        - CA
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MK
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      title: CountryCode
      description: ISO 3166-1 alpha-2 country codes.
    BillingCycle:
      type: string
      enum:
        - once
        - weekly
        - biweekly
        - monthly
        - quarterly
        - yearly
      title: BillingCycle
      description: Calendar cadence a contract bills on.
    ContractSchedulePeriod:
      properties:
        index:
          type: integer
          title: Index
        periodStart:
          type: string
          format: date
          title: Periodstart
        periodEnd:
          type: string
          format: date
          title: Periodend
        dueDate:
          type: string
          format: date
          title: Duedate
      type: object
      required:
        - index
        - periodStart
        - periodEnd
        - dueDate
      title: ContractSchedulePeriod
      description: One billing occurrence, as the client renders it.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````