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

# Create Counterparty

> This endpoint registers a new counterparty for a specified customer. The counterparty details are provided in the request body.



## OpenAPI

````yaml POST /customers/{customer_id}/counterparty
openapi: 3.0.1
info:
  title: Açoriana - FX as a Service
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  version: beta
servers:
  - url: https://fxaas-dev.acorianacorretora.com.br
security: []
paths:
  /customers/{customer_id}/counterparty:
    post:
      tags:
        - Counterparty
      summary: Register a new counterparty to a customer
      description: >-
        This endpoint registers a new counterparty for a specified customer. The
        counterparty details are provided in the request body.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - name: customer_id
          in: path
          required: true
          description: Customer id
          content:
            application/json: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCounterpartyRequest'
      responses:
        '200':
          description: Counterparty registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CounterpartyResponse'
        '400':
          description: Invalid input or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
        example: Bearer Token
      description: Authorization header
  schemas:
    CreateCounterpartyRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the counterparty
        counterparty_address:
          $ref: '#/components/schemas/Address'
        bank_account:
          $ref: '#/components/schemas/BankAccount'
        intermediary_bank:
          allOf:
            - $ref: '#/components/schemas/Bank'
          nullable: true
        external_id:
          type: string
          nullable: true
          description: External identifier for the counterparty
      required:
        - name
        - counterparty_address
        - bank_account
    CounterpartyResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the counterparty
        name:
          type: string
          description: Name of the counterparty
        counterparty_address:
          $ref: '#/components/schemas/Address'
        bank_account:
          $ref: '#/components/schemas/BankAccount'
        intermediary_bank:
          allOf:
            - $ref: '#/components/schemas/Bank'
          nullable: true
        external_id:
          type: string
          nullable: true
          description: External identifier for the counterparty
      required:
        - id
        - name
        - counterparty_address
        - bank_account
    Error:
      required:
        - message
      type: object
      properties:
        message:
          description: message of the error
          type: string
    Address:
      type: object
      properties:
        address:
          type: string
          description: Street address
        country:
          type: string
          description: Country name
        city:
          type: string
          description: City name
        state:
          type: string
          description: State or province
        zip_code:
          type: string
          description: Postal or ZIP code
      required:
        - address
        - country
        - city
        - zip_code
    BankAccount:
      type: object
      properties:
        bank_name:
          type: string
          description: Name of the bank
        swift_code:
          type: string
          description: SWIFT/BIC code of the bank
        bank_country:
          type: string
          description: Country where the bank is located
        account_number:
          type: string
          description: Bank account number
        iban:
          type: string
          description: International Bank Account Number
        aba_routing_number:
          type: string
          description: ABA/routing number for US banks
      required:
        - bank_name
        - swift_code
        - bank_country
        - account_number
    Bank:
      type: object
      properties:
        bank_name:
          type: string
          description: Name of the bank
        swift_code:
          type: string
          description: SWIFT/BIC code of the bank
        bank_country:
          type: string
          description: Country where the bank is located
      required:
        - bank_name
        - swift_code
        - bank_country

````