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

# Create Counterparty

> Creates a new Counterparty under an existing Entity. A Counterparty represents an external party that funds can be sent to or received from. Counterparties can be either wallet addresses or bank accounts.



## OpenAPI

````yaml POST /counterparties
openapi: 3.1.0
info:
  title: Otim Platform API
  version: v0
  description: >-
    API for managing accounts, entities, transfers, counterparties, and IBANs on
    the Otim platform.
servers:
  - url: https://api.otim.com/v0
security:
  - bearerAuth: []
paths:
  /counterparties:
    post:
      tags: []
      summary: Create Counterparty
      description: >-
        Creates a new Counterparty under an existing Entity. A Counterparty
        represents an external party that funds can be sent to or received from.
        Counterparties can be either wallet addresses or bank accounts.
      operationId: createCounterparty
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCounterpartyRequest'
      responses:
        '201':
          description: Counterparty created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Counterparty'
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateCounterpartyRequest:
      type: object
      required:
        - entityId
        - name
        - type
      properties:
        entityId:
          type: string
          description: The ID of the Entity this Counterparty belongs to.
        name:
          type: string
          description: A display name for the Counterparty.
        type:
          type: string
          enum:
            - wallet
            - bank_account
          description: The type of Counterparty.
        bankName:
          type: string
          description: Name of the bank. Required when type is `bank_account`.
        accountNumber:
          type: string
          description: Bank account number. Required when type is `bank_account`.
        routingNumber:
          type: string
          description: Bank routing number. Required when type is `bank_account`.
        walletAddress:
          type: string
          description: Wallet address. Required when type is `wallet`.
        chain:
          type: string
          description: Chain for the wallet. Required when type is `wallet`.
          enum:
            - ethereum
            - base
            - arbitrum
            - optimism
            - polygon
    Counterparty:
      type: object
      properties:
        id:
          type: string
          example: cpty_01JA1B2C3D4E5F6G7H8J9K0L
        entityId:
          type: string
          example: ent_01JA1B2C3D4E5F6G7H8J9K0L
        name:
          type: string
          example: Acme Corp
        type:
          type: string
          enum:
            - wallet
            - bank_account
          example: bank_account
        bankName:
          type: string
          nullable: true
          example: Chase
        accountNumber:
          type: string
          nullable: true
          example: '****6789'
        routingNumber:
          type: string
          nullable: true
          example: '021000021'
        walletAddress:
          type: string
          nullable: true
          example: '0x1234567890abcdef1234567890abcdef12345678'
        chain:
          type: string
          nullable: true
          example: base
        createdAt:
          type: string
          format: date-time
          example: '2025-01-15T12:00:00Z'
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: A machine-readable error code.
        details:
          type: object
          nullable: true
          description: Additional context about the error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key prefixed with `sk_`.

````