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

# Create a party

> Adds a person or company connected to a legal entity. `OWNERSHIP_TOTAL_EXCEEDED` gives the percentage still available in `details`, as `available_percent`. A retry with the same key answers the party the first one created. If the first ended without recording what it made, a retry answers `IDEMPOTENCY_IN_PROGRESS` until Quidkey resolves the key.

Credentials: `partner`, `merchant`

Permission: `parties:create`



## OpenAPI

````yaml /api-reference/v1/openapi.json post /legal-entities/{id}/parties
openapi: 3.1.0
info:
  title: Quidkey API
  version: 1.0.0
  description: >-
    The Quidkey public API.


    Within a version, a response can carry what this document doesn't list yet:
    a new field, a new value of an enum, a new error code. Handle a value you
    don't recognise rather than refusing the response. A client generated from
    this document turns an `enum` into a closed type unless told otherwise, so
    turn on its option for unknown values, such as openapi-generator's
    `enumUnknownDefaultCase`. A request is held to what's listed: a value it
    doesn't list is refused.
  contact:
    name: Quidkey
    url: https://docs.quidkey.com
servers:
  - url: https://api.quidkey.com/v1
security:
  - bearer: []
tags:
  - name: account_owner
  - name: agreement
  - name: agreement_acceptance
  - name: api_key
  - name: bank
  - name: bank_account
  - name: capability
  - name: country
  - name: identity_verification
  - name: legal_entity
  - name: merchant
  - name: party
  - name: payment_link
  - name: payout
  - name: transaction
  - name: webhook_endpoint
paths:
  /legal-entities/{id}/parties:
    post:
      tags:
        - party
      summary: Create a party
      description: >-
        Adds a person or company connected to a legal entity.
        `OWNERSHIP_TOTAL_EXCEEDED` gives the percentage still available in
        `details`, as `available_percent`. A retry with the same key answers the
        party the first one created. If the first ended without recording what
        it made, a retry answers `IDEMPOTENCY_IN_PROGRESS` until Quidkey
        resolves the key.


        Credentials: `partner`, `merchant`


        Permission: `parties:create`
      operationId: party.create
      parameters:
        - name: id
          in: path
          required: true
          schema:
            minLength: 1
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            1 to 255 printable ASCII characters with no spaces, quotes or
            backslashes, in double quotes as the IETF draft defines, or without
            them. We recommend a UUID. Make one for each thing you mean to
            happen once and store it before you send the request, so a retry
            after a crash sends the same key. Keys are scoped to your account
            and the endpoint, not to a token, so a new token or a rotated secret
            doesn't affect a retry. A partner and its merchant are separate
            accounts, so the same key sent with each credential starts two
            requests. Keys are kept for at least 7 days. After that, the same
            key starts a new request.
          schema:
            type: string
            minLength: 1
            maxLength: 257
            pattern: >-
              ^(?:([\x21\x23-\x5B\x5D-\x7E]{1,255})|"([\x21\x23-\x5B\x5D-\x7E]{1,255})")$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              if:
                properties:
                  type:
                    const: company
                required:
                  - type
              then:
                additionalProperties: false
                required:
                  - legal_name
                  - registration_number
                  - legal_structure
                  - country_of_incorporation
                  - registered_address
                  - contact_full_name
                  - contact_email
                  - contact_phone
                properties:
                  type: {}
                  party_roles: {}
                  ownership_percent: {}
                  legal_name: {}
                  registration_number: {}
                  legal_structure: {}
                  country_of_incorporation: {}
                  incorporation_date:
                    format: date
                    type: string
                  registered_address: {}
                  contact_full_name: {}
                  contact_email: {}
                  contact_phone: {}
              else:
                additionalProperties: false
                required:
                  - first_name
                  - last_name
                  - email
                  - phone
                  - date_of_birth
                  - country_of_citizenship
                  - residential_address
                properties:
                  type: {}
                  party_roles: {}
                  ownership_percent: {}
                  first_name: {}
                  last_name: {}
                  email: {}
                  phone: {}
                  date_of_birth:
                    format: date
                    type: string
                  country_of_citizenship: {}
                  residential_address: {}
              additionalProperties: false
              type: object
              required:
                - type
                - party_roles
                - ownership_percent
              properties:
                type:
                  type: string
                  enum:
                    - individual
                    - company
                party_roles:
                  minItems: 1
                  uniqueItems: true
                  type: array
                  items:
                    type: string
                    enum:
                      - owner
                      - director
                      - executive
                      - representative
                ownership_percent:
                  pattern: ^(100(\.0{1,2})?|\d{1,2}(\.\d{1,2})?)$
                  description: >-
                    From `"0.00"`, which a director can hold, to `"100.00"`, to
                    two decimal places.
                  type: string
                first_name:
                  minLength: 1
                  maxLength: 30
                  pattern: \S
                  type: string
                last_name:
                  minLength: 1
                  maxLength: 30
                  pattern: \S
                  type: string
                email:
                  format: email
                  maxLength: 320
                  type: string
                  pattern: >-
                    ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
                phone:
                  pattern: ^\+[1-9]\d{1,14}$
                  type: string
                  minLength: 8
                date_of_birth:
                  format: date
                  type: string
                country_of_citizenship:
                  pattern: ^[A-Z]{2}$
                  type: string
                residential_address:
                  $ref: '#/components/schemas/AddressInput'
                legal_name:
                  minLength: 2
                  maxLength: 160
                  pattern: \S
                  type: string
                registration_number:
                  minLength: 4
                  maxLength: 20
                  type: string
                legal_structure:
                  type: string
                  enum:
                    - limited_liability_company
                    - private_limited_company
                    - public_limited_company
                    - general_partnership
                    - limited_liability_partnership
                    - limited_partnership
                    - limited_liability_entrepreneurial_company
                    - joint_stock_company
                    - single_member_llc
                    - multi_member_llc
                    - private_partnership
                    - private_corporation
                    - public_company
                country_of_incorporation:
                  pattern: ^[A-Z]{2}$
                  type: string
                incorporation_date:
                  format: date
                  type: string
                registered_address:
                  $ref: '#/components/schemas/AddressInput'
                contact_full_name:
                  minLength: 2
                  maxLength: 160
                  type: string
                contact_email:
                  format: email
                  maxLength: 320
                  type: string
                  pattern: >-
                    ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
                contact_phone:
                  pattern: ^\+[1-9]\d{1,14}$
                  type: string
                  minLength: 8
      responses:
        '201':
          description: The party, in the full view.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
            Location:
              description: The URL of the created resource.
              schema:
                type: string
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - result
                  - entities
                  - not_included
                properties:
                  result:
                    $ref: '#/components/schemas/PartyFull'
                  entities:
                    additionalProperties: false
                    description: Nothing can be included here.
                    type: object
                    properties: {}
                  not_included:
                    type: array
                    items:
                      $ref: '#/components/schemas/NotIncludedEntry'
        '400':
          description: >-
            `IDEMPOTENCY_KEY_REQUIRED`: This endpoint requires an
            Idempotency-Key header.


            `REGION_NOT_SUPPORTED`: A region isn't supported for this country.


            `VALIDATION_FAILED`: The request is malformed or failed validation.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - IDEMPOTENCY_KEY_REQUIRED
            - REGION_NOT_SUPPORTED
            - VALIDATION_FAILED
        '401':
          description: '`UNAUTHENTICATED`: A valid bearer token is required.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - UNAUTHENTICATED
        '403':
          description: >-
            `FORBIDDEN`: This credential doesn't have permission for this
            endpoint.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - FORBIDDEN
        '404':
          description: '`NOT_FOUND`: Not found.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - NOT_FOUND
        '406':
          description: '`NOT_ACCEPTABLE`: This endpoint doesn''t offer the format in Accept.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - NOT_ACCEPTABLE
        '409':
          description: >-
            `IDEMPOTENCY_IN_PROGRESS`: An earlier request with this
            Idempotency-Key hasn't finished. If this persists, contact support.


            `OWNERSHIP_TOTAL_EXCEEDED`: This would take total ownership past
            100%.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - IDEMPOTENCY_IN_PROGRESS
            - OWNERSHIP_TOTAL_EXCEEDED
        '422':
          description: >-
            `IDEMPOTENCY_KEY_REUSED`: This Idempotency-Key was used with a
            different request.


            `PARTY_NOT_ALLOWED`: An individual legal entity can't have parties.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - IDEMPOTENCY_KEY_REUSED
            - PARTY_NOT_ALLOWED
        '429':
          description: '`RATE_LIMITED`: Too many requests.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - RATE_LIMITED
        '500':
          description: '`INTERNAL_ERROR`: Something went wrong on our side.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - INTERNAL_ERROR
        '503':
          description: '`SERVICE_UNAVAILABLE`: The service is busy. Try again shortly.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - SERVICE_UNAVAILABLE
components:
  schemas:
    AddressInput:
      additionalProperties: false
      type: object
      required:
        - line1
        - city
        - country
        - postal_code
      properties:
        line1:
          minLength: 1
          type: string
        city:
          minLength: 1
          type: string
        country:
          pattern: ^[A-Z]{2}$
          type: string
        postal_code:
          type: string
          description: Empty in a country without postal codes, such as AE or HK.
        line2:
          anyOf:
            - type: string
            - type: 'null'
        region:
          anyOf:
            - allOf:
                - pattern: ^[A-Z]{2}-[A-Z0-9]{1,3}$
                  type: string
                - pattern: ^(US|CA|AU|NZ)-
                  type: string
              description: >-
                ISO 3166-2, of this address's country, which has to be one of
                US, CA, AU, NZ. Another region answers `REGION_NOT_SUPPORTED`.
            - type: 'null'
    PartyFull:
      additionalProperties: false
      type: object
      required:
        - _type
        - _uri
        - _view
        - id
        - created_at
        - updated_at
        - type
        - party_roles
        - ownership_percent
        - verification_status
        - first_name
        - last_name
        - email
        - phone
        - date_of_birth
        - country_of_citizenship
        - residential_address
        - legal_name
        - registration_number
        - legal_structure
        - country_of_incorporation
        - incorporation_date
        - registered_address
        - contact_full_name
        - contact_email
        - contact_phone
        - legal_entity
      properties:
        _type:
          const: party
          type: string
        _uri:
          pattern: ^/
          description: The canonical URI, relative to the version root.
          type: string
        _view:
          const: full
          type: string
        id:
          type: string
        created_at:
          anyOf:
            - format: date-time
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$
              type: string
            - type: 'null'
        updated_at:
          anyOf:
            - format: date-time
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$
              type: string
            - type: 'null'
        type:
          type: string
          enum:
            - individual
            - company
          description: >-
            Can't change. It selects which of the other fields apply, and the
            rest are `null`.
        party_roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - director
              - executive
              - representative
          description: >-
            A person who is a `director`, or who holds 25% or more whatever
            their role, can fill an identity check onboarding asks for. A
            company can fill none. Each once, in no order to rely on. Empty when
            no role listed here is held.
        ownership_percent:
          anyOf:
            - $ref: '#/components/schemas/Percent'
            - type: 'null'
          description: >-
            From `"0.00"` to `"100.00"`, to two decimal places, which a person
            can hold through a company. `null` when none is held, which
            onboarding reports.
        verification_status:
          type: string
          enum:
            - pending_verification
            - more_information_required
            - verified
            - rejected
          description: >-
            Quidkey's own decision, apart from any identity check. It stays as
            decided when the details change afterwards.


            - `pending_verification`: Quidkey has no decision standing, because
            it hasn't made one or took one back. Onboarding needs one party
            verified, so other parties can stay at this.

            - `more_information_required`: Quidkey needs something from the
            merchant.

            - `verified`: Quidkey verified it, as its details stood then.

            - `rejected`: Quidkey turned it down.
        first_name:
          anyOf:
            - type: string
            - type: 'null'
        last_name:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - format: email
              maxLength: 320
              type: string
            - type: 'null'
        phone:
          anyOf:
            - pattern: ^\+[1-9]\d{1,14}$
              type: string
            - type: 'null'
        date_of_birth:
          anyOf:
            - format: date
              type: string
            - type: 'null'
        country_of_citizenship:
          anyOf:
            - pattern: ^[A-Z]{2}$
              type: string
            - type: 'null'
        residential_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        legal_name:
          anyOf:
            - type: string
            - type: 'null'
        registration_number:
          anyOf:
            - type: string
            - type: 'null'
        legal_structure:
          anyOf:
            - type: string
              enum:
                - limited_liability_company
                - private_limited_company
                - public_limited_company
                - general_partnership
                - limited_liability_partnership
                - limited_partnership
                - limited_liability_entrepreneurial_company
                - joint_stock_company
                - single_member_llc
                - multi_member_llc
                - private_partnership
                - private_corporation
                - public_company
            - type: 'null'
        country_of_incorporation:
          anyOf:
            - pattern: ^[A-Z]{2}$
              type: string
            - type: 'null'
        incorporation_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
        registered_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        contact_full_name:
          anyOf:
            - type: string
            - type: 'null'
        contact_email:
          anyOf:
            - format: email
              maxLength: 320
              type: string
            - type: 'null'
        contact_phone:
          anyOf:
            - pattern: ^\+[1-9]\d{1,14}$
              type: string
            - type: 'null'
        legal_entity:
          $ref: '#/components/schemas/LegalEntityLink'
    NotIncludedEntry:
      additionalProperties: false
      type: object
      required:
        - link
        - reason
      properties:
        link:
          $ref: '#/components/schemas/AnyLink'
        reason:
          type: string
          enum:
            - no_permission
            - not_published
          description: >-
            Why this link has no entity.


            - `no_permission`: This credential can't read it. Fetching it
            answers 403, or 404 where a 403 would reveal that it exists.

            - `not_published`: The API doesn't show it: a type it doesn't
            publish, or a record it doesn't show on a type it does, such as a
            failed payout. Fetching it, where it has a URI, answers 404.
    Error:
      additionalProperties: false
      type: object
      required:
        - error
      properties:
        error:
          additionalProperties: false
          type: object
          required:
            - code
            - message
            - details
            - retryable
            - request_id
          properties:
            code:
              description: Branch on this. New codes can appear.
              type: string
            message:
              description: For people. It can change.
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
            retryable:
              description: >-
                Whether sending the same request again unchanged, after a wait,
                can succeed with nothing else changing.
              type: boolean
            request_id:
              description: Quote this to support.
              type: string
    Percent:
      pattern: ^\d+(\.\d+)?$
      description: 'A percentage as a decimal string: `"25.00"` is 25%.'
      type: string
    Address:
      additionalProperties: false
      type: object
      required:
        - line1
        - city
        - country
        - postal_code
        - line2
        - region
      properties:
        line1:
          minLength: 1
          type: string
        city:
          minLength: 1
          type: string
        country:
          pattern: ^[A-Z]{2}$
          type: string
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
        line2:
          anyOf:
            - type: string
            - type: 'null'
          description: Holds the apartment as well, where one was given.
        region:
          anyOf:
            - pattern: ^[A-Z]{2}-[A-Z0-9]{1,3}$
              type: string
            - type: 'null'
          description: >-
            ISO 3166-2, of this address's country. `null` where none is held,
            and for a country with no subdivisions Quidkey knows of, such as
            `GB-LND`.
    LegalEntityLink:
      additionalProperties: false
      type: object
      required:
        - _link
        - _type
        - id
      properties:
        _link:
          pattern: ^/
          type: string
        _type:
          const: legal_entity
          type: string
        id:
          type: string
      x-link-target:
        resource: legal_entity
        kind: resource
        is_published: true
        views:
          - full
    AnyLink:
      anyOf:
        - additionalProperties: false
          type: object
          required:
            - _link
            - _type
            - id
          properties:
            _link:
              pattern: ^/
              type: string
            _type:
              type: string
            id:
              type: string
        - additionalProperties: false
          type: object
          required:
            - _type
            - id
          properties:
            _type:
              type: string
            id:
              type: string
      x-link-target:
        resource: any
        kind: any
        is_published: true
    ErrorDetail:
      anyOf:
        - additionalProperties: false
          type: object
          required:
            - field
            - message
          properties:
            field:
              type: string
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - required_actions
            - message
          properties:
            required_actions:
              description: The `required_actions` codes holding this back.
              type: array
              items:
                type: string
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - available_percent
            - message
          properties:
            available_percent:
              $ref: '#/components/schemas/Percent'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - agreement
            - message
          properties:
            agreement:
              $ref: '#/components/schemas/AgreementLink'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - agreement
            - current_agreement
            - message
          properties:
            agreement:
              $ref: '#/components/schemas/AgreementLink'
            current_agreement:
              $ref: '#/components/schemas/AgreementLink'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - legal_entity
            - message
          properties:
            legal_entity:
              $ref: '#/components/schemas/LegalEntityLink'
            message:
              type: string
    AgreementLink:
      additionalProperties: false
      type: object
      required:
        - _link
        - _type
        - id
      properties:
        _link:
          pattern: ^/
          type: string
        _type:
          const: agreement
          type: string
        id:
          type: string
      x-link-target:
        resource: agreement
        kind: resource
        is_published: true
        views:
          - full
  headers:
    RequestId:
      description: Identifies this request. Quote it to support.
      schema:
        type: string
    IdempotentReplayed:
      description: '`true` on a retry that answers with the first attempt''s outcome.'
      schema:
        type: string
        enum:
          - 'true'
    RetryAfter:
      description: How many seconds to wait before retrying.
      schema:
        minimum: 0
        type: integer
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.