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



## OpenAPI

````yaml POST /batches
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:
    post:
      tags:
        - Batches
      summary: Create a new Operation Batch
      parameters:
        - $ref: '#/components/parameters/Authorization'
      requestBody:
        description: Batch to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchRequest'
            example:
              message: Invalid authorization header
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '401':
          description: Forbidden
          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:
    CreateBatchRequest:
      type: object
      properties:
        currency_pair:
          type: string
          description: Currency pair for the batch
      required:
        - currency_pair
    BatchResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the batch
        created_at:
          type: string
          format: date-time
          description: Timestamp when the batch was created
        currency_pair:
          type: string
          description: Currency pair for the batch
        status:
          type: string
          description: Current status of the batch
        operations:
          type: array
          items:
            $ref: '#/components/schemas/BatchOperationResponse'
          description: List of operations in the batch
        operation_count:
          type: integer
          description: Number of SWIFT operations in the batch
      required:
        - id
        - created_at
        - currency_pair
        - status
        - operation_count
    Error:
      required:
        - message
      type: object
      properties:
        message:
          description: message of the error
          type: string
    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
    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

````