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

# Create counterparties



## OpenAPI

````yaml /openapi/main.json post /v1/crm/counterparties/
openapi: 3.0.3
info:
  title: Yume API — Основное
  version: 1.0.0
  description: Базовые сущности и бизнес-логика CRM.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/crm/counterparties/:
    post:
      tags:
        - counterparties
      summary: Create counterparties
      operationId: counterparties_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Counterparty'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Counterparty'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Counterparty'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Counterparty'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    Counterparty:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        access:
          type: array
          items:
            type: integer
          nullable: true
        deleted:
          type: boolean
          readOnly: true
        name:
          type: string
          maxLength: 255
        side:
          allOf:
            - $ref: '#/components/schemas/SideEnum'
          minimum: -32768
          maximum: 32767
        source:
          allOf:
            - $ref: '#/components/schemas/SourceEnum'
          minimum: -32768
          maximum: 32767
        type:
          allOf:
            - $ref: '#/components/schemas/Type6ecEnum'
          minimum: -32768
          maximum: 32767
        category:
          allOf:
            - $ref: '#/components/schemas/CategoryEnum'
          minimum: -32768
          maximum: 32767
        iin:
          type: string
          nullable: true
          maxLength: 12
          minLength: 12
        bin:
          type: string
          nullable: true
          maxLength: 12
          minLength: 12
        iban:
          type: string
          nullable: true
          maxLength: 25
        bank:
          type: string
          nullable: true
          maxLength: 255
        phone:
          type: string
          nullable: true
          maxLength: 32
        owner:
          type: string
          nullable: true
          maxLength: 255
        address:
          type: string
          nullable: true
          maxLength: 255
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        order:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        extra: {}
        tenant:
          type: integer
      required:
        - deleted
        - id
        - name
    SideEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Своё
        * `1` - Внешний
    SourceEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Магазин
        * `1` - Расход
    Type6ecEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      description: |-
        * `0` - ИП
        * `1` - ТОО
        * `2` - АО
        * `3` - ПК
    CategoryEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Приход
        * `1` - Расход
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````