# Create contract

Creates a contract based on the provided contract type.

Endpoint: POST /v2/contracts

## Request fields (application/json):

  - `type` (object, required)
    The type of the contract

  - `type.id` (integer)
    The system identifier for the contract type
    Example: 1234

  - `name` (string)
    The user defined name of the contract
    Example: My contract

  - `document` (object)
    The contract document.

This is only optional if the contract type has a wizard

  - `document.id` (integer)
    The system identifier for the file
    Example: 9456

  - `owner` (object)
    The user assigned as the owner of the contract

  - `owner.id` (string)
    The unique identifier of the user
    Example: f0f1e06e-3005-4093-af7f-1934d55617e1

  - `owner.organization` (object)
    The organization the user belongs to

  - `owner.organization.id` (integer)
    The system identifier for the organization
    Example: 8134

  - `expiry` (string)
    The expiry date of the contract. The date and time uses the ISO-8601 format and will be in the Local timezone of the organization
    Example: 2024-12-25T00:00:00

  - `externalId` (string)
    A unique user defined identifier that can be used to reference another system
    Example: external-01

  - `restricted` (boolean)
    Is the contract only available to members.

An indicator where the contract requires membership to access
    Example: false

  - `teamAssigned` (object)
    The team which this contract is assigned to

  - `teamAssigned.id` (integer)
    The system identifier for the team
    Example: 469

## Response 201 fields (application/json):

  - `id` (integer)
    The system identifier for the contract
    Example: 5348

## Response 400 fields (application/problem+json):

  - `detail` (string)
    More information about the problem.

  - `instance` (string)
    The URI of the resource which the error relates to.

  - `operationId` (string)
    A unique trace identifier for the request. This should be provided when requesting support.

  - `status` (integer)
    The HTTP status code for the problem.

  - `title` (string)
    A short description of the error.

  - `type` (string)
    A URI which can be followed to find out more about the problem.

## Response 409 fields (application/problem+json):

  - `detail` (string)
    More information about the problem.

  - `instance` (string)
    The URI of the resource which the error relates to.

  - `operationId` (string)
    A unique trace identifier for the request. This should be provided when requesting support.

  - `status` (integer)
    The HTTP status code for the problem.

  - `title` (string)
    A short description of the error.

  - `type` (string)
    A URI which can be followed to find out more about the problem.

