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

# Contract registration

> This section provides detailed information on the endpoints that can be used to create and manage contracts. Contracts can be any type of documents with custom set of fields/elements.



## OpenAPI

````yaml /api/openapi_api_adapter.json post /amlyze-ws-rest/contract
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://{{baseUrl}}
    description: Generated server url
security:
  - bearerAuth: []
tags: []
paths:
  /amlyze-ws-rest/contract:
    post:
      tags:
        - contract
      summary: Contract registration
      description: >-
        This section provides detailed information on the endpoints that can be
        used to create and manage contracts. Contracts can be any type of
        documents with custom set of fields/elements.
      operationId: createContract
      requestBody:
        description: Contract to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractApi'
            examples:
              contract_import:
                summary: Contract import example
                value:
                  communicationNumber: COM216a
                  requester: financial_institution
                  contractType: CREDIT_CARD
                  businessUnit: sandbox
                  extId: any_contract_1232
                  contractCode: REG74121101
                  customerExtId: ORG20231117550
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractResultApi'
        '400':
          description: >-
            Bad Request. The request is invalid, e.g., a mandatory field is
            missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAdapterErrorResponse'
              example:
                resultType: REQUEST_REJECTED
                errorCode: O001
                errorDescription: extId is mandatory
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAdapterErrorResponse'
              example:
                timestamp: '2024-05-26T16:49:50.237+00:00'
                status: 404
                error: Not Found
                path: /amlyze-ws-rest/contract
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAdapterErrorResponse'
              example:
                resultType: REQUEST_REJECTED
                status: 500
                error: Internal Server Error
components:
  schemas:
    ContractApi:
      properties:
        accountExtId:
          description: >-
            External account identification number. Corresponds to the account's
            identifier in the financial institution.
          type: string
        action:
          description: >-
            Element is used to create/update data of the contract. If not
            provided, `CREATE` is the default. By using `UPDATE`, all existing
            data will be replaced with the newly provided data. This field is
            primarily for batch API usage.
          enum:
            - CREATE
            - UPDATE
          type: string
        active:
          description: Indicates if a contract is active.
          type: boolean
        additionalProperties:
          description: Additional properties for the contract.
          items:
            $ref: '#/components/schemas/ContractAdditionalPropertyApi'
          type: array
        businessUnit:
          description: >-
            Mandatory for clients using a multi-organizational solution.
            Specifies the unique identifier for the business unit.
          type: string
        communicationNumber:
          description: >-
            Unique number of communication. It is used for risk assessment
            callback.
          type: string
        contractCode:
          description: Contract code or number.
          type: string
        contractType:
          description: >-
            Type of contract for evaluation of the object. Possible values are
            configured per client. See `/classifier/contractType`.
          type: string
        customerExtId:
          description: >-
            External customer identifier. This links a contract to a customer
            and corresponds to the client's identifier in the financial
            institution.
          type: string
        endAt:
          description: Contract end date or any other date that covers the ending point.
          format: date
          type: string
        extId:
          description: >-
            Unique external contract identifier. This corresponds to the
            contract identifier in the financial institution.
          type: string
        requester:
          description: Name of the system requesting web service.
          maxLength: 100
          type: string
        startAt:
          description: >-
            Contract start date or any other date that covers the starting
            point.
          format: date
          type: string
      required:
        - communicationNumber
        - extId
        - requester
      type: object
    ContractResultApi:
      properties:
        errorCode:
          type: string
        errorDescription:
          type: string
        resultType:
          enum:
            - REQUEST_ACCEPTED
            - REQUEST_REJECTED
          type: string
      type: object
    ApiAdapterErrorResponse:
      properties:
        errorCode:
          type: string
        errorDescription:
          type: string
        resultType:
          type: string
        errors:
          type: array
          items:
            type: string
        timestamp:
          type: string
        status:
          type: number
        error:
          type: string
        path:
          type: string
    ContractAdditionalPropertyApi:
      properties:
        at:
          description: The date and time of a property.
          format: date-time
          type: string
        code:
          description: Unique code.
          type: string
        dataType:
          description: Data type.
          enum:
            - BOOLEAN
            - DATE
            - DECIMAL
            - EXTERNAL_LINK
            - INTEGER
            - STRING
            - TIMESTAMP
          type: string
        title:
          type: string
        value:
          type: string
      required:
        - code
        - title
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````