> ## 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.

# Add Operation

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



## OpenAPI

````yaml POST /batches/{batch_id}
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:
  /batches/{batch_id}:
    post:
      tags:
        - Batches
      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: batch_id
          in: path
          required: true
          description: Batch ID
          content:
            application/json: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchOperationRequest'
      responses:
        '200':
          description: Counterparty registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchOperationResponse'
        '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:
    BatchOperationRequest:
      type: object
      properties:
        currency_amount:
          type: number
          format: double
          description: Amount in the specified currency
        customer_id:
          type: string
          description: Identifier of the customer
        counterparty_id:
          type: string
          description: Identifier of the counterparty
      required:
        - currency_amount
        - customer_id
        - counterparty_id
    BatchOperationResponse:
      type: object
      properties:
        operation_id:
          type: string
          description: Unique identifier of the operation
        foreign_currency_amount:
          type: number
          format: double
          description: Amount in foreign currency
        currency_pair:
          type: string
          description: Currency pair for the operation
        status:
          type: string
          description: Current status of the operation
        customer_id:
          type: string
          description: Identifier of the customer
        counterparty_id:
          type: string
          nullable: true
          description: Identifier of the counterparty
        bank_account:
          $ref: '#/components/schemas/BankAccount'
        intermediary_bank:
          allOf:
            - $ref: '#/components/schemas/Bank'
          nullable: true
        batch_id:
          type: string
          nullable: true
          description: Identifier of the associated batch
        created_at:
          type: string
          format: date-time
          description: Timestamp when the operation was created
      required:
        - operation_id
        - foreign_currency_amount
        - currency_pair
        - status
        - customer_id
        - bank_account
        - created_at
    Error:
      required:
        - message
      type: object
      properties:
        message:
          description: message of the error
          type: string
    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

````