x-generator: NSwag v14.6.1.0 (NJsonSchema v11.5.1.0 (Newtonsoft.Json v13.0.0.0))
openapi: 3.0.0
info:
  title: Bermuda Commercial Bank RESTful Open Banking API Implementation
  description: >+
    The Bermuda Commercial Bank (BCB) RESTful Open Banking API provides secure,
    programmatic access to BCB's banking services, enabling developers to
    integrate financial services into their applications.


    ### Key Features

    - Account details retrieval

    - Internal transfers

    - Payments (Swift)

    - Virtual Accounts

    - Transaction information access

    - Robust security and compliance

    - Comprehensive documentation

    ### Available Environments

    **UAT Environment**


    **URL:** https://api-uat.bcb.bm


    **Purpose:** Testing and integration


    **Production Environment**


    **URL:** https://api.bcb.bm


    **Purpose:** Live production use

  contact:
    name: >-
      Bermuda Commercial Bank Limited, 34 Bermudiana Road, Hamilton HM 11,
      Bermuda
    url: https://www.bcb.bm
    email: enquiries@bcb.bm
  version: v1
servers:
  - url: https://api-uat.bcb.bm
    description: UAT Environment - Used for testing and integration purposes
  - url: https://api.bcb.bm
    description: Production Environment - Live environment for production use
paths:
  /v1/accounts/{accountNumber}:
    get:
      tags:
        - Accounts
      summary: Account Details
      description: >-
        Retrieves the account details and balance. This endpoint requires
        authentication and returns comprehensive information for the specified
        account. The returned data includes:


        - **Number**: The human-readable account number assigned by the bank.

        - **Label**: A label provided by the account owner.

        - **Owners**: The list of users who own this account.

        - **Type**: The type of account.

        - **Balance**: The account's balance including currency and amount.

        - **Account Attributes**: Additional account information specific to
        Bermuda Commercial Bank.
                    
        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default).

        - Set `Accept: text/csv` for CSV responses.

        If the Accept header is omitted, `application/json` is assumed.
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/accounts

        ### Sample Request in JavaScript:


        ```javascript

        async function getAccountDetails(accountNumber) {
          try {
            const response = await fetch(`https://api.bcb.bm/v1/accounts/${accountNumber}`, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const data = await response.json();
            console.log('Account details:', data);

            // Example processing of the returned object
            const accountId = data.id;
            const accountNumber = data.number;
            const accountBalance = data.balance.amount;
            const accountCurrency = data.balance.currency;
            const accountStatus = data.accountAttributes.find(attr => attr.name === 'STATUS')?.value;
                    
            console.log('Account ID:', accountId);
            console.log('Account Number:', accountNumber);
            console.log('Account Balance:', accountBalance);
            console.log('Account Currency:', accountCurrency);
            console.log('Account Status:', accountStatus);
                    
            // Process all account attributes
            console.log('Account Attributes:');
            data.accountAttributes.forEach(attribute => {
              console.log(`${attribute.name}: ${attribute.value}`);
            });

            // Additional processing based on account status
            if (accountStatus === 'ACTIVE') {
              console.log('The account is active.');
            } else {
              console.log('The account is not active.');
            }
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
          }
        }


        // Example usage:

        getAccountDetails('YOUR_ACCOUNT_NUMBER');

        ```
      operationId: Accounts_Get
      parameters:
        - name: accountNumber
          in: path
          required: true
          description: The human-readable account number assigned by the bank.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
              examples:
                Json:
                  value:
                    accountType: Personal
                    nickname: CURRENT.ACCOUNTS
                    openingDate: '2023-01-01T00:00:00.0000000Z'
                    balanceEffectiveDate: '2023-12-31T00:00:00.0000000Z'
                    accountRoutings:
                      - scheme: AccountNumber
                        address: 1000078766
                    accountId: 1000078766-3000032
                    cif: 3000032
                    currency: USD
                    accountSubType: BCB.CURRENT.ACCOUNT.C
                    accountNumber: 1000078766
                    status: Active
                    availableBalance:
                      currency: USD
                      amount: 1000
                    owners:
                      - displayName: John Doe
                        accountHolderType: Primary
                      - displayName: Jane Doe
                        accountHolderType: Joint
                    accountAttributes:
                      - name: BANK_ID
                        value: BPBKBMHM
                      - name: JOINT_CIF
                        value: 3000033
                      - name: CREDIT_INTEREST_RATE
                        value: 2.5
                      - name: DEBIT_INTEREST_RATE
                        value: 0
                      - name: DEBIT_ACCRUED_INTEREST
                        value: 0
                      - name: CREDIT_ACCRUED_INTEREST
                        value: 0
                      - name: ACCRUAL_INTEREST
                        value: 0
                Csv:
                  value:
                    - "\uFEFF\"account_id\",\"cif\",\"account_number\",\"status\",\"currency\",\"available_balance_currency\",\"available_balance_amount\",\"account_sub_type\",\"account_type\",\"nickname\",\"opening_date\",\"balance_effective_date\",\"account_routings_0_scheme\",\"account_routings_0_address\",\"owners_0_display_name\",\"owners_0_account_holder_type\",\"owners_1_display_name\",\"owners_1_account_holder_type\",\"account_attributes_0_name\",\"account_attributes_0_value\",\"account_attributes_1_name\",\"account_attributes_1_value\",\"account_attributes_2_name\",\"account_attributes_2_value\",\"account_attributes_3_name\",\"account_attributes_3_value\",\"account_attributes_4_name\",\"account_attributes_4_value\",\"account_attributes_5_name\",\"account_attributes_5_value\",\"account_attributes_6_name\",\"account_attributes_6_value\""
                    - >-
                      "1000078766-3000032","3000032","1000078766","Active","USD","USD","1000.00","BCB.CURRENT.ACCOUNT.C","Personal","CURRENT.ACCOUNTS","2023-01-01T00:00:00Z","2023-12-31T00:00:00Z","AccountNumber","1000078766","John
                      Doe","Primary","Jane
                      Doe","Joint","BANK_ID","BPBKBMHM","JOINT_CIF","3000033","CREDIT_INTEREST_RATE","2.5","DEBIT_INTEREST_RATE","0","DEBIT_ACCRUED_INTEREST","0","CREDIT_ACCRUED_INTEREST","0","ACCRUAL_INTEREST","0"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - The account was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/accounts:
    get:
      tags:
        - Accounts
      summary: List User Accounts
      description: >-
        Retrieves a list of all accounts associated with the authenticated
        user's profile. This endpoint:


        - Uses the customer account number from the authenticated user's session
        to fetch all associated accounts.

        - Requires valid authentication.

        - Supports both JSON and CSV response formats based on the Accept
        header.

        - Returns a summary version of account information (AccountSummary)
        containing only essential fields

        - **Supports cursor-based pagination** for efficient handling of large
        account lists.


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `page_size` (default: 100, max:
        1000). The server creates a cursor and returns a `page_token`.

        - **Subsequent Requests**: Use the `page_token` from previous responses
        with `page_start` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        page_size, so don't specify `page_size` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default).

        - Set `Accept: text/csv` for CSV responses.

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/accounts

        ### Sample Request in JavaScript


        ```javascript

        async function getAllAccountsPaginated() {
          try {
            let allAccounts = [];
            let pageStart = 1;
            let pageToken = null;
            let totalPages = 0;

            do {
              // Build URL with pagination parameters
              let url = 'https://api.bcb.bm/v1/accounts';
              const params = new URLSearchParams();
              
              if (pageStart === 1) {
                // First request: specify page_size
                params.append('page_size', '100');
              } else {
                // Subsequent requests: use page_token and page_start
                params.append('page_token', pageToken);
                params.append('page_start', pageStart.toString());
              }
              
              if (params.toString()) {
                url += '?' + params.toString();
              }

              const response = await fetch(url, {
                method: 'GET',
                headers: {
                  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                  'Content-Type': 'application/json',
                  'Accept': 'application/json'
                }
              });

              if (!response.ok) {
                const errorData = await response.json();
                throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
              }

              const data = await response.json();
              console.log(`Page ${pageStart} data:`, data);

              // Store pagination info from first request
              if (pageStart === 1 && data.meta && data.meta.pagination) {
                pageToken = data.meta.pagination.page_token;
                totalPages = Math.ceil(data.meta.pagination.total_size / data.meta.pagination.page_size);
                console.log(`Total pages: ${totalPages}, Page token: ${pageToken}`);
              }

              // Collect accounts from this page
              if (data.data && data.data.length > 0) {
                allAccounts.push(...data.data);
                console.log(`Collected ${data.data.length} accounts from page ${pageStart}`);
              }

              pageStart++;
            } while (pageStart <= totalPages);

            console.log(`Total accounts collected: ${allAccounts.length}`);

            // Process all collected accounts
            allAccounts.forEach((account, index) => {
              console.log(`Account ${index + 1}: ${account.number}`);
              console.log(`Balance: ${account.balance.amount} ${account.balance.currency}`);
            });

            return allAccounts;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Function to get a specific page of accounts

        async function getAccountsPage(pageStart, pageToken = null) {
          try {
            // Build URL
            let url = 'https://api.bcb.bm/v1/accounts';
            const params = new URLSearchParams();
            
            if (pageStart === 1) {
              // First request: specify page_size
              params.append('page_size', '100');
            } else {
              // Subsequent requests: use page_token and page_start
              params.append('page_token', pageToken);
              params.append('page_start', pageStart.toString());
            }
            
            if (params.toString()) {
              url += '?' + params.toString();
            }

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const data = await response.json();
            console.log('Accounts page:', data);
            return data;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Example usage:

        getAllAccountsPaginated(); // Retrieves all accounts across multiple
        pages

        // OR

        getAccountsPage(1).then(firstPage => {
          console.log('First page:', firstPage);
          // Use firstPage.meta.pagination.page_token for subsequent requests
        });

        ```
      operationId: Accounts_GetAll
      parameters:
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 1
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 2
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 3
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfAccountOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 2
                        pageToken: 202407250072428721.02,99
                        totalSize: 955
                        pageSize: 99
                    data:
                      - accountId: 12345678901
                        cif: 3000032
                        currency: USD
                        accountSubType: CURRENT.ACCOUNTS
                        accountNumber: 1000078766
                        status: ACTIVE
                        availableBalance:
                          currency: USD
                          amount: 1000
                        owners:
                          - displayName: John Doe
                            accountHolderType: Primary
                          - displayName: Jane Doe
                            accountHolderType: Joint
                        accountAttributes:
                          - name: OPEN_DATE
                            value: '2023-01-01'
                          - name: STATUS
                            value: ACTIVE
                          - name: ACCOUNT_TYPE
                            value: CURRENT.ACCOUNTS
                      - accountId: 98765432109
                        cif: 3000033
                        currency: EUR
                        accountSubType: SAVINGS.ACCOUNTS
                        accountNumber: 2000087654
                        status: INACTIVE
                        availableBalance:
                          currency: EUR
                          amount: 500
                        owners:
                          - displayName: Alice Smith
                            accountHolderType: Primary
                        accountAttributes:
                          - name: OPEN_DATE
                            value: '2022-06-15'
                          - name: STATUS
                            value: INACTIVE
                          - name: ACCOUNT_TYPE
                            value: SAVINGS.ACCOUNTS
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_account_id\",\"data_0_cif\",\"data_0_account_number\",\"data_0_status\",\"data_0_currency\",\"data_0_available_balance_currency\",\"data_0_available_balance_amount\",\"data_0_account_sub_type\",\"data_0_owners_0_display_name\",\"data_0_owners_0_account_holder_type\",\"data_0_owners_1_display_name\",\"data_0_owners_1_account_holder_type\",\"data_0_account_attributes_0_name\",\"data_0_account_attributes_0_value\",\"data_0_account_attributes_1_name\",\"data_0_account_attributes_1_value\",\"data_0_account_attributes_2_name\",\"data_0_account_attributes_2_value\",\"data_1_account_id\",\"data_1_cif\",\"data_1_account_number\",\"data_1_status\",\"data_1_currency\",\"data_1_available_balance_currency\",\"data_1_available_balance_amount\",\"data_1_account_sub_type\",\"data_1_owners_0_display_name\",\"data_1_owners_0_account_holder_type\",\"data_1_account_attributes_0_name\",\"data_1_account_attributes_0_value\",\"data_1_account_attributes_1_name\",\"data_1_account_attributes_1_value\",\"data_1_account_attributes_2_name\",\"data_1_account_attributes_2_value\""
                    - >-
                      "2","202407250072428721.02,99","955","99","12345678901","3000032","1000078766","ACTIVE","USD","USD","1000.00","CURRENT.ACCOUNTS","John
                      Doe","Primary","Jane
                      Doe","Joint","OPEN_DATE","2023-01-01","STATUS","ACTIVE","ACCOUNT_TYPE","CURRENT.ACCOUNTS","98765432109","3000033","2000087654","INACTIVE","EUR","EUR","500.00","SAVINGS.ACCOUNTS","Alice
                      Smith","Primary","OPEN_DATE","2022-06-15","STATUS","INACTIVE","ACCOUNT_TYPE","SAVINGS.ACCOUNTS"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - No accounts were found for the customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/credentials:
    post:
      tags:
        - Credentials
      summary: Create new API client credentials
      description: >-
        Creates new API client credentials based on an existing client's
        permissions and configuration.

        The new credentials will inherit the same roles and permissions as the
        specified existing client.

         **Key Features**:
        - A new client ID (GUID) is generated automatically

        - A cryptographically secure password (22-30 characters) is generated
        automatically

        - All roles and direct permissions are copied from the existing client

        - The new credentials can have different IP restrictions if specified


        **Password Security:**

        - Generated passwords are 22-30 characters long for enhanced security

        - Include uppercase letters, lowercase letters, digits, and special
        characters

        - The generated password is only returned once in the response


        **Access Control:**

        - You can only create credentials based on clients you have access to

        - New client inherits exact role and permission set from source client

        - IP restrictions can be customized or inherited from source client
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/credentials
            
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Sample Request in JavaScript:


        ```javascript

        async function createCredentials() {
          try {
            const token = localStorage.getItem('jwt'); // Your JWT token from authentication
            
            const response = await fetch('https://api.bcb.bm/v1/credentials', {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Authorization': `Bearer ${token}`
              },
              body: JSON.stringify({
                allowedIps: '192.168.1.100,10.0.0.0/24' // Optional: specify IP restrictions, or omit/'*' for all IPs
              })
            });
            
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || response.statusText}`);
            }
            
            const data = await response.json();
            console.log('New credentials created:', {
              clientId: data.clientId,
              clientSecret: data.clientSecret, // Save this securely - only shown once!
              isActive: data.isActive,
              allowedIps: data.allowedIps
            });
            
            // Store new credentials securely
            // WARNING: This is just an example - use secure storage in production
            localStorage.setItem('newClientId', data.clientId);
            localStorage.setItem('newClientSecret', data.clientSecret);
            
          } catch (error) {
            console.error('Error creating credentials:', error);
          }
        }


        createCredentials();

        ```
      operationId: Credentials_Post
      requestBody:
        x-name: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiClientCredentialsCreateRequest'
            example:
              allowedIps: 192.168.1.1,192.168.1.2
        x-position: 1
      responses:
        '201':
          description: Credentials created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClientCredentialsCreateResponse'
              example:
                clientId: a1b2c3d4-e5f6-4789-b012-3456789abcde
                clientSecret: Abc123XyzP9mN7kLAbc123XyzP95
                isActive: true
                allowedIps: 192.168.1.1,192.168.1.2
        '400':
          description: Invalid request data or validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Insufficient permissions or unauthorized access to the existing
            client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Request is already being processed (idempotency conflict)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/credentials/{clientId}:
    patch:
      tags:
        - Credentials
      summary: Rotate the client secret for an existing API client
      description: >-
        Rotates (changes) the client secret for an existing API client while
        preserving all other settings.

        This is useful for credential rotation policies, security incident
        response, or regular maintenance.

         **Key Features**:
        - A new cryptographically secure password (22-30 characters) is
        generated automatically

        - The existing client's secret is immediately replaced with the new one

        - All roles, permissions, and other settings remain unchanged

        - The old secret becomes invalid immediately after successful rotation

        - The new secret is returned in the response (only shown once)


        **Password Security:**

        - Generated passwords are 22-30 characters long for enhanced security

        - Include uppercase letters, lowercase letters, digits, and special
        characters

        - The new password is only returned once in the response


        **Access Control:**

        - You can only rotate secrets for clients you have access to

        - The rotated client retains all existing roles and permissions


        **Important Security Notes:**

        - The old secret stops working immediately after successful rotation

        - Any applications using the old secret will need to be updated with the
        new secret

        - Store the new secret securely as it won't be shown again
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/credentials/{clientId}
            
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Sample Request in JavaScript:


        ```javascript

        async function rotateClientSecret(clientId) {
          try {
            const token = localStorage.getItem('jwt'); // Your JWT token from authentication
            
            const response = await fetch(`https://api.bcb.bm/v1/credentials/${clientId}`, {
              method: 'PATCH',
              headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Authorization': `Bearer ${token}`
              }
            });
            
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || response.statusText}`);
            }
            
            const data = await response.json();
            console.log('Client secret rotated successfully:', {
              clientId: data.clientId,
              newClientSecret: data.clientSecret, // Save this securely - only shown once!
              isActive: data.isActive,
              allowedIps: data.allowedIps
            });
            
            // Update stored credentials securely
            // WARNING: This is just an example - use secure storage in production
            localStorage.setItem('clientSecret', data.clientSecret);
            
            // Important: Update any applications using the old secret
            console.warn('IMPORTANT: Update all applications using this client with the new secret!');
            
          } catch (error) {
            console.error('Error rotating client secret:', error);
          }
        }


        // Example usage

        rotateClientSecret('12345678-1234-1234-1234-123456789abc');

        ```
      operationId: Credentials_Patch
      parameters:
        - name: clientId
          in: path
          required: true
          description: The unique identifier of the client whose secret should be rotated
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: Secret rotated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClientCredentialsCreateResponse'
              examples:
                Example 1:
                  value:
                    clientId: a1b2c3d4-e5f6-4789-b012-3456789abcde
                    clientSecret: Abc123XyzP9mN7kLAbc123XyzP95
                    isActive: true
                    allowedIps: 192.168.1.1,192.168.1.2
                Example 2:
                  value:
                    clientId: a1b2c3d4-e5f6-7890-abcd-123456789def
                    clientSecret: ''
                    isActive: false
                    allowedIps: 192.168.1.100,10.0.0.0/24
        '400':
          description: Invalid request or client validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient permissions or unauthorized access to the client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
    delete:
      tags:
        - Credentials
      summary: Disable an existing API client
      description: >-
        Disables an existing API client, immediately preventing any further
        authentication using that client ID and secret.

        This operation also revokes all active tokens associated with the
        client.

         **Key Features**:
        - Disables the credentials instantly – all authentication requests will
        fail after this operation

        - Revokes all active tokens immediately for enhanced security

        - Idempotent: calling the endpoint on an already inactive client returns
        success


        **Security Considerations:**

        - All active tokens are immediately invalidated and removed from the
        system

        - Any applications using the disabled client will lose access
        immediately

        - The client record is preserved for audit and compliance purposes


        **Access Control:**

        - You can only disable clients that belong to your organization
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/credentials/{clientId}

        ### Sample Request in JavaScript:


        ```javascript

        async function disableClient(clientId) {
          try {
            const token = localStorage.getItem('jwt'); // Your JWT token from authentication
            
            const response = await fetch(`https://api.bcb.bm/v1/credentials/${clientId}`, {
              method: 'DELETE',
              headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Authorization': `Bearer ${token}`
              }
            });
            
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || response.statusText}`);
            }
            
            const data = await response.json();
            console.log('Client disabled successfully:', {
              clientId: data.clientId,
              isActive: data.isActive, // Should be false
              allowedIps: data.allowedIps
            });
            
            // Important: Update any applications that were using this client
            console.warn('IMPORTANT: All applications using this client will lose access immediately!');
            
          } catch (error) {
            console.error('Error disabling client:', error);
          }
        }


        // Example usage

        disableClient('12345678-1234-1234-1234-123456789abc');

        ```
      operationId: Credentials_Delete
      parameters:
        - name: clientId
          in: path
          required: true
          description: The unique identifier of the client to disable
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: Client disabled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClientCredentialsCreateResponse'
              example:
                clientId: a1b2c3d4-e5f6-7890-abcd-123456789def
                clientSecret: ''
                isActive: false
                allowedIps: 192.168.1.100,10.0.0.0/24
        '400':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient permissions or unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Client not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/credentials/{clientId}/permissions:
    get:
      tags:
        - Credentials
      summary: Get permissions for an existing API client
      description: >-
        Retrieves all permissions assigned to the specified API client. The
        response provides a comprehensive view of

        what features the client can access.

         **Key Features**:
        - Returns all permissions assigned to the client

        - Results are sorted alphabetically by permission key for consistent
        ordering

        - Includes human-readable descriptions for each permission


        **Access Control:**

        - You can only view permissions for clients that belong to your
        organization


        **Use Cases:**

        - Audit client access capabilities

        - Troubleshoot authentication and authorization issues

        - Verify client configuration during security reviews

        - Document client permissions for compliance purposes
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/credentials/{clientId}/permissions

        ### Sample Request in JavaScript:


        ```javascript

        async function getClientPermissions(clientId) {
          try {
            const token = localStorage.getItem('jwt'); // Your JWT token from authentication
            
            const response = await fetch(`https://api.bcb.bm/v1/credentials/${clientId}/permissions`, {
              method: 'GET',
              headers: {
                'Accept': 'application/json',
                'Authorization': `Bearer ${token}`
              }
            });
            
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || response.statusText}`);
            }
            
            const permissions = await response.json();
            console.log('Client permissions:', permissions);
            
            // Display permissions in a user-friendly format
            permissions.forEach(permission => {
              console.log(`- ${permission.key}: ${permission.description || 'No description available'}`);
            });
            
            return permissions;
            
          } catch (error) {
            console.error('Error retrieving client permissions:', error);
          }
        }


        // Example usage

        getClientPermissions('12345678-1234-1234-1234-123456789abc');

        ```
      operationId: Credentials_GetPermissions
      parameters:
        - name: clientId
          in: path
          required: true
          description: The unique identifier of the client to retrieve permissions for
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: Permissions retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PermissionResponse'
              example:
                - key: get-account
                  description: Allows access to retrieve individual account information
                - key: get-all-accounts
                  description: Allows access to retrieve all accounts for a customer
                - key: get-fx-quote
                  description: Allows access to foreign exchange quote endpoints
                - key: get-transactions
                  description: Allows access to transaction history endpoints
                - key: get-payment-status
                  description: Allows access to payment status tracking endpoints
                - key: make-internal-transfer
                  description: Allows execution of internal transfers between accounts
                - key: make-payment-swift
                  description: Allows execution of SWIFT payment transactions
                - key: manage-credentials
                  description: Allows management of API client credentials and permissions
        '400':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient permissions or unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/fx-quotes:
    get:
      tags:
        - Fx Quotes
      summary: Get FX Quote
      description: >-
        Retrieves a foreign exchange quote for converting between currencies
        (for the requested pair and amount).

        The same quote will be automatically applied by the system to any
        internal transfer or payment involving two different currencies,
        provided it is used within its expiry time.
                    
        ### High-Value Exchange Requests (> 100 000 BMD)

        If the requested exchange amount exceeds **100 000 BMD**, the system
        will **not return an automatic quote** in the `GET /v1/fx-quotes`
        response.  

        Instead, the request is routed for **manual processing by our treasury
        desk** to secure the most competitive rate available.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/fx-quotes

        ### Validation Rules

        - Currencies must be valid three-letter ISO 4217 codes

        - Unit currency and currency of transfer must be different

        - Instructed amount must be a valid decimal number with up to 2 decimal
        places


        ### Sample Request in JavaScript:

        ```javascript

        // Get FX quote for converting 100 USD to EUR

        const getFxQuote = async (unitCurrency, currencyOfTransfer,
        instructedAmount) => {
          try {
            const response = await fetch(
              'https://api.bcb.bm/v1/fx-quotes?' + 
              new URLSearchParams({
                unitCurrency: unitCurrency,
                currencyOfTransfer: currencyOfTransfer,
                instructedAmount: instructedAmount
              }), {
                method: 'GET',
                headers: {
                  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                  'Content-Type': 'application/json',
                  'Accept': 'application/json'
                }
            });

            // Check if the response is ok (status in the range 200-299)
            if (!response.ok) {
              // Parse error response
              const errorData = await response.json();
              throw new Error(`Error ${response.status}: ${errorData.error} - ${errorData.message}`);
            }

            // Parse successful response
            const quote = await response.json();
            
            // Log the complete quote details
            console.log('FX Quote Details:');
            console.log(`Source Currency: ${quote.sourceCurrency.currency}`);
            console.log(`Source Amount: ${quote.sourceCurrency.amount}`);
            console.log(`Target Currency: ${quote.targetCurrency.currency}`);
            console.log(`Target Amount: ${quote.targetCurrency.amount}`);
            console.log(`Exchange Rate: ${quote.exchangeRate}`);
            console.log(`Quote Expires: ${new Date(quote.expiryDateTime).toLocaleString()}`);

            // Return the processed quote
            return {
              ...quote,
              // Add formatted values for display
              formattedSourceAmount: new Intl.NumberFormat('en-US', {
                style: 'currency',
                currency: quote.sourceCurrency.currency
              }).format(quote.sourceCurrency.amount),
              formattedTargetAmount: new Intl.NumberFormat('en-US', {
                style: 'currency',
                currency: quote.targetCurrency.currency
              }).format(quote.targetCurrency.amount)
            };
          } catch (error) {
            // Handle different types of errors
            if (error.name === 'TypeError') {
              console.error('Network error:', error.message);
            } else {
              console.error('API error:', error.message);
            }
            throw error; // Re-throw to let caller handle it
          }
        };
                    
        // Example usage with error handling:

        try {
          const quote = await getFxQuote('USD', 'EUR', '100.00');
          console.log('Formatted Quote:', quote.formattedSourceAmount, '→', quote.formattedTargetAmount);
        } catch (error) {
          console.error('Failed to get FX quote:', error.message);
        }

        ```
      operationId: FxQuotes_Get
      parameters:
        - name: unitCurrency
          in: query
          required: true
          description: >-
            Currency that will be converted from. Must be a valid 3-letter ISO
            currency code (e.g., USD, EUR, GBP).
          schema:
            type: string
            maxLength: 3
            minLength: 3
          x-position: 1
        - name: currencyOfTransfer
          in: query
          required: true
          description: >-
            Currency that will be converted to. Must be a valid 3-letter ISO
            currency code (e.g., USD, EUR, GBP). Must be different from the unit
            currency.
          schema:
            type: string
            maxLength: 3
            minLength: 3
          x-position: 2
        - name: instructedAmount
          in: query
          required: true
          description: >-
            The amount to be converted from the unit currency. Must be a valid
            decimal number with up to 2 decimal places (e.g., "100.00").
          schema:
            type: string
          x-position: 3
      responses:
        '200':
          description: OK - The request was successful. Returns the FX quote details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FxQuote'
              examples:
                Json:
                  value:
                    sourceCurrency:
                      currency: USD
                      amount: 1000
                    targetCurrency:
                      currency: EUR
                      amount: 902.5
                    expiryDateTime: '2024-05-25T10:15:00.0000000Z'
                    exchangeRate: 0.9025
                Csv:
                  value:
                    - "\uFEFF\"source_currency_currency\",\"source_currency_amount\",\"target_currency_currency\",\"target_currency_amount\",\"expiry_date_time\",\"exchange_rate\""
                    - >-
                      "USD","1000.00","EUR","902.50","2024-05-25T10:15:00Z","0.9025"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/internal-transfers:
    post:
      tags:
        - Internal Transfers
      summary: Internal Transfer
      description: >-
        Initiates an internal funds transfer between two accounts within the
        institution. 

        The request must include source and destination account details, along
        with the amount and currency to be transferred. 

        Optionally, clients may provide a transaction reference and remittance
        information describing the purpose of the payment.


        - debitAccountNumber: The account number from which funds will be
        debited.

        - debitAmountCurrency: The currency code for the debit amount. Must
        match the credit account currency.

        - creditAccountNumber: The account number to be credited.

        - creditAmountCurrency: The currency code for the credit amount. Must
        match the debit account currency.

        - debitAmount: The amount to be transferred.

        - endToEndIdentification: (Optional) A unique reference provided by the
        client to identify the transaction end-to-end.

        - remittanceInformation: (Optional) Free-text remittance information
        describing the purpose of the transaction.
                    
        ### Important Notes:

        - Transfers between accounts with different currencies are not allowed.
        The debit and credit account currencies must match.

        - Ensure all inputs are validated and the source account has sufficient
        funds before making the request.
                    
        ### High-Value Exchange Requests (> 100 000 BMD)

        If the requested exchange amount exceeds **100 000 BMD**, the `POST
        /v1/transfers/internal` endpoint will **not return an immediate
        confirmation**. 

        Instead, the request is routed for **manual processing by our treasury
        desk** to secure the most competitive rate available.


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").
                    
        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default).

        - Set `Accept: text/csv` for CSV responses.

        If the Accept header is omitted, `application/json` is assumed.
                    
        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/internal-transfers
                    
        ### Sample Request in JavaScript:
                    
        ```javascript

        async function executeInternalTransfer() {
          try {
            const response = await fetch('https://api.bcb.bm/v1/internal-transfers', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional: UUID format required if provided
              },
              body: JSON.stringify({
                debitAccountNumber: "12345678901234567890123456",
                debitAmountCurrency: "USD",
                creditAccountNumber: "98765432109876543210987654",
                creditAmountCurrency: "USD", // Must match debitAmountCurrency
                debitAmount: "100.00",
                endToEndIdentification: "REF-INV-20250417-001", // Optional external transaction reference
                remittanceInformationUnstructured: "Payment for invoice #12345" // Optional payment description
              })
            });
                    
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Transfer failed: ${JSON.stringify(errorData)}`);
            }
                    
            const data = await response.json();
            console.log('Transfer result:', data);
                    
            // Example processing of the returned object
            const { id, status, uniqueIdentifier, internalTransferDetails, linkedActivities } = data;
            const { amountCredited, creditAmountCurrency, debitAmount, amountDebited, chargeAmount, valueDate, chargeAnalysisReceiver, chargeAnalysisSender, debitAccountNumber, creditAccountNumber, chargeAccountNumber } = internalTransferDetails;

            // Log the main transfer details.
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Amount Credited:', amountCredited.amount, amountCredited.currency);
            console.log('Credit Amount Currency:', creditAmountCurrency);
            console.log('Debit Amount:', debitAmount.amount, debitAmount.currency);
            console.log('Amount Debited:', amountDebited.amount, amountDebited.currency);
            console.log('Charge Amount:', chargeAmount.amount, chargeAmount.currency);
            console.log('Value Date:', valueDate);
            console.log('Charge Analysis Receiver:', chargeAnalysisReceiver);
            console.log('Charge Analysis Sender:', chargeAnalysisSender);
                    
            // Process debit account information.
            console.log('Debit Account Number:', debitAccountNumber.number);
            if (debitAccountNumber.accountRoutings) {
              debitAccountNumber.accountRoutings.forEach(routing => {
                console.log('Debit Account Routing Scheme:', routing.scheme);
                console.log('Debit Account Routing Address:', routing.address);
              });
            }
                    
            // Process credit account information.
            console.log('Credit Account Number:', creditAccountNumber.number);
            if (creditAccountNumber.accountRoutings) {
              creditAccountNumber.accountRoutings.forEach(routing => {
                console.log('Credit Account Routing Scheme:', routing.scheme);
                console.log('Credit Account Routing Address:', routing.address);
              });
            }
                    
            // Process charge account information.
            console.log('Charge Account Number:', chargeAccountNumber.number);
            if (chargeAccountNumber.accountRoutings) {
              chargeAccountNumber.accountRoutings.forEach(routing => {
                console.log('Charge Account Routing Scheme:', routing.scheme);
                console.log('Charge Account Routing Address:', routing.address);
              });
            }
                    
            // Process linked activities.
            linkedActivities.forEach(activity => {
              console.log('Linked Activity ID:', activity.id);
              console.log('Linked Activity Transaction Status:', activity.transactionStatus);
              console.log('Linked Activity Status:', activity.status);
              console.log('Linked Activity Unique Identifier:', activity.uniqueIdentifier);
              const { arrangementId, activityId, productId, currencyId, effectiveDate } = activity.activityDetails;
              console.log('Linked Activity Arrangement ID:', arrangementId);
              console.log('Linked Activity Activity ID:', activityId);
              console.log('Linked Activity Product ID:', productId);
              console.log('Linked Activity Currency ID:', currencyId);
              console.log('Linked Activity Effective Date:', effectiveDate);
            });
                    
            // Final status logging.
            if (status === 'SUCCESS') {
              console.log('The transfer was successful.');
            } else {
              console.log('The transfer failed:', status);
            }
          } catch (error) {
            console.error('Error executing internal transfer:', error);
          }
        }
                    
        executeInternalTransfer();

        ```
      operationId: InternalTransfers_Post
      requestBody:
        x-name: transfer
        description: The internal transfer request details.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InternalTransferRequest'
            example:
              endToEndIdentification: REF-INV-20250417-001
              remittanceInformation: 'Payment for invoice #12345'
              debitAccountNumber: 987654321098765
              debitAmountCurrency: USD
              creditAccountNumber: 123456789012345
              creditAmountCurrency: USD
              debitAmount: 100
        x-position: 1
      responses:
        '201':
          description: The transfer was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalTransfer'
              examples:
                Json:
                  value:
                    id: internal-transfer-123
                    status: COMPLETED
                    uniqueIdentifier: unique-identifier-123
                    internalTransferDetails:
                      amountCredited:
                        currency: USD
                        amount: 100
                      creditAmountCurrency: USD
                      debitAmount:
                        currency: USD
                        amount: 100
                      amountDebited:
                        currency: USD
                        amount: 100
                      chargeAmount:
                        currency: USD
                        amount: 5
                      valueDate: '2023-05-31'
                      chargeAnalysisReceiver: Receiver Charge Analysis
                      chargeAnalysisSender: Sender Charge Analysis
                      debitAccountNumber:
                        number: 123456789
                        accountRoutings:
                          - scheme: IBAN
                            address: IBAN123456789
                      creditAccountNumber:
                        number: 987654321
                        accountRoutings:
                          - scheme: IBAN
                            address: IBAN987654321
                      chargeAccountNumber:
                        number: charge123
                        accountRoutings:
                          - scheme: IBAN
                            address: IBANcharge123
                    linkedActivities:
                      - id: activity123
                        transactionStatus: SUCCESS
                        status: COMPLETED
                        uniqueIdentifier: unique-activity-123
                        activityDetails:
                          arrangementId: arrangement123
                          activityId: activity123
                          productId: product123
                          currencyId: USD
                          effectiveDate: '2023-05-31'
                Csv:
                  value:
                    - "\uFEFF\"id\",\"status\",\"unique_identifier\",\"internal_transfer_details_amount_credited_currency\",\"internal_transfer_details_amount_credited_amount\",\"internal_transfer_details_credit_amount_currency\",\"internal_transfer_details_debit_amount_currency\",\"internal_transfer_details_debit_amount_amount\",\"internal_transfer_details_amount_debited_currency\",\"internal_transfer_details_amount_debited_amount\",\"internal_transfer_details_charge_amount_currency\",\"internal_transfer_details_charge_amount_amount\",\"internal_transfer_details_value_date\",\"internal_transfer_details_charge_analysis_receiver\",\"internal_transfer_details_charge_analysis_sender\",\"internal_transfer_details_debit_account_number_number\",\"internal_transfer_details_debit_account_number_account_routings_0_scheme\",\"internal_transfer_details_debit_account_number_account_routings_0_address\",\"internal_transfer_details_credit_account_number_number\",\"internal_transfer_details_credit_account_number_account_routings_0_scheme\",\"internal_transfer_details_credit_account_number_account_routings_0_address\",\"internal_transfer_details_charge_account_number_number\",\"internal_transfer_details_charge_account_number_account_routings_0_scheme\",\"internal_transfer_details_charge_account_number_account_routings_0_address\",\"linked_activities_0_id\",\"linked_activities_0_transaction_status\",\"linked_activities_0_status\",\"linked_activities_0_unique_identifier\",\"linked_activities_0_activity_details_arrangement_id\",\"linked_activities_0_activity_details_activity_id\",\"linked_activities_0_activity_details_product_id\",\"linked_activities_0_activity_details_currency_id\",\"linked_activities_0_activity_details_effective_date\""
                    - >-
                      "internal-transfer-123","COMPLETED","unique-identifier-123","USD","100.00","USD","USD","100.00","USD","100.00","USD","5.00","2023-05-31","Receiver
                      Charge Analysis","Sender Charge
                      Analysis","123456789","IBAN","IBAN123456789","987654321","IBAN","IBAN987654321","charge123","IBAN","IBANcharge123","activity123","SUCCESS","COMPLETED","unique-activity-123","arrangement123","activity123","product123","USD","2023-05-31"
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/payments/swift:
    post:
      tags:
        - Payments
      summary: SWIFT Payment
      description: >-
        Initiates a SWIFT payment transfer. The request must include all
        required payment details including:

        - Source and destination account information

        - Payment amount and currency

        - Beneficiary details

        - Payment purpose and reference information
                    
        ### Key Features:

        - Supports international wire transfers via SWIFT network

        - Implements idempotency to prevent duplicate transactions

        - Validates payment requests before processing

        - Supports both JSON and CSV response formats


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/payments/swift
            
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Sample Request in JavaScript:


        ```javascript

        async function processSwiftPayment() {
          try {
            const response = await fetch('https://api.bcb.bm/v1/payments/swift', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional: UUID format required if provided
              },
              body: JSON.stringify({
                instructionIdentification: "PAYMENT-123456",
                debtorAccount: {
                  identification: "DEBTOR-ACC-123"
                },
                instructedAmount: {
                  currency: "USD",
                  amount: "1000.00"
                },
                creditorAccount: {
                  identification: "CREDITOR-ACC-456",
                  name: "John Doe",
                  additionalInformation: ["Additional details"]
                },
                creditorAgent: {
                  identification: "BANKBIC123",
                  name: "Beneficiary Bank",
                  additionalInformation: ["SWIFT/BIC code"]
                },
                chargesType: "OUR",
                remittanceInformation: ["Payment for services"]
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error processing payment: ${errorData.message || 'Unknown error'}`);
            }

            const result = await response.json();
            
            // Check payment status
            if (result.status === 'success') {
              console.log('Payment processed successfully');
              
              // Log payment details
              console.log('Payment ID:', result.id);
              console.log('Transaction Status:', result.transactionStatus);
              console.log('Unique Identifier:', result.uniqueIdentifier);
              
              // Process payment details
              const details = result.details;
              console.log('External Reference:', details.extReference);
              console.log('Instructed Amount:', details.instructedAmount.amount, details.instructedAmount.currency);
              
              // Process account information
              console.log('Debtor Account:', details.debtorAccount.identification);
              console.log('Creditor Account:', details.creditorAccount.identification);
              console.log('Beneficiary Account:', details.beneficiaryAccount.identification);
              
              // Process settlement details
              const settlement = details.settlementDetails;
              console.log('Amount Credited:', settlement.amountCredited.amount, settlement.amountCredited.currency);
              console.log('Amount Debited:', settlement.amountDebited.amount, settlement.amountDebited.currency);
              console.log('Value Date:', settlement.valueDate);
              console.log('Record Status:', settlement.recordStatus);
              
              // Process charge details
              const charges = details.chargeDetails;
              console.log('Charges Type:', charges.chargesType);
              console.log('Total Charges:', charges.chargeAmount.amount, charges.chargeAmount.currency);
              
              // Process charge analysis
              const chargeAnalysis = charges.chargeAnalysis;
              console.log('Sender Charges:', chargeAnalysis.sender.amount, chargeAnalysis.sender.currency);
              console.log('Receiver Charges:', chargeAnalysis.receiver.amount, chargeAnalysis.receiver.currency);
              
              // Process beneficiary information
              console.log('Beneficiary Name:', details.beneficiary.name);
              console.log('Beneficiary Bank:', details.beneficiaryAgent.name);
              
              // Process remittance information
              if (details.remittanceInformation) {
                console.log('Remittance Information:');
                details.remittanceInformation.forEach(info => console.log('-', info));
              }
              
              // Process linked activities
              if (result.linkedActivities && result.linkedActivities.length > 0) {
                console.log('Linked Activities:');
                result.linkedActivities.forEach(activity => {
                  console.log('- Activity ID:', activity.id);
                  console.log('  Status:', activity.status);
                  console.log('  Transaction Status:', activity.transactionStatus);
                  console.log('  Unique Identifier:', activity.uniqueIdentifier);
                });
              }
            } else {
              console.error('Payment processing failed:', result.status);
              // Handle failed payment
              if (result.details) {
                console.error('Error details:', result.details);
              }
            }
          } catch (error) {
            console.error('Error:', error);
            // Handle error appropriately
          }
        }


        // Example usage:

        processSwiftPayment();

        ```


        ### Response Structure


        | Field | Type | Description |

        |-------|------|-------------|

        | id | string | Unique identifier for the payment |

        | status | string | Payment status (`success` or `failed`) |

        | transactionStatus | string | Detailed transaction status |

        | uniqueIdentifier | string | Unique identifier for tracking |

        | details | object | Payment details object |

        | linkedActivities | array | Related financial activities |
      operationId: Payments_Post
      requestBody:
        x-name: request
        description: The SWIFT payment request containing all necessary payment details.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
            example:
              instructionIdentification: PAY-2024-03-21-001
              debtorAccount:
                identification: BM12BCBK00001234567890
              instructedAmount:
                currency: USD
                amount: 50000
              creditorAccount:
                identification: US12BCBK00001234567890
                name: Global Investment Services Inc
                additionalInformation:
                  - 350 Fifth Avenue
                  - New York, NY 10118
                  - United States
              creditorAgent:
                identification: CHASUS33
                name: JPMorgan Chase Bank
                additionalInformation:
                  - 'SWIFT/BIC: CHASUS33'
                  - 383 Madison Avenue
                  - New York, NY 10179
                  - United States
              intermediaryAgent:
                identification: BCBKBMHM
                name: Bermuda Commercial Bank
                additionalInformation:
                  - 'SWIFT/BIC: BCBKBMHM'
                  - Victoria Place
                  - 31 Victoria Street
                  - Hamilton HM 10, Bermuda
              chargesType: OUR
              remittanceInformation:
                - Payment for investment management services Q1 2024
                - 'Invoice #INV-2024-001'
                - 'Service Period: Jan-Mar 2024'
        x-position: 1
      responses:
        '201':
          description: Created - The payment was successfully processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
              examples:
                Json:
                  value:
                    id: PAY987654321
                    status: success
                    transactionStatus: COMPLETED
                    uniqueIdentifier: unique-identifier-987
                    details:
                      extReference: EXT98765
                      instructedAmount:
                        currency: USD
                        amount: 50000
                      debtorAccount:
                        schemeName: IBAN
                        identification: BM12BCBK00001234567890
                        currency: ''
                      beneficiaryAccount:
                        schemeName: IBAN
                        identification: US12BCBK00001234567890
                        currency: ''
                      creditorAccount:
                        schemeName: IBAN
                        identification: US12BCBK00001234567890
                        currency: ''
                      settlementDetails:
                        amountCredited:
                          currency: USD
                          amount: 50000
                        amountDebited:
                          currency: USD
                          amount: 50100
                        valueDate: '2024-03-21'
                        recordStatus: COMPLETED
                      chargeDetails:
                        chargesType: OUR
                        chargeAmount:
                          currency: USD
                          amount: 100
                        chargeAccount:
                          schemeName: IBAN
                          identification: BM12BCBK00001234567890
                          currency: ''
                        chargeAnalysis: null
                      remittanceInformation:
                        - unstructured: Payment for investment management services Q1 2024
                        - unstructured: 'Invoice #INV-2024-001'
                        - unstructured: 'Service Period: Jan-Mar 2024'
                      beneficiary:
                        identification: US12BCBK00001234567890
                        name: Global Investment Services Inc
                        additionalInformation:
                          - 350 Fifth Avenue
                          - New York, NY 10118
                          - United States
                      beneficiaryAgent:
                        identification: CHASUS33
                        name: JPMorgan Chase Bank
                        additionalInformation:
                          - 'SWIFT/BIC: CHASUS33'
                          - 383 Madison Avenue
                          - New York, NY 10179
                          - United States
                      intermediaryAgent:
                        identification: BCBKBMHM
                        name: Bermuda Commercial Bank
                        additionalInformation:
                          - 'SWIFT/BIC: BCBKBMHM'
                          - Victoria Place
                          - 31 Victoria Street
                          - Hamilton HM 10, Bermuda
                    linkedActivities:
                      - id: ACT987654
                        transactionStatus: COMPLETED
                        status: SUCCESS
                        uniqueIdentifier: act-987
                        activityDetails:
                          arrangementId: arr-987
                          activityId: act-987
                          productId: prod-987
                          currencyId: USD
                          effectiveDate: '2024-03-21'
                Csv:
                  value:
                    - "\uFEFF\"id\",\"status\",\"transaction_status\",\"unique_identifier\",\"details_ext_reference\",\"details_instructed_amount_currency\",\"details_instructed_amount_amount\",\"details_debtor_account_scheme_name\",\"details_debtor_account_identification\",\"details_debtor_account_name\",\"details_beneficiary_account_scheme_name\",\"details_beneficiary_account_identification\",\"details_beneficiary_account_name\",\"details_creditor_account_scheme_name\",\"details_creditor_account_identification\",\"details_creditor_account_name\",\"details_settlement_details_amount_credited_currency\",\"details_settlement_details_amount_credited_amount\",\"details_settlement_details_amount_debited_currency\",\"details_settlement_details_amount_debited_amount\",\"details_settlement_details_value_date\",\"details_settlement_details_record_status\",\"details_charge_details_charges_type\",\"details_charge_details_charge_amount_currency\",\"details_charge_details_charge_amount_amount\",\"details_charge_details_charge_account_scheme_name\",\"details_charge_details_charge_account_identification\",\"details_charge_details_charge_account_name\",\"details_remittance_information_0_unstructured\",\"details_remittance_information_1_unstructured\",\"details_remittance_information_2_unstructured\",\"details_beneficiary_identification\",\"details_beneficiary_name\",\"details_beneficiary_additional_information_0\",\"details_beneficiary_additional_information_1\",\"details_beneficiary_additional_information_2\",\"details_beneficiary_agent_identification\",\"details_beneficiary_agent_name\",\"details_beneficiary_agent_additional_information_0\",\"details_beneficiary_agent_additional_information_1\",\"details_beneficiary_agent_additional_information_2\",\"details_beneficiary_agent_additional_information_3\",\"details_intermediary_agent_identification\",\"details_intermediary_agent_name\",\"details_intermediary_agent_additional_information_0\",\"details_intermediary_agent_additional_information_1\",\"details_intermediary_agent_additional_information_2\",\"details_intermediary_agent_additional_information_3\",\"linked_activities_0_id\",\"linked_activities_0_transaction_status\",\"linked_activities_0_status\",\"linked_activities_0_unique_identifier\",\"linked_activities_0_activity_details_arrangement_id\",\"linked_activities_0_activity_details_activity_id\",\"linked_activities_0_activity_details_product_id\",\"linked_activities_0_activity_details_currency_id\",\"linked_activities_0_activity_details_effective_date\""
                    - >-
                      "PAY987654321","success","COMPLETED","unique-identifier-987","EXT98765","USD","50000.00","IBAN","BM12BCBK00001234567890","","IBAN","US12BCBK00001234567890","","IBAN","US12BCBK00001234567890","","USD","50000.00","USD","50100.00","2024-03-21","COMPLETED","OUR","USD","100.00","IBAN","BM12BCBK00001234567890","","Payment
                      for investment management services Q1 2024","Invoice
                      #INV-2024-001","Service Period: Jan-Mar
                      2024","US12BCBK00001234567890","Global Investment Services
                      Inc","350 Fifth Avenue","New York, NY 10118","United
                      States","CHASUS33","JPMorgan Chase Bank","SWIFT/BIC:
                      CHASUS33","383 Madison Avenue","New York, NY
                      10179","United States","BCBKBMHM","Bermuda Commercial
                      Bank","SWIFT/BIC: BCBKBMHM","Victoria Place","31 Victoria
                      Street","Hamilton HM 10,
                      Bermuda","ACT987654","COMPLETED","SUCCESS","act-987","arr-987","act-987","prod-987","USD","2024-03-21"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden - The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /auth/token:
    post:
      tags:
        - Token
      summary: Generate Token
      description: >-
        Generates a JWT access token based on provided client credentials. Use
        this POST endpoint to authenticate using your `clientId` and
        `clientSecret` and receive a JWT token.


        **Token Validity:** 40 minutes from the time of issuance.


        **Endpoint:** `https://api.bcb.bm/auth/token`


        **Required Headers:**

        - `Content-Type: application/json`

        - `Accept: application/json`


        ### Sample Request in JavaScript:


        ```javascript

        async function getToken() {
          try {
            const response = await fetch('https://api.bcb.bm/auth/token', {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              },
              body: JSON.stringify({
                clientId: 'your-client-id',
                clientSecret: 'your-client-secret'
              })
            });
            
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || response.statusText}`);
            }
            
            const data = await response.json();
            console.log('JWT Token:', data.token);
            // Store token securely
            localStorage.setItem('jwt', data.token);
          } catch (error) {
            console.error('Fetch error:', error);
          }
        }


        getToken();

        ```
      operationId: Token_GenerateToken
      requestBody:
        x-name: credentials
        description: >-
          The API credentials containing client ID and client secret for
          authentication.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCredentials'
            example:
              clientId: your-client-id-here
              clientSecret: your-client-secret-here
        required: true
        x-position: 1
      responses:
        '200':
          description: Token generated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiToken'
        '400':
          description: >-
            Invalid request. Ensure the client credentials are provided
            correctly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized. The client credentials are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests. You have exceeded the allowed number of requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error occurred during token generation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/accounts/{accountNumber}/transactions:
    get:
      tags:
        - Transactions
      summary: Account Transactions
      description: >-
        Retrieves transaction details for the specified account and date range.
        This endpoint:


        - Validates the provided date parameters. The accepted date formats are
        `yyyy-MM-dd` or `yyyyMMdd`.

        - Maximum date range is one year.

        - Supports both JSON and CSV response formats based on the Accept
        header.

        - **Supports cursor-based pagination** for efficient handling of large
        transaction datasets.


        ### Transaction ID Uniqueness

        **Important**: Transaction IDs are globally unique across the entire
        banking system. For internal transfers, the same transaction ID appears
        on both accounts (debit and credit entries) with only the transaction
        type differing. When fees apply, multiple entries may share the same
        transaction ID.


        📖 **For detailed information about transaction ID behavior, see**:
        https://developers.bcb.bm/guides/transaction-id-uniqueness-guide


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `pageSize` (default: 100, max:
        1000). The server creates a cursor and returns a `pageToken`.

        - **Subsequent Requests**: Use the `pageToken` from previous responses
        with `pageStart` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        pageSize, so don't specify `pageSize` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/accounts/{accountNumber}/transactions

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getAllTransactionsPaginated(accountNumber, fromDate,
        toDate) {
          try {
            let allTransactions = [];
            let pageStart = 1;
            let pageToken = null;
            let totalPages = 0;

            do {
              // Build URL with pagination parameters
              let url = `https://api.bcb.bm/v1/accounts/${accountNumber}/transactions`;
              const params = new URLSearchParams();
              
              // Always include date range
              params.append('fromDate', fromDate);
              params.append('toDate', toDate);
              
              if (pageStart === 1) {
                // First request: specify pageSize
                params.append('pageSize', '100');
              } else {
                // Subsequent requests: use pageToken and pageStart
                params.append('pageToken', pageToken);
                params.append('pageStart', pageStart.toString());
              }
              
              url += '?' + params.toString();

              const response = await fetch(url, {
                method: 'GET',
                headers: {
                  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                  'Content-Type': 'application/json',
                  'Accept': 'application/json'
                }
              });

              if (!response.ok) {
                const errorData = await response.json();
                throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
              }

              const data = await response.json();
              console.log(`Page ${pageStart} data:`, data);

              // Store pagination info from first request
              if (pageStart === 1 && data.meta && data.meta.pagination) {
                pageToken = data.meta.pagination.page_token;
                totalPages = Math.ceil(data.meta.pagination.total_size / data.meta.pagination.page_size);
                console.log(`Total pages: ${totalPages}, Page token: ${pageToken}`);
              }

              // Collect transactions from this page
              if (data.data && data.data.length > 0) {
                allTransactions.push(...data.data);
                console.log(`Collected ${data.data.length} transactions from page ${pageStart}`);
              }

              pageStart++;
            } while (pageStart <= totalPages);

            console.log(`Total transactions collected: ${allTransactions.length}`);

            // Process all collected transactions
            allTransactions.forEach((transaction, index) => {
              console.log(`Transaction ${index + 1}:`, transaction.id);
              console.log('Account Number:', transaction.thisAccount.number);
              console.log('Other Account Number:', transaction.otherAccount.number);
              console.log('Type:', transaction.details.type);
              console.log('Description:', transaction.details.description);
              console.log('Posted Date:', transaction.details.posted);
              console.log('Amount:', transaction.details.value.amount);
              console.log('Currency:', transaction.details.value.currency);
              console.log('Narrative:', transaction.metadata.narrative);
              
              if (transaction.transactionAttributes && transaction.transactionAttributes.length > 0) {
                transaction.transactionAttributes.forEach(attribute => {
                  console.log(`${attribute.name}: ${attribute.value}`);
                });
              }
            });

            return allTransactions;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Alternative: Get single page of transactions

        async function getTransactionsPage(accountNumber, fromDate, toDate,
        pageStart = 1, pageToken = null) {
          try {
            let url = `https://api.bcb.bm/v1/accounts/${accountNumber}/transactions`;
            const params = new URLSearchParams();
            
            // Always include date range
            params.append('fromDate', fromDate);
            params.append('toDate', toDate);
            
            if (pageStart === 1 && !pageToken) {
              params.append('pageSize', '250'); // Custom page size
            } else {
              params.append('pageToken', pageToken);
              params.append('pageStart', pageStart.toString());
            }
            
            url += '?' + params.toString();

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const data = await response.json();
            console.log('Transactions page:', data);
            return data;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Example usage:

        getAllTransactionsPaginated('1234567890', '2023-01-25', '2023-02-25');
        // Retrieves all transactions across multiple pages

        // OR

        getTransactionsPage('1234567890', '2023-01-25', '2023-02-25',
        1).then(firstPage => {
          console.log('First page:', firstPage);
          // Use firstPage.meta.pagination.page_token for subsequent requests
        });

        ```
      operationId: Transactions_Get
      parameters:
        - name: accountNumber
          in: path
          required: true
          description: The account number to retrieve transactions for.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
        - name: fromDate
          in: query
          required: true
          description: 'The start date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 2
        - name: toDate
          in: query
          required: true
          description: 'The end date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 3
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 4
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 5
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 6
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfTransactionOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 2
                        pageToken: 202407250072428721.02,99
                        totalSize: 955
                        pageSize: 99
                    data:
                      - id: 1
                        thisAccount:
                          number: 123456789
                          accountRoutings:
                            - scheme: BIC
                              address: 123456789
                        otherAccount:
                          number: 987654321
                          accountRoutings:
                            - scheme: BIC
                              address: 987654321
                        details:
                          type: Credit
                          description: Payment
                          posted: '2019-01-01'
                          completed: ''
                          newBalance: null
                          value:
                            currency: USD
                            amount: 100
                        metadata:
                          narrative: Payment for services
                        transactionAttributes:
                          - name: Service
                            value: Payment
                      - id: 2
                        thisAccount:
                          number: 123456789
                          accountRoutings:
                            - scheme: BIC
                              address: 123456789
                        otherAccount:
                          number: 987654321
                          accountRoutings:
                            - scheme: BIC
                              address: 987654321
                        details:
                          type: Credit
                          description: Payment
                          posted: '2019-01-01'
                          completed: ''
                          newBalance: null
                          value:
                            currency: USD
                            amount: 100
                        metadata:
                          narrative: Payment for services
                        transactionAttributes:
                          - name: Service
                            value: Payment
                      - id: 3
                        thisAccount:
                          number: 123456789
                          accountRoutings:
                            - scheme: BIC
                              address: 123456789
                        otherAccount:
                          number: 987654321
                          accountRoutings:
                            - scheme: BIC
                              address: 987654321
                        details:
                          type: Credit
                          description: Payment
                          posted: '2019-01-01'
                          completed: ''
                          newBalance: null
                          value:
                            currency: USD
                            amount: 100
                        metadata:
                          narrative: Payment for services
                        transactionAttributes:
                          - name: Service
                            value: Payment
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_id\",\"data_0_this_account_number\",\"data_0_this_account_account_routings_0_scheme\",\"data_0_this_account_account_routings_0_address\",\"data_0_other_account_number\",\"data_0_other_account_account_routings_0_scheme\",\"data_0_other_account_account_routings_0_address\",\"data_0_details_type\",\"data_0_details_description\",\"data_0_details_posted\",\"data_0_details_completed\",\"data_0_details_value_currency\",\"data_0_details_value_amount\",\"data_0_metadata_narrative\",\"data_0_transaction_attributes_0_name\",\"data_0_transaction_attributes_0_value\",\"data_1_id\",\"data_1_this_account_number\",\"data_1_this_account_account_routings_0_scheme\",\"data_1_this_account_account_routings_0_address\",\"data_1_other_account_number\",\"data_1_other_account_account_routings_0_scheme\",\"data_1_other_account_account_routings_0_address\",\"data_1_details_type\",\"data_1_details_description\",\"data_1_details_posted\",\"data_1_details_completed\",\"data_1_details_value_currency\",\"data_1_details_value_amount\",\"data_1_metadata_narrative\",\"data_1_transaction_attributes_0_name\",\"data_1_transaction_attributes_0_value\",\"data_2_id\",\"data_2_this_account_number\",\"data_2_this_account_account_routings_0_scheme\",\"data_2_this_account_account_routings_0_address\",\"data_2_other_account_number\",\"data_2_other_account_account_routings_0_scheme\",\"data_2_other_account_account_routings_0_address\",\"data_2_details_type\",\"data_2_details_description\",\"data_2_details_posted\",\"data_2_details_completed\",\"data_2_details_value_currency\",\"data_2_details_value_amount\",\"data_2_metadata_narrative\",\"data_2_transaction_attributes_0_name\",\"data_2_transaction_attributes_0_value\""
                    - >-
                      "2","202407250072428721.02,99","955","99","1","123456789","BIC","123456789","987654321","BIC","987654321","Credit","Payment","2019-01-01","","USD","100.00","Payment
                      for
                      services","Service","Payment","2","123456789","BIC","123456789","987654321","BIC","987654321","Credit","Payment","2019-01-01","","USD","100.00","Payment
                      for
                      services","Service","Payment","3","123456789","BIC","123456789","987654321","BIC","987654321","Credit","Payment","2019-01-01","","USD","100.00","Payment
                      for services","Service","Payment"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts:
    post:
      tags:
        - Virtual Accounts
      summary: Create Virtual Account
      description: >-
        Creates one or more virtual (sub) accounts for a corporate client.
        Virtual accounts allow funds to be segregated and tracked independently
        while remaining linked to a single settlement account.
                    
        **Required Request Properties**

        - **items**: Array of virtual account creation requests (minimum 1,
        maximum 1000)
          - **currency**: ISO-4217 currency code for the virtual account (e.g., USD, BMD)
          - **accountHolderName**: Human-readable label for the virtual account
          - **accountName**: Official account title that will appear on statements
                    
        **Optional Request Properties**

        - **callbackUrl**: URL to receive notifications when the batch job
        completes (optional)

        - **clientReference**: External reference provided by the client to aid
        reconciliation (max 35 characters) - per item

        - **customHeaders**: Object of string key/value pairs to be echoed back
        in the completion callback. Limits: up to 10 headers; each key ≤ 50
        characters; each value ≤ 500 characters.
                    
        ### Asynchronous Processing

        Virtual account creation requests are processed asynchronously to ensure
        optimal performance and reliability:

        - **Immediate Response**: You receive a job ID and status URLs
        immediately upon submission

        - **Status Monitoring**: Use the provided status URL to monitor job
        progress

        - **Result Retrieval**: Use the provided result URL to fetch final
        outcomes when complete

        - **Callback Notifications**: Optionally provide a callback URL for
        automatic notifications afther job completes
                    
        ### Virtual Account Structure

        Each successfully created virtual account will contain the following
        properties:


        ```json

        {
          "virtualAccountNumber": "1000327642",
          "bicCode": "BPBKBMHMXXX",
          "accountHolderName": "T1 Project Alpha Escrow",
          "accountName": "New Title T2",
          "currency": "USD",
          "balance": {
            "amount": "0",
            "currency": "USD"
          },
          "category": "CMS Sub Acct"
        }

        ```
                    
        ### Job Status Tracking

        The response includes URLs for monitoring your batch job:

        - **Status URL**: Poll this URL to check job progress and completion
        status

        - **Result URL**: Access this URL to retrieve detailed results for each
        virtual account

        - **Job ID**: Unique identifier for tracking your batch job
                    
        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts

        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided, the system stores the key
        and associates it with the batch job

        - If the same idempotency key is received again, the system returns the
        previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000")
                    
        ### Sample Request in JavaScript
                    
        ```javascript

        async function createVirtualAccounts() {
          try {
            const response = await fetch('https://api.bcb.bm/v1/virtual-accounts', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                callbackUrl: 'https://my-callback-url.com', // Optional
                // Optional: custom headers echoed in the completion webhook
                customHeaders: {
                  'X-Custom-Header-1': 'CustomValue1',
                  'X-Custom-Header-2': 'CustomValue2',
                  'X-Custom-Header-3': 'CustomValue3'
                },
                items: [
                  {
                    currency: 'USD',
                    accountHolderName: 'Test Company Ltd',
                    accountName: 'Test Virtual Account 001',
                    clientReference: 'BATCH-REF-001'
                  },
                  {
                    currency: 'USD',
                    accountHolderName: 'Test Company Ltd',
                    accountName: 'Test Virtual Account 002',
                    clientReference: 'BATCH-REF-002'
                  }
                ]
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Virtual account creation failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const batchResponse = await response.json();

            // Display batch job information
            console.log('Batch Job Created:');
            console.log(`  Job ID: ${batchResponse.jobId}`);
            console.log(`  Status: ${batchResponse.status}`);
            console.log(`  Status URL: ${batchResponse.statusUrl}`);
            console.log(`  Result URL: ${batchResponse.resultUrl}`);

            // Store these URLs for monitoring the job
            // Use statusUrl to check progress
            // Use resultUrl to get final outcomes

            return batchResponse;
          } catch (error) {
            console.error('Failed to create virtual accounts:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Create multiple virtual accounts

        createVirtualAccounts();

        ```
      operationId: VirtualAccounts_Post
      requestBody:
        x-name: request
        description: >-
          Batch request containing virtual account creation items and optional
          callback URL.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualAccountCreateBatchRequest'
            example:
              callbackUrl: https://my-callback-url.com
              customHeaders:
                X-Custom-Header-1: Custom Value 1
                X-Custom-Header-2: Custom Value 2
              items:
                - currency: USD
                  accountHolderName: Test Company Ltd
                  accountName: Test Virtual Account 001
                  clientReference: BATCH-REF-001
                - currency: USD
                  accountHolderName: Test Company Ltd
                  accountName: Test Virtual Account 002
                  clientReference: BATCH-REF-002
                - currency: USD
                  accountHolderName: Test Company Ltd
                  accountName: Test Virtual Account 003
                  clientReference: BATCH-REF-003
        x-position: 1
      responses:
        '202':
          description: >-
            Accepted - Virtual account creation job has been queued for
            processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateResponse'
              example:
                jobId: 550e8400-e29b-41d4-a716-446655440001
                status: Pending
                statusUrl: >-
                  https://api.bcb.bm/v1/jobs/550e8400-e29b-41d4-a716-446655440001
                resultUrl: >-
                  https://api.bcb.bm/v1/jobs/550e8400-e29b-41d4-a716-446655440001/results
        '400':
          description: Bad Request – Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
    get:
      tags:
        - Virtual Accounts
      summary: Get All Virtual Accounts
      description: >-
        Retrieves all virtual accounts for the authenticated corporate client.
        This endpoint:


        - Returns a paginated list of virtual accounts for the client

        - Response contains the client’s real (non-virtual) accounts as well:

        - **Settlement Account** – the primary clearing account used for cash
        movements. Account category: "CMS Settlement".

        - **Parent Account** – the parent account under which all virtual
        accounts are organised. Account category: "CMS Parent Cate".

        - **Virtual accounts** have the category "CMS Sub Acct".

        - Supports optional currency filtering to return only accounts in a
        specific currency

        - **Supports pagination** for efficient handling of large account
        datasets


        ### Filtering

        Use the optional `currency` query parameter to filter results:

        - Must be a valid 3-letter ISO currency code (e.g., USD, BMD, EUR)

        - If omitted, accounts in all currencies are returned


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `pageSize` (default: 100, max:
        1000). The server creates a cursor and returns a `pageToken`.

        - **Subsequent Requests**: Use the `pageToken` from previous responses
        with `pageStart` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        pageSize, so don't specify `pageSize` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getAllVirtualAccounts(currency = null, pageSize = 25) {
          try {
            // Build URL with optional parameters
            let url = 'https://api.bcb.bm/v1/virtual-accounts';
            const params = new URLSearchParams();
            
            if (currency) {
              params.append('currency', currency);
            }
            
            params.append('pageSize', pageSize.toString());
            params.append('pageStart', '0');
            
            url += '?' + params.toString();

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Virtual accounts retrieval failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const result = await response.json();

            // Access pagination info
            const pagination = result.meta.pagination;
            console.log(`Page: ${pagination.page_start}, Size: ${pagination.page_size}, Total: ${pagination.total_size}`);

            // Process virtual accounts
            result.data.forEach((account, index) => {
              console.log(`Account ${index + 1}:`);
              console.log(`  Virtual Account Number: ${account.virtualAccountNumber}`);
              console.log(`  BIC: ${account.bicCode}`);
              console.log(`  Account Holder: ${account.accountHolderName}`);
              console.log(`  Account Name: ${account.accountName}`);
              console.log(`  Currency: ${account.currency}`);
              console.log(`  Balance: ${account.balance ? account.balance.amount + ' ' + account.balance.currency : 'N/A'}`);
              console.log(`  Category: ${account.category}`);
              
              if (account.clientReference) {
                console.log(`  Client Reference: ${account.clientReference}`);
              }
              
              if (account.effectiveDate) {
                console.log(`  Effective Date: ${account.effectiveDate}`);
              }
              
              if (account.createdAt) {
                console.log(`  Created At: ${account.createdAt}`);
              }
              
              // Log parent/settlement account relationships
              if (account.parentAccount) {
                console.log(`  Parent Account: ${account.parentAccount.accountNumber} (${account.parentAccount.accountName})`);
              }
              if (account.settlementAccount) {
                console.log(`  Settlement Account: ${account.settlementAccount.accountNumber} (${account.settlementAccount.accountName})`);
              }
              
              console.log('---');
            });

            return result;
          } catch (error) {
            console.error('Failed to retrieve virtual accounts:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Get all virtual accounts

        getAllVirtualAccounts();


        // Get only USD virtual accounts

        getAllVirtualAccounts('USD');


        // Get first 10 virtual accounts

        getAllVirtualAccounts(null, 10);

        ```
      operationId: VirtualAccounts_GetAll
      parameters:
        - name: currency
          in: query
          description: >-
            Optional. The currency of the virtual accounts to filter by. If not
            specified, all virtual accounts will be returned.
          schema:
            type: string
            maxLength: 3
            minLength: 0
            nullable: true
          x-position: 1
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 2
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 3
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 4
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfVirtualAccountOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: 202506234881430088.01,99
                        totalSize: 7
                        pageSize: 99
                    data:
                      - virtualAccountNumber: 1000326948
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Global Investment Fund Ltd
                        accountName: Settlement Account
                        currency: USD
                        balance:
                          currency: USD
                          amount: 0
                        category: CMS Settlement
                      - virtualAccountNumber: 1000326956
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Global Investment Fund Ltd
                        accountName: Parent Account
                        currency: USD
                        balance:
                          currency: USD
                          amount: 0
                        category: CMS Parent Cate
                      - virtualAccountNumber: 1000327057
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Corporate Treasury Holdings
                        accountName: Sub Account Operations
                        currency: USD
                        balance:
                          currency: USD
                          amount: 130492.24
                        category: CMS Sub Acct
                      - virtualAccountNumber: 1000327073
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Asset Management Services
                        accountName: Sub Account Operations
                        currency: USD
                        balance:
                          currency: USD
                          amount: 100776.49
                        category: CMS Sub Acct
                      - virtualAccountNumber: 1000327197
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Project Alpha Escrow
                        accountName: Project Alpha Virtual Account
                        currency: USD
                        balance:
                          currency: USD
                          amount: 0
                        category: CMS Sub Acct
                      - virtualAccountNumber: 1000327642
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Treasury Operations Ltd
                        accountName: Enhanced Operations Account
                        currency: USD
                        balance:
                          currency: USD
                          amount: 0
                        category: CMS Sub Acct
                      - virtualAccountNumber: 1000327887
                        bicCode: BPBKBMHMXXX
                        accountHolderName: Sub Account Holdings
                        accountName: Operations Title
                        currency: USD
                        balance:
                          currency: USD
                          amount: 0
                        category: CMS Sub Acct
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_virtual_account_number\",\"data_0_bic_code\",\"data_0_account_holder_name\",\"data_0_account_name\",\"data_0_currency\",\"data_0_balance_currency\",\"data_0_balance_amount\",\"data_0_category\",\"data_1_virtual_account_number\",\"data_1_bic_code\",\"data_1_account_holder_name\",\"data_1_account_name\",\"data_1_currency\",\"data_1_balance_currency\",\"data_1_balance_amount\",\"data_1_category\",\"data_2_virtual_account_number\",\"data_2_bic_code\",\"data_2_account_holder_name\",\"data_2_account_name\",\"data_2_currency\",\"data_2_balance_currency\",\"data_2_balance_amount\",\"data_2_category\",\"data_3_virtual_account_number\",\"data_3_bic_code\",\"data_3_account_holder_name\",\"data_3_account_name\",\"data_3_currency\",\"data_3_balance_currency\",\"data_3_balance_amount\",\"data_3_category\",\"data_4_virtual_account_number\",\"data_4_bic_code\",\"data_4_account_holder_name\",\"data_4_account_name\",\"data_4_currency\",\"data_4_balance_currency\",\"data_4_balance_amount\",\"data_4_category\",\"data_5_virtual_account_number\",\"data_5_bic_code\",\"data_5_account_holder_name\",\"data_5_account_name\",\"data_5_currency\",\"data_5_balance_currency\",\"data_5_balance_amount\",\"data_5_category\",\"data_6_virtual_account_number\",\"data_6_bic_code\",\"data_6_account_holder_name\",\"data_6_account_name\",\"data_6_currency\",\"data_6_balance_currency\",\"data_6_balance_amount\",\"data_6_category\""
                    - >-
                      "1","202506234881430088.01,99","7","99","1000326948","BPBKBMHMXXX","Global
                      Investment Fund Ltd","Settlement
                      Account","USD","USD","0","CMS
                      Settlement","1000326956","BPBKBMHMXXX","Global Investment
                      Fund Ltd","Parent Account","USD","USD","0","CMS Parent
                      Cate","1000327057","BPBKBMHMXXX","Corporate Treasury
                      Holdings","Sub Account
                      Operations","USD","USD","130492.24","CMS Sub
                      Acct","1000327073","BPBKBMHMXXX","Asset Management
                      Services","Sub Account
                      Operations","USD","USD","100776.49","CMS Sub
                      Acct","1000327197","BPBKBMHMXXX","Project Alpha
                      Escrow","Project Alpha Virtual
                      Account","USD","USD","0","CMS Sub
                      Acct","1000327642","BPBKBMHMXXX","Treasury Operations
                      Ltd","Enhanced Operations Account","USD","USD","0","CMS
                      Sub Acct","1000327887","BPBKBMHMXXX","Sub Account
                      Holdings","Operations Title","USD","USD","0","CMS Sub
                      Acct"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - No virtual accounts were found for the customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{virtualAccountNumber}:
    patch:
      tags:
        - Virtual Accounts
      summary: Update Virtual Account
      description: >-
        Updates an existing virtual (sub) account for a corporate client. Only
        the fields provided in the request body will be updated.
                    
        **Updateable Properties**

        - **accountHolderName**: Human-readable label for the virtual account.

        - **accountName**: Official account title that will appear on
        statements.

        - **clientReference**: External reference provided by the client to aid
        reconciliation (max 35 characters).
                    
        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts
            
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Sample Request (JavaScript)

        ```javascript

        async function updateVirtualAccount(virtualAccountNumber) {
          try {
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${virtualAccountNumber}`, {
              method: 'PATCH',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              },
              body: JSON.stringify({
                accountHolderName: 'Updated Project Alpha Escrow',
                accountName: 'Updated Project Alpha Virtual Account',
                clientReference: 'updated-reference-123'
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Virtual account update failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const result = await response.json();
            const virtualAccount = result.data;
            
            // Log updated details
            console.log('Virtual Account Updated Successfully:');
            console.log(`  Account Number: ${virtualAccount.virtualAccountNumber}`);
            console.log(`  Account Holder: ${virtualAccount.accountHolderName}`);
            console.log(`  Account Name: ${virtualAccount.accountName}`);
            console.log(`  Currency: ${virtualAccount.currency}`);
            console.log(`  Category: ${virtualAccount.category}`);
            
            if (virtualAccount.balance) {
              console.log(`  Balance: ${virtualAccount.balance.amount} ${virtualAccount.balance.currency}`);
            }
            
            if (virtualAccount.clientReference) {
              console.log(`  Client Reference: ${virtualAccount.clientReference}`);
            }
            
            console.log(`  Effective Date: ${virtualAccount.effectiveDate}`);
            console.log(`  Created: ${virtualAccount.createdAt}`);
            
            // Log parent/settlement account info
            if (virtualAccount.parentAccount) {
              console.log(`  Parent Account: ${virtualAccount.parentAccount.accountNumber} (${virtualAccount.parentAccount.accountSubType})`);
            }
            if (virtualAccount.settlementAccount) {
              console.log(`  Settlement Account: ${virtualAccount.settlementAccount.accountNumber} (${virtualAccount.settlementAccount.accountSubType})`);
            }

            return result;
          } catch (err) {
            console.error('Error updating virtual account:', err);
            throw err;
          }
        }


        // Example usage:

        updateVirtualAccount('1000327642');

        ```
      operationId: VirtualAccounts_Patch
      parameters:
        - name: virtualAccountNumber
          in: path
          required: true
          description: >-
            Virtual account identifier (ID) that uniquely identifies the virtual
            account
          schema:
            type: string
          x-position: 1
      requestBody:
        x-name: request
        description: Payload containing virtual account fields to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualAccountUpdateRequest'
            example:
              accountHolderName: Updated Project Alpha Escrow
              accountName: Updated Project Alpha Virtual Account
              clientReference: ref-1234567890
        x-position: 2
      responses:
        '200':
          description: Virtual account updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountDetails'
              examples:
                Json:
                  value:
                    clientReference: T12cc62d3fb446e7950ffd0797d0a6f41
                    effectiveDate: '2025-06-20'
                    createdAt: '2025-07-25T08:23:00.0000000Z'
                    parentAccount:
                      accountId: 1000326956-2000365
                      cif: 2000365
                      currency: USD
                      accountSubType: CMS Parent Cate
                      accountNumber: 1000326956
                      status: AUTH
                      availableBalance:
                        currency: USD
                        amount: 0
                      owners:
                        - displayName: GLOB-INVEST BOND FUND LTD
                          accountHolderType: Primary
                      accountAttributes: []
                    settlementAccount:
                      accountId: 1000326948-2000365
                      cif: 2000365
                      currency: USD
                      accountSubType: CMS Settlement
                      accountNumber: 1000326948
                      status: AUTH
                      availableBalance:
                        currency: USD
                        amount: 0
                      owners:
                        - displayName: GLOB-INVEST BOND FUND LTD
                          accountHolderType: Primary
                      accountAttributes: []
                    virtualAccountNumber: 1000327642
                    bicCode: BPBKBMHMXXX
                    accountHolderName: T1 Project Alpha Escrow
                    accountName: New Title T2
                    currency: USD
                    balance:
                      currency: USD
                      amount: 0
                    category: CMS Sub Acct
                Csv:
                  value:
                    - "\uFEFF\"virtual_account_number\",\"bic_code\",\"account_holder_name\",\"account_name\",\"currency\",\"balance_currency\",\"balance_amount\",\"category\",\"client_reference\",\"effective_date\",\"created_at\",\"parent_account_account_id\",\"parent_account_cif\",\"parent_account_account_number\",\"parent_account_status\",\"parent_account_currency\",\"parent_account_available_balance_currency\",\"parent_account_available_balance_amount\",\"parent_account_account_sub_type\",\"parent_account_owners_0_display_name\",\"parent_account_owners_0_account_holder_type\",\"settlement_account_account_id\",\"settlement_account_cif\",\"settlement_account_account_number\",\"settlement_account_status\",\"settlement_account_currency\",\"settlement_account_available_balance_currency\",\"settlement_account_available_balance_amount\",\"settlement_account_account_sub_type\",\"settlement_account_owners_0_display_name\",\"settlement_account_owners_0_account_holder_type\""
                    - >-
                      "1000327642","BPBKBMHMXXX","T1 Project Alpha Escrow","New
                      Title T2","USD","USD","0","CMS Sub
                      Acct","T12cc62d3fb446e7950ffd0797d0a6f41","2025-06-20","2025-07-25T08:23:00Z","1000326956-2000365","2000365","1000326956","AUTH","USD","USD","0","CMS
                      Parent Cate","GLOB-INVEST BOND FUND
                      LTD","Primary","1000326948-2000365","2000365","1000326948","AUTH","USD","USD","0","CMS
                      Settlement","GLOB-INVEST BOND FUND LTD","Primary"
        '400':
          description: Bad Request – Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Virtual account not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
    get:
      tags:
        - Virtual Accounts
      summary: Get Virtual Account Details
      description: >-
        Retrieves comprehensive information about a specific virtual account,
        including all its sub-accounts, parent account details, and settlement
        account information. This endpoint:


        - Returns the virtual account details as a single object

        - Includes parent account information (the account this virtual account
        is derived from)

        - Provides settlement account details (the account used for settlement
        operations)


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{accountNumber}

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getVirtualAccountDetails(accountNumber) {
          try {
            const url = `https://api.bcb.bm/v1/virtual-accounts/${encodeURIComponent(accountNumber)}`;

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Virtual account details retrieval failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const result = await response.json();

            // Get the virtual account details (single object, not an array)
            const virtualAccount = result.data;
            console.log('Virtual Account Details:');
            console.log(`  Account Number: ${virtualAccount.virtualAccountNumber}`);
            console.log(`  BIC: ${virtualAccount.bicCode}`);
            console.log(`  Account Holder: ${virtualAccount.accountHolderName}`);
            console.log(`  Account Name: ${virtualAccount.accountName}`);
            console.log(`  Currency: ${virtualAccount.currency}`);
            console.log(`  Category: ${virtualAccount.category}`);
            
            if (virtualAccount.balance) {
              console.log(`  Balance: ${virtualAccount.balance.amount} ${virtualAccount.balance.currency}`);
            }
            
            console.log(`  Effective Date: ${virtualAccount.effectiveDate}`);
            console.log(`  Created: ${virtualAccount.createdAt}`);
            
            if (virtualAccount.clientReference) {
              console.log(`  Client Reference: ${virtualAccount.clientReference}`);
            }
            
            // Log parent account details
            if (virtualAccount.parentAccount) {
              console.log('  Parent Account:');
              console.log(`    Account Number: ${virtualAccount.parentAccount.accountNumber}`);
              console.log(`    Account ID: ${virtualAccount.parentAccount.accountId}`);
              console.log(`    CIF: ${virtualAccount.parentAccount.cif}`);
              console.log(`    Currency: ${virtualAccount.parentAccount.currency}`);
              console.log(`    Sub Type: ${virtualAccount.parentAccount.accountSubType}`);
              console.log(`    Status: ${virtualAccount.parentAccount.status}`);
              if (virtualAccount.parentAccount.availableBalance) {
                console.log(`    Available Balance: ${virtualAccount.parentAccount.availableBalance.amount} ${virtualAccount.parentAccount.availableBalance.currency}`);
              }
              if (virtualAccount.parentAccount.owners && virtualAccount.parentAccount.owners.length > 0) {
                console.log(`    Owner: ${virtualAccount.parentAccount.owners[0].displayName} (${virtualAccount.parentAccount.owners[0].accountHolderType})`);
              }
            }
            
            // Log settlement account details
            if (virtualAccount.settlementAccount) {
              console.log('  Settlement Account:');
              console.log(`    Account Number: ${virtualAccount.settlementAccount.accountNumber}`);
              console.log(`    Account ID: ${virtualAccount.settlementAccount.accountId}`);
              console.log(`    CIF: ${virtualAccount.settlementAccount.cif}`);
              console.log(`    Currency: ${virtualAccount.settlementAccount.currency}`);
              console.log(`    Sub Type: ${virtualAccount.settlementAccount.accountSubType}`);
              console.log(`    Status: ${virtualAccount.settlementAccount.status}`);
              if (virtualAccount.settlementAccount.availableBalance) {
                console.log(`    Available Balance: ${virtualAccount.settlementAccount.availableBalance.amount} ${virtualAccount.settlementAccount.availableBalance.currency}`);
              }
              if (virtualAccount.settlementAccount.owners && virtualAccount.settlementAccount.owners.length > 0) {
                console.log(`    Owner: ${virtualAccount.settlementAccount.owners[0].displayName} (${virtualAccount.settlementAccount.owners[0].accountHolderType})`);
              }
            }

            return result;
          } catch (error) {
            console.error('Failed to retrieve virtual account details:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Get details for a specific virtual account

        getVirtualAccountDetails('1000326808');

        ```
      operationId: VirtualAccounts_GetDetails
      parameters:
        - name: virtualAccountNumber
          in: path
          required: true
          description: The virtual account number assigned by the bank.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountDetails'
              examples:
                Json:
                  value:
                    clientReference: T12cc62d3fb446e7950ffd0797d0a6f41
                    effectiveDate: '2025-06-20'
                    createdAt: '2025-07-25T08:23:00.0000000Z'
                    parentAccount:
                      accountId: 1000326956-2000365
                      cif: 2000365
                      currency: USD
                      accountSubType: CMS Parent Cate
                      accountNumber: 1000326956
                      status: AUTH
                      availableBalance:
                        currency: USD
                        amount: 0
                      owners:
                        - displayName: GLOB-INVEST BOND FUND LTD
                          accountHolderType: Primary
                      accountAttributes: []
                    settlementAccount:
                      accountId: 1000326948-2000365
                      cif: 2000365
                      currency: USD
                      accountSubType: CMS Settlement
                      accountNumber: 1000326948
                      status: AUTH
                      availableBalance:
                        currency: USD
                        amount: 0
                      owners:
                        - displayName: GLOB-INVEST BOND FUND LTD
                          accountHolderType: Primary
                      accountAttributes: []
                    virtualAccountNumber: 1000327642
                    bicCode: BPBKBMHMXXX
                    accountHolderName: T1 Project Alpha Escrow
                    accountName: New Title T2
                    currency: USD
                    balance:
                      currency: USD
                      amount: 0
                    category: CMS Sub Acct
                Csv:
                  value:
                    - "\uFEFF\"virtual_account_number\",\"bic_code\",\"account_holder_name\",\"account_name\",\"currency\",\"balance_currency\",\"balance_amount\",\"category\",\"client_reference\",\"effective_date\",\"created_at\",\"parent_account_account_id\",\"parent_account_cif\",\"parent_account_account_number\",\"parent_account_status\",\"parent_account_currency\",\"parent_account_available_balance_currency\",\"parent_account_available_balance_amount\",\"parent_account_account_sub_type\",\"parent_account_owners_0_display_name\",\"parent_account_owners_0_account_holder_type\",\"settlement_account_account_id\",\"settlement_account_cif\",\"settlement_account_account_number\",\"settlement_account_status\",\"settlement_account_currency\",\"settlement_account_available_balance_currency\",\"settlement_account_available_balance_amount\",\"settlement_account_account_sub_type\",\"settlement_account_owners_0_display_name\",\"settlement_account_owners_0_account_holder_type\""
                    - >-
                      "1000327642","BPBKBMHMXXX","T1 Project Alpha Escrow","New
                      Title T2","USD","USD","0","CMS Sub
                      Acct","T12cc62d3fb446e7950ffd0797d0a6f41","2025-06-20","2025-07-25T08:23:00Z","1000326956-2000365","2000365","1000326956","AUTH","USD","USD","0","CMS
                      Parent Cate","GLOB-INVEST BOND FUND
                      LTD","Primary","1000326948-2000365","2000365","1000326948","AUTH","USD","USD","0","CMS
                      Settlement","GLOB-INVEST BOND FUND LTD","Primary"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - The virtual account was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{virtualAccountNumber}/transactions:
    get:
      tags:
        - Virtual Accounts
      summary: Virtual Account Transactions
      description: >-
        Retrieves transaction entries for a specific virtual (sub) account
        within a given date range.

        This endpoint:


        - Validates the provided date parameters. Accepted formats: `yyyy-MM-dd`
        or `yyyyMMdd`.

        - Supports a maximum date range of one year.

        - Supports both JSON and CSV response formats based on the Accept
        header.

        - Uses cursor-based pagination with server-side result-set management.


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `page_size` (default: 100, max:
        1000). The server creates a cursor and returns a `page_token`.

        - **Subsequent Requests**: Use the `page_token` from previous responses
        with `page_start` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        page_size, so don't specify `page_size` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.      


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{virtualAccountNumber}/transactions

        ### Sample Request in JavaScript

        ```javascript

        // Get first page

        async function getVirtualAccountTransactions(virtualAccountNumber,
        fromDate, toDate) {
          const url = new URL(`https://api.bcb.bm/v1/virtual-accounts/${encodeURIComponent(virtualAccountNumber)}/transactions`);
          url.searchParams.set('fromDate', fromDate);   // yyyy-MM-dd or yyyyMMdd
          url.searchParams.set('toDate', toDate);       // yyyy-MM-dd or yyyyMMdd
          url.searchParams.set('pageSize', '100');      // optional (first call only)

          const response = await fetch(url.toString(), {
            method: 'GET',
            headers: {
              'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
              'Accept': 'application/json'
            }
          });

          if (!response.ok) {
            const error = await response.json();
            throw new Error(`Failed to get VA transactions: ${error.message || 'Unknown error'}`);
          }

          const result = await response.json();
          // result.meta.pagination: { page_start, page_token, total_size, page_size }
          // result.data: Array of VA transactions
          // Example: inspect first item
          if (result.data?.length) {
            const t = result.data[0];
            console.log('Tx:', t.id, t.description, t.valueDate, t.value?.amount, t.value?.currency, t.debitAccountNumber?.number, t.creditAccountNumber?.number);
          }
          return result;
        }


        // Paginate through all pages

        async function getAllVirtualAccountTransactions(virtualAccountNumber,
        fromDate, toDate) {
          let pageStart = 1;
          let pageToken = null;
          let totalPages = 0;
          const all = [];

          do {
            const url = new URL(`https://api.bcb.bm/v1/virtual-accounts/${encodeURIComponent(virtualAccountNumber)}/transactions`);
            url.searchParams.set('fromDate', fromDate);
            url.searchParams.set('toDate', toDate);
            if (pageStart === 1) {
              url.searchParams.set('pageSize', '100');   // first call only
            } else {
              url.searchParams.set('pageStart', String(pageStart));
              url.searchParams.set('pageToken', pageToken);
            }

            const res = await fetch(url.toString(), {
              headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Accept': 'application/json' }
            });
            if (!res.ok) throw new Error('Request failed');
            const body = await res.json();

            if (pageStart === 1) {
              const p = body.meta?.pagination;
              pageToken = p?.page_token;
              totalPages = Math.ceil((p?.total_size ?? 0) / (p?.page_size ?? 100));
              console.log('First page meta:', p);
            }

            if (Array.isArray(body.data)) all.push(...body.data);
            pageStart++;
          } while (pageStart <= totalPages);

          return all;
        }

        ```
      operationId: VirtualAccountsTransactions_Get
      parameters:
        - name: virtualAccountNumber
          in: path
          required: true
          description: Virtual account identifier (number) to retrieve transactions for.
          schema:
            type: string
          x-position: 1
        - name: fromDate
          in: query
          required: true
          description: 'The start date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 2
        - name: toDate
          in: query
          required: true
          description: 'The end date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 3
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 4
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 5
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 6
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponseOfVirtualAccountTransactionDetailOf
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: 202511150823456789.01,4
                        totalSize: 4
                        pageSize: 4
                    data:
                      - debitAccountNumber:
                          number: 8901234567
                          accountRoutings:
                            - scheme: BankId
                              address: CITIBANK N.A. NEW YORK
                            - scheme: AccountDetails
                              address: >-
                                GLOBAL TECH SOLUTIONS INC 455 MARKET STREET SAN
                                FRANCISCO CA 94105
                        creditAccountNumber:
                          number: 2000445678
                          accountRoutings: []
                        status: Completed
                        id: FT25319ABC12
                        description: WIRE TRANSFER FROM CORRESPONDENT BANK
                        bookingDate: '2025-11-15'
                        valueDate: '2025-11-15'
                        value:
                          currency: USD
                          amount: 25000
                        proprietaryBankTransactionCode: Inward Swift Payment
                      - debitAccountNumber:
                          number: 2000445678
                          accountRoutings: []
                        creditAccountNumber:
                          number: 4567890123
                          accountRoutings:
                            - scheme: BankId
                              address: HSBC BANK USA N.A. NEW YORK
                            - scheme: AccountDetails
                              address: >-
                                ATLANTIC SHIPPING CORP 89 WATER STREET HAMILTON
                                HM12 BERMUDA
                        status: Completed
                        id: FT25319XYZ45
                        description: SWIFT TRANSFER OUT FROM SUBACCOUNT
                        bookingDate: '2025-11-14'
                        valueDate: '2025-11-14'
                        value:
                          currency: USD
                          amount: -100.5
                        proprietaryBankTransactionCode: Debit Arrangement
                      - debitAccountNumber:
                          number: 2000123456
                          accountRoutings:
                            - scheme: AccountDetails
                              address: >-
                                MERIDIAN CAPITAL PARTNERS LTD 12 CHURCH STREET
                                HAMILTON HM11 BERMUDA
                        creditAccountNumber:
                          number: 2000445678
                          accountRoutings: []
                        status: Completed
                        id: FT25318DEF78
                        description: INTERNAL TRANSFER BETWEEN ACCOUNTS
                        bookingDate: '2025-11-13'
                        valueDate: '2025-11-13'
                        value:
                          currency: USD
                          amount: 15750.25
                        proprietaryBankTransactionCode: Transfer in
                      - debitAccountNumber:
                          number: 2000445678
                          accountRoutings: []
                        creditAccountNumber:
                          number: 7654321098
                          accountRoutings:
                            - scheme: BankId
                              address: BANK OF AMERICA N.A. CHARLOTTE
                            - scheme: AccountDetails
                              address: >-
                                PACIFIC TRADING COMPANY 2301 BUSINESS PARK DRIVE
                                SEATTLE WA 98108
                        status: Completed
                        id: FT25317GHI90
                        description: ACH PAYMENT TO VENDOR
                        bookingDate: '2025-11-12'
                        valueDate: '2025-11-12'
                        value:
                          currency: USD
                          amount: -8920
                        proprietaryBankTransactionCode: Debit Arrangement
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_debit_account_number_number\",\"data_0_debit_account_number_account_routings_0_scheme\",\"data_0_debit_account_number_account_routings_0_address\",\"data_0_debit_account_number_account_routings_1_scheme\",\"data_0_debit_account_number_account_routings_1_address\",\"data_0_credit_account_number_number\",\"data_0_status\",\"data_0_id\",\"data_0_description\",\"data_0_booking_date\",\"data_0_value_date\",\"data_0_value_currency\",\"data_0_value_amount\",\"data_0_proprietary_bank_transaction_code\",\"data_1_debit_account_number_number\",\"data_1_credit_account_number_number\",\"data_1_credit_account_number_account_routings_0_scheme\",\"data_1_credit_account_number_account_routings_0_address\",\"data_1_credit_account_number_account_routings_1_scheme\",\"data_1_credit_account_number_account_routings_1_address\",\"data_1_status\",\"data_1_id\",\"data_1_description\",\"data_1_booking_date\",\"data_1_value_date\",\"data_1_value_currency\",\"data_1_value_amount\",\"data_1_proprietary_bank_transaction_code\",\"data_2_debit_account_number_number\",\"data_2_debit_account_number_account_routings_0_scheme\",\"data_2_debit_account_number_account_routings_0_address\",\"data_2_credit_account_number_number\",\"data_2_status\",\"data_2_id\",\"data_2_description\",\"data_2_booking_date\",\"data_2_value_date\",\"data_2_value_currency\",\"data_2_value_amount\",\"data_2_proprietary_bank_transaction_code\",\"data_3_debit_account_number_number\",\"data_3_credit_account_number_number\",\"data_3_credit_account_number_account_routings_0_scheme\",\"data_3_credit_account_number_account_routings_0_address\",\"data_3_credit_account_number_account_routings_1_scheme\",\"data_3_credit_account_number_account_routings_1_address\",\"data_3_status\",\"data_3_id\",\"data_3_description\",\"data_3_booking_date\",\"data_3_value_date\",\"data_3_value_currency\",\"data_3_value_amount\",\"data_3_proprietary_bank_transaction_code\""
                    - >-
                      "1","202511150823456789.01,4","4","4","8901234567","BankId","CITIBANK
                      N.A. NEW YORK","AccountDetails","GLOBAL TECH SOLUTIONS INC
                      455 MARKET STREET SAN FRANCISCO CA
                      94105","2000445678","Completed","FT25319ABC12","WIRE
                      TRANSFER FROM CORRESPONDENT
                      BANK","2025-11-15","2025-11-15","USD","25000.00","Inward
                      Swift Payment","2000445678","4567890123","BankId","HSBC
                      BANK USA N.A. NEW YORK","AccountDetails","ATLANTIC
                      SHIPPING CORP 89 WATER STREET HAMILTON HM12
                      BERMUDA","Completed","FT25319XYZ45","SWIFT TRANSFER OUT
                      FROM
                      SUBACCOUNT","2025-11-14","2025-11-14","USD","-100.50","Debit
                      Arrangement","2000123456","AccountDetails","MERIDIAN
                      CAPITAL PARTNERS LTD 12 CHURCH STREET HAMILTON HM11
                      BERMUDA","2000445678","Completed","FT25318DEF78","INTERNAL
                      TRANSFER BETWEEN
                      ACCOUNTS","2025-11-13","2025-11-13","USD","15750.25","Transfer
                      in","2000445678","7654321098","BankId","BANK OF AMERICA
                      N.A. CHARLOTTE","AccountDetails","PACIFIC TRADING COMPANY
                      2301 BUSINESS PARK DRIVE SEATTLE WA
                      98108","Completed","FT25317GHI90","ACH PAYMENT TO
                      VENDOR","2025-11-12","2025-11-12","USD","-8920.00","Debit
                      Arrangement"
        '400':
          description: >-
            Bad Request - Validation failed (e.g., invalid date range, invalid
            pagination token).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Unauthorized - Authentication is required or token is
            invalid/expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/transactions/{transactionId}:
    get:
      tags:
        - Virtual Accounts
      summary: Virtual Account Transaction Details
      description: >-
        Retrieves detailed information for a specific virtual-account
        transaction identified by its globally unique transaction ID. This
        endpoint:


        - Returns a single transaction detail object with full context
        (accounts, amounts, value date, narrative, attributes)

        - Supports both JSON and CSV response formats based on the Accept header


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/transactions/{transactionId}

        ### Sample Request in JavaScript


        ```javascript

        async function getVirtualAccountTransactionDetail(transactionId) {
          const url = `https://api.bcb.bm/v1/virtual-accounts/transactions/${encodeURIComponent(transactionId)}`;
          const response = await fetch(url, {
            method: 'GET',
            headers: {
              'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
              'Accept': 'application/json'
            }
          });

          if (!response.ok) {
            const error = await response.json();
            throw new Error(`Failed to get VA transaction detail: ${error.message || 'Unknown error'}`);
          }

          const result = await response.json();
          // result is a single transaction detail object
          console.log('Transaction ID:', result.id);
          console.log('Description:', result.description);
          console.log('Value Date:', result.valueDate);
          if (result.value) {
            console.log('Amount:', result.value.amount, result.value.currency);
          }
          return result;
        }

        ```
      operationId: VirtualAccountsTransactions_GetDetails
      parameters:
        - name: transactionId
          in: path
          required: true
          description: The globally unique transaction identifier to retrieve details for.
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountTransactionDetail'
              examples:
                Json:
                  value:
                    debitAccountNumber:
                      number: 1111111111
                      accountRoutings: []
                    creditAccountNumber:
                      number: 2222222222
                      accountRoutings: []
                    status: COMPLETED
                    id: TX-2024-000123
                    description: Payout to sub-account
                    bookingDate: ''
                    valueDate: '2025-08-04'
                    value:
                      currency: USD
                      amount: 100
                    proprietaryBankTransactionCode: PARENT.TO.SUB
                Csv:
                  value: "\uFEFF\"debit_account_number_number\",\"credit_account_number_number\",\"status\",\"id\",\"description\",\"booking_date\",\"value_date\",\"value_currency\",\"value_amount\",\"proprietary_bank_transaction_code\"\n\"1111111111\",\"2222222222\",\"COMPLETED\",\"TX-2024-000123\",\"Payout to sub-account\",\"\",\"2025-08-04\",\"USD\",\"100.00\",\"PARENT.TO.SUB\"\n"
        '400':
          description: Bad Request - Validation failed or the request cannot be served.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Unauthorized - Authentication is required or token is
            invalid/expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
    delete:
      tags:
        - Virtual Accounts
      summary: Reverse Virtual Account Transaction
      description: >-
        Reverses a specific virtual-account transaction identified by its
        globally unique transaction ID. This endpoint:


        - Reverses the specified transaction and returns the reversal details

        - Supports both JSON and CSV response formats based on the Accept header

        - Requires appropriate permissions to perform transaction reversals


        ### Important Business Rules

        - **Same-Day Reversal Only**: The current development design allows only
        to reverse records created on the same day

        - **Live Status Required**: The transaction status must have "Live"
        status to be eligible for reversal


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/transactions/{transactionId}

        ### Sample Request in JavaScript


        ```javascript

        async function reverseVirtualAccountTransaction(transactionId) {
          const url = `https://api.bcb.bm/v1/virtual-accounts/transactions/${encodeURIComponent(transactionId)}`;
          const response = await fetch(url, {
            method: 'DELETE',
            headers: {
              'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
              'Accept': 'application/json',
              'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
            }
          });

          if (!response.ok) {
            const error = await response.json();
            throw new Error(`Failed to reverse VA transaction: ${error.message || 'Unknown error'}`);
          }

          const result = await response.json();
          // result is a transaction reversal object
          console.log('Reversal Transaction ID:', result.transactionId);
          console.log('Status:', result.status);
          console.log('Transaction Status:', result.transactionStatus);
          if (result.value) {
            console.log('Amount:', result.value.amount, result.value.currency);
          }
          return result;
        }

        ```
      operationId: VirtualAccountsTransactions_Reverse
      parameters:
        - name: transactionId
          in: path
          required: true
          description: The globally unique transaction identifier to reverse.
          schema:
            type: string
          x-position: 1
      responses:
        '201':
          description: Created - The transaction reversal was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountTransactionReversal'
              example:
                transactionId: FT252255GBQS
                transactionStatus: Reversed
                status: success
                uniqueIdentifier: FT252255GBQS
                value:
                  currency: USD
                  amount: 0.03
        '400':
          description: Bad Request - Validation failed or the request cannot be served.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Unauthorized - Authentication is required or token is
            invalid/expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict - The request could not be completed due to a conflict with
            the current state of the resource. This includes attempting to
            reverse an already reverted transaction without providing an
            idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{virtualAccountNumber}/deposits:
    get:
      tags:
        - Virtual Accounts
      summary: Get Virtual Account Deposits
      description: >-
        Retrieves deposit transaction entries for a specific virtual (sub)
        account.

        This endpoint:     

        - Returns detailed deposit transaction information including account
        numbers, amounts, and transaction status.

        - Supports both JSON and CSV response formats based on the Accept
        header.

        - Uses cursor-based pagination with server-side result-set management.


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `page_size` (default: 100, max:
        1000). The server creates a cursor and returns a `page_token`.

        - **Subsequent Requests**: Use the `page_token` from previous responses
        with `page_start` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        page_size, so don't specify `page_size` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.      


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{virtualAccountNumber}/deposits

        ### Sample Request in JavaScript

        ```javascript

        // Get first page of deposits

        async function getVirtualAccountDeposits(virtualAccountNumber, fromDate,
        toDate) {
          const url = new URL(`https://api.bcb.bm/v1/virtual-accounts/${encodeURIComponent(virtualAccountNumber)}/deposits`);
          url.searchParams.set('fromDate', fromDate);   // yyyy-MM-dd or yyyyMMdd
          url.searchParams.set('toDate', toDate);       // yyyy-MM-dd or yyyyMMdd
          url.searchParams.set('pageSize', '100');      // optional (first call only)

          const response = await fetch(url.toString(), {
            method: 'GET',
            headers: {
              'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
              'Accept': 'application/json'
            }
          });

          if (!response.ok) {
            const error = await response.json();
            throw new Error(`Failed to get VA deposits: ${error.message || 'Unknown error'}`);
          }

          const result = await response.json();
          // result.meta.pagination: { page_start, page_token, total_size, page_size }
          // result.data: Array of VA deposit transactions
          // Example: inspect first deposit
          if (result.data?.length) {
            const d = result.data[0];
            console.log('Deposit:', d.id, d.valueDate, d.value?.amount, d.value?.currency, d.proprietaryBankTransactionCode);
            console.log('From:', d.debitAccountNumber?.number, 'To:', d.creditAccountNumber?.number);
            console.log('Status:', d.status);
          }
          return result;
        }


        // Paginate through all deposit pages

        async function getAllVirtualAccountDeposits(virtualAccountNumber,
        fromDate, toDate) {
          let pageStart = 1;
          let pageToken = null;
          let totalPages = 0;
          const all = [];

          do {
            const url = new URL(`https://api.bcb.bm/v1/virtual-accounts/${encodeURIComponent(virtualAccountNumber)}/deposits`);
            url.searchParams.set('fromDate', fromDate);
            url.searchParams.set('toDate', toDate);
            if (pageStart === 1) {
              url.searchParams.set('pageSize', '100');   // first call only
            } else {
              url.searchParams.set('pageStart', String(pageStart));
              url.searchParams.set('pageToken', pageToken);
            }

            const res = await fetch(url.toString(), {
              headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Accept': 'application/json' }
            });
            if (!res.ok) throw new Error('Request failed');
            const body = await res.json();

            if (pageStart === 1) {
              const p = body.meta?.pagination;
              pageToken = p?.page_token;
              totalPages = Math.ceil((p?.total_size ?? 0) / (p?.page_size ?? 100));
              console.log('First page meta:', p);
            }

            if (Array.isArray(body.data)) all.push(...body.data);
            pageStart++;
          } while (pageStart <= totalPages);

          return all;
        }

        ```
      operationId: VirtualAccountsTransactions_GetDeposits
      parameters:
        - name: virtualAccountNumber
          in: path
          required: true
          description: Virtual account identifier (number) to retrieve deposits for.
          schema:
            type: string
          x-position: 1
        - name: fromDate
          in: query
          required: true
          description: 'The start date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 2
        - name: toDate
          in: query
          required: true
          description: 'The end date for the transaction range (format: yyyy-MM-dd).'
          schema:
            type: string
          x-position: 3
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 4
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 5
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 6
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponseOfVirtualAccountTransactionDetailOf
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: 202507250072428721.01,3
                        totalSize: 3
                        pageSize: 3
                    data:
                      - debitAccountNumber:
                          number: 445566778
                          accountRoutings:
                            - scheme: BankId
                              address: 2000033
                            - scheme: AccountDetails
                              address: >-
                                ALPHA MANUFACTURING CORP. 789 INDUSTRIAL BLVD
                                STE 200
                        creditAccountNumber:
                          number: 2000444555
                          accountRoutings: []
                        status: Completed
                        id: FT25123A7B9C
                        description: /ROC/4567890123///URI/JF MARCH INVOICE PAYMENT
                        bookingDate: ''
                        valueDate: '2025-03-15'
                        value:
                          currency: CAD
                          amount: 3250
                        proprietaryBankTransactionCode: Inward Swift Payment
                      - debitAccountNumber:
                          number: 112233445
                          accountRoutings:
                            - scheme: BankId
                              address: 2000044
                            - scheme: AccountDetails
                              address: >-
                                BETA CONSULTING GROUP LLC. 456 FINANCIAL
                                DISTRICT TOWER 15
                        creditAccountNumber:
                          number: 2000555666
                          accountRoutings: []
                        status: Completed
                        id: FT25124D8E2F
                        description: /ROC/9876543210///URI/JF APRIL CONSULTING FEE
                        bookingDate: ''
                        valueDate: '2025-04-22'
                        value:
                          currency: JPY
                          amount: 450000
                        proprietaryBankTransactionCode: Inward Swift Payment
                      - debitAccountNumber:
                          number: 778899001
                          accountRoutings:
                            - scheme: BankId
                              address: 2000055
                            - scheme: AccountDetails
                              address: >-
                                GAMMA PROPERTY HOLDINGS INC. 321 COMMERCIAL
                                PLAZA FLOOR 8
                        creditAccountNumber:
                          number: 2000666777
                          accountRoutings: []
                        status: Completed
                        id: FT25125G3H1I
                        description: /ROC/1357924680///URI/JF MAY RENTAL PAYMENT
                        bookingDate: ''
                        valueDate: '2025-05-08'
                        value:
                          currency: AUD
                          amount: 8750.25
                        proprietaryBankTransactionCode: Inward Swift Payment
                Csv:
                  value: "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_debit_account_number_number\",\"data_0_debit_account_number_account_routings_0_scheme\",\"data_0_debit_account_number_account_routings_0_address\",\"data_0_debit_account_number_account_routings_1_scheme\",\"data_0_debit_account_number_account_routings_1_address\",\"data_0_credit_account_number_number\",\"data_0_status\",\"data_0_id\",\"data_0_description\",\"data_0_booking_date\",\"data_0_value_date\",\"data_0_value_currency\",\"data_0_value_amount\",\"data_0_proprietary_bank_transaction_code\",\"data_1_debit_account_number_number\",\"data_1_debit_account_number_account_routings_0_scheme\",\"data_1_debit_account_number_account_routings_0_address\",\"data_1_debit_account_number_account_routings_1_scheme\",\"data_1_debit_account_number_account_routings_1_address\",\"data_1_credit_account_number_number\",\"data_1_status\",\"data_1_id\",\"data_1_description\",\"data_1_booking_date\",\"data_1_value_date\",\"data_1_value_currency\",\"data_1_value_amount\",\"data_1_proprietary_bank_transaction_code\",\"data_2_debit_account_number_number\",\"data_2_debit_account_number_account_routings_0_scheme\",\"data_2_debit_account_number_account_routings_0_address\",\"data_2_debit_account_number_account_routings_1_scheme\",\"data_2_debit_account_number_account_routings_1_address\",\"data_2_credit_account_number_number\",\"data_2_status\",\"data_2_id\",\"data_2_description\",\"data_2_booking_date\",\"data_2_value_date\",\"data_2_value_currency\",\"data_2_value_amount\",\"data_2_proprietary_bank_transaction_code\"\n\"1\",\"202507250072428721.01,3\",\"3\",\"3\",\"445566778\",\"BankId\",\"2000033\",\"AccountDetails\",\"ALPHA MANUFACTURING CORP. 789 INDUSTRIAL BLVD STE 200\",\"2000444555\",\"Completed\",\"FT25123A7B9C\",\"/ROC/4567890123///URI/JF MARCH INVOICE PAYMENT\",\"\",\"2025-03-15\",\"CAD\",\"3250.00\",\"Inward Swift Payment\",\"112233445\",\"BankId\",\"2000044\",\"AccountDetails\",\"BETA CONSULTING GROUP LLC. 456 FINANCIAL DISTRICT TOWER 15\",\"2000555666\",\"Completed\",\"FT25124D8E2F\",\"/ROC/9876543210///URI/JF APRIL CONSULTING FEE\",\"\",\"2025-04-22\",\"JPY\",\"450000.00\",\"Inward Swift Payment\",\"778899001\",\"BankId\",\"2000055\",\"AccountDetails\",\"GAMMA PROPERTY HOLDINGS INC. 321 COMMERCIAL PLAZA FLOOR 8\",\"2000666777\",\"Completed\",\"FT25125G3H1I\",\"/ROC/1357924680///URI/JF MAY RENTAL PAYMENT\",\"\",\"2025-05-08\",\"AUD\",\"8750.25\",\"Inward Swift Payment\"\n"
        '400':
          description: >-
            Bad Request - Validation failed (e.g., invalid date range, invalid
            pagination token).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Unauthorized - Authentication is required or token is
            invalid/expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{accountNumber}/transfers/credit:
    post:
      tags:
        - Virtual Accounts
      summary: Credit Virtual Account
      description: >-
        Credits funds to a virtual account from a parent account. This endpoint
        allows clients to transfer funds 

        into a virtual account.


        The request must include source account details, the amount to be
        credited, and currency information. 


        ### Key Features:

        - Transfers funds from a source account to a virtual account

        - Supports idempotency to prevent duplicate transactions

        - Validates account numbers and currency matching

        - Supports both JSON and CSV response formats

        - Automatic account number validation and matching


        ### Important Notes:

        - The virtual account number (creditAccountNumber) is specified in the
        URL route, not in the request body

        - Ensure the source account has sufficient funds before making the
        request

        - Virtual accounts must be in an active state to receive credits


        **Virtual Account Hierarchy**

        Virtual accounts are sub-accounts linked to a parent account:

        ```

        Parent Account → Virtual Account (Sub-Account)

        ```

        When crediting a virtual account, funds flow from the parent account to
        the virtual account.


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{accountNumber}/transfers/credit

        ### Sample Request in JavaScript:


        ```javascript

        async function creditVirtualAccount() {
          try {
            const virtualAccountNumber = "1556008272";
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${virtualAccountNumber}/transfers/credit`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitAccountNumber: "1000320567",
                debitAmountCurrency: "USD",
                creditAmountCurrency: "USD", // Must match debitAmountCurrency
                debitAmount: "100.00"
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Credit transfer failed: ${JSON.stringify(errorData)}`);
            }

            const data = await response.json();
            console.log('Credit transfer result:', data);

            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { debitAmount, valueDate, childTransactionId, creditAmountCurrency, debitAccountNumber, creditAccountNumber } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Debit Amount:', debitAmount.amount, debitAmount.currency);
            console.log('Value Date:', valueDate);
            console.log('Child Transaction ID:', childTransactionId);
            console.log('Credit Amount Currency:', creditAmountCurrency);

            // Process debit account information
            console.log('Debit Account Number:', debitAccountNumber.number);

            // Process credit account information (virtual account)
            console.log('Credit Account Number:', creditAccountNumber.number);

            // Process linked activities
            linkedActivities.forEach(activity => {
              console.log('Linked Activity ID:', activity.id);
              console.log('Linked Activity Transaction Status:', activity.transactionStatus);
              console.log('Linked Activity Status:', activity.status);
              console.log('Linked Activity Unique Identifier:', activity.uniqueIdentifier);
              const { arrangementId, activityId, productId, currencyId, effectiveDate } = activity.activityDetails;
              console.log('Linked Activity Arrangement ID:', arrangementId);
              console.log('Linked Activity Activity ID:', activityId);
              console.log('Linked Activity Product ID:', productId);
              console.log('Linked Activity Currency ID:', currencyId);
              console.log('Linked Activity Effective Date:', effectiveDate);
            });

            // Final status logging
            if (status === 'success') {
              console.log('The virtual account credit was successful.');
            } else {
              console.log('The virtual account credit failed:', status);
            }
          } catch (error) {
            console.error('Error crediting virtual account:', error);
          }
        }


        creditVirtualAccount();

        ```
      operationId: VirtualAccountsTransfers_Credit
      parameters:
        - name: accountNumber
          in: path
          required: true
          description: The virtual account number to be credited.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: The credit transfer request details.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualAccountCreditRequest'
            example:
              debitAccountNumber: 1000320567
              debitAmountCurrency: USD
              creditAmountCurrency: USD
              debitAmount: 100
        x-position: 2
      responses:
        '201':
          description: The virtual account was credited successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountTransferDetails
              examples:
                Json:
                  value:
                    id: AA25174JFTXZ
                    status: success
                    uniqueIdentifier: fc17c362-ae8c-47b9-9080-7e475ac31c96
                    details:
                      debitAmount:
                        currency: USD
                        amount: 100
                      valueDate: '2025-06-20'
                      childTransactionId: 292386
                      creditAmountCurrency: USD
                      debitAccountNumber:
                        number: 1000320567
                        accountRoutings:
                          - scheme: IBAN
                            address: BM12BCBK12345678901234
                      creditAccountNumber:
                        number: 1556008272
                        accountRoutings:
                          - scheme: IBAN
                            address: BM12BCBK15560082723456
                    linkedActivities:
                      - id: activity-123
                        transactionStatus: SUCCESS
                        status: COMPLETED
                        uniqueIdentifier: unique-activity-123
                        activityDetails:
                          arrangementId: arrangement-123
                          activityId: activity-123
                          productId: product-123
                          currencyId: USD
                          effectiveDate: '2025-06-20'
                Csv:
                  value:
                    - "\uFEFF\"id\",\"status\",\"unique_identifier\",\"details_debit_amount_currency\",\"details_debit_amount_amount\",\"details_value_date\",\"details_child_transaction_id\",\"details_credit_amount_currency\",\"details_debit_account_number_number\",\"details_debit_account_number_account_routings_0_scheme\",\"details_debit_account_number_account_routings_0_address\",\"details_credit_account_number_number\",\"details_credit_account_number_account_routings_0_scheme\",\"details_credit_account_number_account_routings_0_address\",\"linked_activities_0_id\",\"linked_activities_0_transaction_status\",\"linked_activities_0_status\",\"linked_activities_0_unique_identifier\",\"linked_activities_0_activity_details_arrangement_id\",\"linked_activities_0_activity_details_activity_id\",\"linked_activities_0_activity_details_product_id\",\"linked_activities_0_activity_details_currency_id\",\"linked_activities_0_activity_details_effective_date\""
                    - >-
                      "AA25174JFTXZ","success","fc17c362-ae8c-47b9-9080-7e475ac31c96","USD","100.00","2025-06-20","292386","USD","1000320567","IBAN","BM12BCBK12345678901234","1556008272","IBAN","BM12BCBK15560082723456","activity-123","SUCCESS","COMPLETED","unique-activity-123","arrangement-123","activity-123","product-123","USD","2025-06-20"
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the credit transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{accountNumber}/transfers/debit:
    post:
      tags:
        - Virtual Accounts
      summary: Debit Virtual Account
      description: >-
        Initiates a debit transfer from a virtual (sub) account to transfer
        funds to the parent account and ultimately to the settlement account. 

        This endpoint allows corporate clients to withdraw funds from their
        virtual accounts for settlement purposes.
                    
        **Use Case**: As a corporate client, I want to debit a sub account to
        transfer funds to the parent account and ultimately to the settlement
        account.
                    
        ### Key Features:

        - Transfers funds from a virtual account to a main account

        - Supports idempotency to prevent duplicate transactions

        - Validates account numbers and currency matching

        - Supports both JSON and CSV response formats

        - Automatic account number validation and matching


        ### Important Notes:

        - The virtual account number (debitAccountNumber) is specified in the
        URL route, not in the request body

        - Ensure the virtual account has sufficient funds before making the
        request
                    
        **Virtual Account Hierarchy**

        Virtual accounts are sub-accounts linked to a parent account:

        ```

        Virtual Account (Sub-Account) → Parent Account

        ```

        When debiting a virtual account, funds flow from the virtual account to
        the parent account.
                    
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").
                    
        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{accountNumber}/transfers/debit
            
        ### Sample Request in JavaScript:
                    
        ```javascript

        async function debitVirtualAccount() {
          try {
            const accountNumber = "1000000000"; // Virtual account number
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${accountNumber}/transfers/debit`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitAmount: "1000.00",
                debitAmountCurrency: "USD",
                creditAccountNumber: "1000320567", // Parent/settlement account
                creditAmountCurrency: "USD", // Must match debitAmountCurrency
              })
            });
                    
            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Debit transfer failed: ${JSON.stringify(errorData)}`);
            }
                    
            const data = await response.json();
            console.log('Debit transfer result:', data);
                    
            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { debitAmount, valueDate, childTransactionId, creditAmountCurrency, debitAccountNumber, creditAccountNumber } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Debit Amount:', debitAmount.amount, debitAmount.currency);
            console.log('Value Date:', valueDate);
            console.log('Child Transaction ID:', childTransactionId);
            console.log('Credit Amount Currency:', creditAmountCurrency);
            
            // Process debit account information
            console.log('Debit Account Number:', debitAccountNumber.number);
            
            // Process credit account information
            console.log('Credit Account Number:', creditAccountNumber.number);
            
            // Process linked activities
            linkedActivities.forEach(activity => {
              console.log('Linked Activity ID:', activity.id);
              console.log('Linked Activity Transaction Status:', activity.transactionStatus);
              console.log('Linked Activity Status:', activity.status);
              console.log('Linked Activity Unique Identifier:', activity.uniqueIdentifier);
              const { arrangementId, activityId, productId, currencyId, effectiveDate } = activity.activityDetails;
              console.log('Linked Activity Arrangement ID:', arrangementId);
              console.log('Linked Activity Activity ID:', activityId);
              console.log('Linked Activity Product ID:', productId);
              console.log('Linked Activity Currency ID:', currencyId);
              console.log('Linked Activity Effective Date:', effectiveDate);
            });
            
            // Final status logging
            if (status === 'SUCCESS') {
              console.log('The debit transfer was successful.');
            } else {
              console.log('The debit transfer failed:', status);
            }
                    
          } catch (error) {
            console.error('Error debiting virtual account:', error);
          }
        }


        // Execute example

        debitVirtualAccount();

        ```
      operationId: VirtualAccountsTransfers_Debit
      parameters:
        - name: accountNumber
          in: path
          required: true
          description: The virtual account number to be debited.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: The debit transfer request details.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualAccountDebitRequest'
            example:
              creditAccountNumber: 1556008272
              debitAmountCurrency: USD
              creditAmountCurrency: USD
              debitAmount: 100
        x-position: 2
      responses:
        '201':
          description: The virtual account was debited successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountTransferDetails
              examples:
                Json:
                  value:
                    id: AA25174JFTXZ
                    status: success
                    uniqueIdentifier: fc17c362-ae8c-47b9-9080-7e475ac31c96
                    details:
                      debitAmount:
                        currency: USD
                        amount: 100
                      valueDate: '2025-06-20'
                      childTransactionId: 292386
                      creditAmountCurrency: USD
                      debitAccountNumber:
                        number: 1000320567
                        accountRoutings:
                          - scheme: IBAN
                            address: BM12BCBK12345678901234
                      creditAccountNumber:
                        number: 1556008272
                        accountRoutings:
                          - scheme: IBAN
                            address: BM12BCBK15560082723456
                    linkedActivities:
                      - id: activity-123
                        transactionStatus: SUCCESS
                        status: COMPLETED
                        uniqueIdentifier: unique-activity-123
                        activityDetails:
                          arrangementId: arrangement-123
                          activityId: activity-123
                          productId: product-123
                          currencyId: USD
                          effectiveDate: '2025-06-20'
                Csv:
                  value:
                    - "\uFEFF\"id\",\"status\",\"unique_identifier\",\"details_debit_amount_currency\",\"details_debit_amount_amount\",\"details_value_date\",\"details_child_transaction_id\",\"details_credit_amount_currency\",\"details_debit_account_number_number\",\"details_debit_account_number_account_routings_0_scheme\",\"details_debit_account_number_account_routings_0_address\",\"details_credit_account_number_number\",\"details_credit_account_number_account_routings_0_scheme\",\"details_credit_account_number_account_routings_0_address\",\"linked_activities_0_id\",\"linked_activities_0_transaction_status\",\"linked_activities_0_status\",\"linked_activities_0_unique_identifier\",\"linked_activities_0_activity_details_arrangement_id\",\"linked_activities_0_activity_details_activity_id\",\"linked_activities_0_activity_details_product_id\",\"linked_activities_0_activity_details_currency_id\",\"linked_activities_0_activity_details_effective_date\""
                    - >-
                      "AA25174JFTXZ","success","fc17c362-ae8c-47b9-9080-7e475ac31c96","USD","100.00","2025-06-20","292386","USD","1000320567","IBAN","BM12BCBK12345678901234","1556008272","IBAN","BM12BCBK15560082723456","activity-123","SUCCESS","COMPLETED","unique-activity-123","arrangement-123","activity-123","product-123","USD","2025-06-20"
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the debit transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{settlementAccountNumber}/settlements/internal:
    post:
      tags:
        - Virtual Accounts
      summary: Counter-party Settlement Transfer (Internal)
      description: >-
        Corporate Client initiates Settlement request to BCB to debit Settlement
        Account and credit to Counterparty Account.

        This endpoint allows clients to transfer funds from a settlement account
        to an internal counterparty account.


        ### Key Features:

        - Transfers funds from a settlement account to an internal counterparty
        account

        - Supports idempotency to prevent duplicate transactions

        - Validates account numbers and currency matching

        - Supports both JSON and CSV response formats

        - Automatic settlement account number validation


        ### Important Notes:

        - The settlementAccountNumber in the route parameter identifies the
        source settlement account

        - The creditAccountNumber in the request body specifies the destination
        counterparty account

        - Ensure the settlement account has sufficient funds before making the
        request

        - Settlement accounts must be in an active state to process transfers


        ### Settlement Account Structure

        Settlement accounts are special accounts used for counterparty
        transactions:

        ```

        Settlement Account → Counterparty Account (Internal)

        ```

        When processing a settlement transfer, funds flow from the settlement
        account to the counterparty account.


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{settlementAccountNumber}/settlements/internal

        ### Sample Request in JavaScript:


        ```javascript

        async function processInternalSettlement() {
          try {
            const settlementAccountNumber = "1000320559";
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${settlementAccountNumber}/settlements/internal`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitCurrency: "USD",
                creditAmount: {
                  amount: "1000.00",
                  currency: "USD"
                },
                creditAccountNumber: "1000076925"
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Internal settlement failed: ${JSON.stringify(errorData)}`);
            }

            const data = await response.json();
            console.log('Internal settlement result:', data);

            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { creditAmount, debitAmountCurrency, debitAccountNumber, creditAccountNumber, valueDate } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Credit Amount:', creditAmount.amount, creditAmount.currency);
            console.log('Debit Amount Currency:', debitAmountCurrency);
            console.log('Value Date:', valueDate);

            // Process debit account information (settlement account)
            console.log('Debit Account Number:', debitAccountNumber.number);

            // Process credit account information (counterparty account)
            console.log('Credit Account Number:', creditAccountNumber.number);

            // Final status logging
            if (status === 'success') {
              console.log('The internal settlement was successful.');
            } else {
              console.log('The internal settlement failed:', status);
            }
          } catch (error) {
            console.error('Error processing internal settlement:', error);
          }
        }


        processInternalSettlement();

        ```
      operationId: VirtualAccountsTransfersSettlement_SettlementInternal
      parameters:
        - name: settlementAccountNumber
          in: path
          required: true
          description: The settlement account number from which funds will be debited.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: Payload containing internal settlement transfer details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/VirtualAccountSettlementTransferRequestInternal
            example:
              debitCurrency: USD
              creditAmount:
                currency: USD
                amount: 0.01
              creditAccountNumber: 1000076925
        required: true
        x-position: 2
      responses:
        '201':
          description: The settlement transfer was processed successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountSettlementTransfer
              example:
                id: FT252324K67K
                status: success
                uniqueIdentifier: IRFX252332872527361.00
                details:
                  creditAmount:
                    currency: USD
                    amount: 10.01
                  debitAmountCurrency: USD
                  debitAccountNumber:
                    number: 1000320559
                    accountRoutings: []
                  creditAccountNumber:
                    number: 1000076925
                    accountRoutings: []
                  valueDate: '2025-08-20T07:36:00.0000000Z'
                linkedActivities: []
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the settlement transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{settlementAccountNumber}/settlements/external:
    post:
      tags:
        - Virtual Accounts
      summary: Counter-party Settlement Transfer (External)
      description: >-
        Corporate Client initiates External Settlement request to BCB to debit
        Settlement Account and credit to External Counterparty Account.

        This endpoint allows clients to transfer funds from a settlement account
        to an external counterparty account.


        ### Key Features:

        - Transfers funds from a settlement account to an external counterparty
        account

        - Supports idempotency to prevent duplicate transactions

        - Supports both JSON and CSV response formats

        - Automatic settlement account number validation

        - Includes beneficiary and ordering customer information for external
        transfers


        ### Important Notes:

        - The settlementAccountNumber in the route parameter identifies the
        source settlement account

        - The request body specifies the destination external counterparty
        account via `creditorAccount.identification` (e.g., IBAN)

        - Ensure the settlement account has sufficient funds before making the
        request

        - Settlement accounts must be in an active state to process transfers

        - External transfers require additional beneficiary information for
        compliance


        ### Settlement Account Structure

        Settlement accounts are special accounts used for counterparty
        transactions:

        ```

        Settlement Account → External Counterparty Account

        ```

        When processing an external settlement transfer, funds flow from the
        settlement account to the external counterparty account.


        ### External Transfer Requirements

        External transfers require additional information for regulatory
        compliance:

        - **debitCurrency**: Currency to debit from the settlement account
        (e.g., "USD")

        - **creditAmount**: Amount and currency to credit externally (e.g., {
        amount: "19", currency: "GBP" })

        - **debtor**: Ordering customer information (e.g., company name or
        reference)

        - **debtorAgent**: Ordering bank/agent identifier (free text)

        - **creditorAccount.identification**: External beneficiary account
        identifier (e.g., IBAN)

        - **creditorAccount.name / additionalInformation**: Beneficiary name and
        auxiliary details

        - **chargesType**: Who bears charges (e.g., OUR, BEN, SHA)

        - **creditorAgent**: Beneficiary bank info (identification, name,
        additionalInformation)

        - **intermediaryAgent** (optional): Intermediary bank info
        (identification, name, additionalInformation)

        - **remittanceInformation** (optional): Unstructured remittance lines


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{settlementAccountNumber}/settlements/external

        ### Sample Request in JavaScript:


        ```javascript

        async function processExternalSettlement() {
          try {
            const settlementAccountNumber = "1000320559";
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${settlementAccountNumber}/settlements/external`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitCurrency: "USD",
                creditAmount: {
                  amount: "19",
                  currency: "GBP"
                },
                debtor: "ACME GLOBAL TRADING INC.",
                debtorAgent: "FIRST ATLANTIC BANK",
                creditorAccount: {
                  identification: "GB29NWBK60161331926819",
                  name: "OMEGA INTERNATIONAL LTD.",
                  additionalInformation: ["LONDON", "GB"]
                },
                chargesType: "OUR",
                creditorAgent: {
                  identification: "//ZZ123456789",
                  name: "OMEGA BANK",
                  additionalInformation: ["LONDON", "UK"]
                },
                intermediaryAgent: {
                  identification: "INTL",
                  name: "EURO CLEAR BANK",
                  additionalInformation: ["BRUSSELS", "BE"]
                },
                remittanceInformation: ["INVOICE 2025-00042"]
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`External settlement failed: ${JSON.stringify(errorData)}`);
            }

            const data = await response.json();
            console.log('External settlement result:', data);

            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { creditAmount, debitAmountCurrency, debitAccountNumber, creditAccountNumber, valueDate } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Credit Amount:', creditAmount.amount, creditAmount.currency);
            console.log('Debit Amount Currency:', debitAmountCurrency);
            console.log('Value Date:', valueDate);

            // Process debit account information (settlement account)
            console.log('Debit Account Number:', debitAccountNumber.number);

            // Process credit account information (external counterparty account)
            console.log('Credit Account Number:', creditAccountNumber.number);

            // Final status logging
            if (status === 'success') {
              console.log('The external settlement was successful.');
            } else {
              console.log('The external settlement failed:', status);
            }
          } catch (error) {
            console.error('Error processing external settlement:', error);
          }
        }


        processExternalSettlement();

        ```
      operationId: VirtualAccountsTransfersSettlement_SettlementExternal
      parameters:
        - name: settlementAccountNumber
          in: path
          required: true
          description: The settlement account number from which funds will be debited.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: Payload containing external settlement transfer details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/VirtualAccountSettlementTransferRequestExternal
            example:
              debitCurrency: USD
              creditAmount:
                currency: GBP
                amount: 19
              debtor: ACME GLOBAL TRADING INC.
              debtorAgent: FIRST ATLANTIC BANK
              creditorAccount:
                identification: GB29NWBK60161331926819
                name: OMEGA INTERNATIONAL LTD.
                additionalInformation:
                  - LONDON
                  - GB
              chargesType: OUR
              creditorAgent:
                identification: //ZZ123456789
                name: OMEGA BANK
                additionalInformation:
                  - LONDON
                  - UK
              intermediaryAgent:
                identification: INTL
                name: EURO CLEAR BANK
                additionalInformation:
                  - BRUSSELS
                  - BE
              remittanceInformation:
                - INVOICE 2025-00042
        required: true
        x-position: 2
      responses:
        '201':
          description: The settlement transfer was processed successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountSettlementTransfer
              example:
                id: FT252324K67K
                status: success
                uniqueIdentifier: IRFX252332872527361.00
                details:
                  creditAmount:
                    currency: USD
                    amount: 10.01
                  debitAmountCurrency: USD
                  debitAccountNumber:
                    number: 1000320559
                    accountRoutings: []
                  creditAccountNumber:
                    number: 1000076925
                    accountRoutings: []
                  valueDate: '2025-08-20T07:36:00.0000000Z'
                linkedActivities: []
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the settlement transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{virtualAccountId}/withdrawals/internal:
    post:
      tags:
        - Virtual Accounts
      summary: Withdraw funds (Internal)
      description: >-
        Initiates an internal withdrawal transfer from a virtual account to an
        internal destination account.

        This endpoint allows clients to withdraw funds from a virtual account to
        an internal account within the institution.


        ### Key Features:

        - Withdraws funds from a virtual account to an internal destination
        account

        - Supports idempotency to prevent duplicate transactions

        - Validates account numbers and currency matching

        - Supports both JSON and CSV response formats

        - Automatic virtual account number validation


        ### Important Notes:

        - The virtualAccountId in the route parameter identifies the source
        virtual account

        - The creditAccountNumber in the request body specifies the destination
        internal account

        - Ensure the virtual account has sufficient funds before making the
        request

        - Virtual accounts must be in an active state to process withdrawals


        ### Virtual Account Withdrawal Structure

        Virtual account withdrawals transfer funds from virtual accounts to
        internal accounts:

        ```

        Virtual Account → Internal Destination Account

        ```

        When processing a withdrawal transfer, funds flow from the virtual
        account to the internal destination account.


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{virtualAccountId}/withdrawals/internal

        ### Sample Request in JavaScript:


        ```javascript

        async function withdrawFromVirtualAccount() {
          try {
            const virtualAccountId = "1000320575";
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${virtualAccountId}/withdrawals/internal`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitCurrency: "USD",
                creditAmount: {
                  currency: "USD",
                  amount: "100.00"
                },
                creditAccountNumber: "1000076925"
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Withdrawal transfer failed: ${JSON.stringify(errorData)}`);
            }

            const data = await response.json();
            console.log('Withdrawal transfer result:', data);

            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { debitAmount, valueDate, childTransactionId, creditAmountCurrency, debitAccountNumber, creditAccountNumber } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Debit Amount:', debitAmount.amount, debitAmount.currency);
            console.log('Value Date:', valueDate);
            console.log('Child Transaction ID:', childTransactionId);
            console.log('Credit Amount Currency:', creditAmountCurrency);

            // Process debit account information (virtual account)
            console.log('Debit Account Number:', debitAccountNumber.number);

            // Process credit account information (internal destination)
            console.log('Credit Account Number:', creditAccountNumber.number);

            // Process linked activities
            linkedActivities.forEach(activity => {
              console.log('Linked Activity ID:', activity.id);
              console.log('Linked Activity Transaction Status:', activity.transactionStatus);
              console.log('Linked Activity Status:', activity.status);
              console.log('Linked Activity Unique Identifier:', activity.uniqueIdentifier);
              const { arrangementId, activityId, productId, currencyId, effectiveDate } = activity.activityDetails;
              console.log('Linked Activity Arrangement ID:', arrangementId);
              console.log('Linked Activity Activity ID:', activityId);
              console.log('Linked Activity Product ID:', productId);
              console.log('Linked Activity Currency ID:', currencyId);
              console.log('Linked Activity Effective Date:', effectiveDate);
            });

            // Final status logging
            if (status === 'success') {
              console.log('The virtual account withdrawal was successful.');
            } else {
              console.log('The virtual account withdrawal failed:', status);
            }
          } catch (error) {
            console.error('Error withdrawing from virtual account:', error);
          }
        }


        // Example usage:

        withdrawFromVirtualAccount();

        ```
      operationId: VirtualAccountsTransfersWithdrawal_WithdrawalInternal
      parameters:
        - name: virtualAccountId
          in: path
          required: true
          description: The virtual account number from which funds will be withdrawn.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: Payload containing internal withdrawal transfer details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/VirtualAccountWithDrawalTransferRequestInternal
            example:
              debitCurrency: USD
              creditAmount:
                currency: USD
                amount: 0.01
              creditAccountNumber: 1000076925
        required: true
        x-position: 2
      responses:
        '201':
          description: The withdrawal transfer was processed successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountWithdrawalTransfer
              example:
                id: FT252324K67K
                status: success
                uniqueIdentifier: IRFX252332872527361.00
                details:
                  creditAmount:
                    currency: USD
                    amount: 10.01
                  debitAmountCurrency: USD
                  debitAccountNumber:
                    number: 1000320559
                    accountRoutings: []
                  creditAccountNumber:
                    number: 1000076925
                    accountRoutings: []
                  valueDate: '2025-08-20T07:36:00.0000000Z'
                linkedActivities: []
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the withdrawal transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/virtual-accounts/{virtualAccountId}/withdrawals/external:
    post:
      tags:
        - Virtual Accounts
      summary: Withdraw funds (External)
      description: >-
        Corporate Client initiates External Withdrawal request to BCB to debit
        Virtual Account and credit to External Beneficiary Account.

        This endpoint allows clients to withdraw funds from a virtual account to
        an external beneficiary account.


        ### Key Features:

        - Withdraws funds from a virtual account to an external beneficiary
        account

        - Supports idempotency to prevent duplicate transactions

        - Supports both JSON and CSV response formats

        - Automatic virtual account number validation

        - Includes comprehensive beneficiary and ordering customer information
        for external transfers


        ### Important Notes:

        - The virtualAccountId in the route parameter identifies the source
        virtual account

        - The request body specifies the destination external beneficiary
        account via `creditorAccount.identification` (e.g., IBAN)

        - Ensure the virtual account has sufficient funds before making the
        request

        - Virtual accounts must be in an active state to process withdrawals

        - External transfers require additional beneficiary information for
        compliance


        ### Virtual Account Withdrawal Structure

        Virtual account withdrawals transfer funds from virtual accounts to
        external beneficiary accounts:

        ```

        Virtual Account → External Beneficiary Account

        ```

        When processing an external withdrawal transfer, funds flow from the
        virtual account to the external beneficiary account.


        ### External Transfer Requirements

        External transfers require additional information for regulatory
        compliance:

        - **debitCurrency**: Currency to debit from the virtual account (e.g.,
        "USD")

        - **creditAmount**: Amount and currency to credit externally (e.g., {
        amount: "2500.00", currency: "USD" })

        - **debtor**: Ordering customer information (e.g., company name or
        reference)

        - **debtorAgent**: Ordering bank/agent identifier (free text)

        - **creditorAccount.identification**: External beneficiary account
        identifier (e.g., IBAN)

        - **creditorAccount.name / additionalInformation**: Beneficiary name and
        auxiliary details

        - **chargesType**: Who bears charges (e.g., OUR, BEN, SHA)

        - **creditorAgent**: Beneficiary bank info (identification, name,
        additionalInformation)

        - **intermediaryAgent** (optional): Intermediary bank info
        (identification, name, additionalInformation)

        - **remittanceInformation** (optional): Unstructured remittance lines


        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided for a new transaction, the
        system stores the key and associates it with the transaction results

        - If the same idempotency key is received again for the same
        endpoint/action, the system returns the previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000").


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/virtual-accounts/{virtualAccountId}/withdrawals/external

        ### Sample Request in JavaScript:


        ```javascript

        async function processExternalWithdrawal() {
          try {
            const virtualAccountId = "1000320575";
            const response = await fetch(`https://api.bcb.bm/v1/virtual-accounts/${virtualAccountId}/withdrawals/external`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'Idempotency-Key': '123e4567-e89b-12d3-a456-426614174000' // Optional
              },
              body: JSON.stringify({
                debitCurrency: "USD",
                creditAmount: {
                  currency: "USD",
                  amount: "2500.00"
                },
                debtor: "John Smith Corporation",
                debtorAgent: "CHASUS33XXX",
                creditorAccount: {
                  identification: "GB29NWBK60161331926819",
                  name: "Acme Manufacturing Ltd",
                  additionalInformation: [
                    "123 Business Street",
                    "London, UK SW1A 1AA"
                  ]
                },
                chargesType: "OUR",
                creditorAgent: {
                  identification: "NWBKGB2L",
                  name: "NatWest Bank",
                  additionalInformation: [
                    "250 Bishopsgate",
                    "London, UK EC2M 4AA"
                  ]
                },
                intermediaryAgent: {
                  identification: "CHASUS33",
                  name: "JPMorgan Chase Bank",
                  additionalInformation: [
                    "383 Madison Avenue",
                    "New York, NY 10017"
                  ]
                },
                remittanceInformation: [
                  "Withdrawal from Virtual Account VA-2024-001",
                  "Transfer to external beneficiary account",
                  "Reference: WD-2024-789456"
                ]
              })
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`External withdrawal transfer failed: ${JSON.stringify(errorData)}`);
            }

            const data = await response.json();
            console.log('External withdrawal transfer result:', data);

            // Example processing of the returned object
            const { id, status, uniqueIdentifier, details, linkedActivities } = data;
            const { debitAmount, valueDate, childTransactionId, creditAmountCurrency, debitAccountNumber, creditAccountNumber } = details;

            // Log the main transfer details
            console.log('Transaction ID:', id);
            console.log('Status:', status);
            console.log('Unique Identifier:', uniqueIdentifier);
            console.log('Debit Amount:', debitAmount.amount, debitAmount.currency);
            console.log('Value Date:', valueDate);
            console.log('Child Transaction ID:', childTransactionId);
            console.log('Credit Amount Currency:', creditAmountCurrency);

            // Process debit account information (virtual account)
            console.log('Debit Account Number:', debitAccountNumber.number);

            // Process credit account information (external beneficiary account)
            console.log('Credit Account Number:', creditAccountNumber.number);

            // Process linked activities
            linkedActivities.forEach(activity => {
              console.log('Linked Activity ID:', activity.id);
              console.log('Linked Activity Transaction Status:', activity.transactionStatus);
              console.log('Linked Activity Status:', activity.status);
              console.log('Linked Activity Unique Identifier:', activity.uniqueIdentifier);
              const { arrangementId, activityId, productId, currencyId, effectiveDate } = activity.activityDetails;
              console.log('Linked Activity Arrangement ID:', arrangementId);
              console.log('Linked Activity Activity ID:', activityId);
              console.log('Linked Activity Product ID:', productId);
              console.log('Linked Activity Currency ID:', currencyId);
              console.log('Linked Activity Effective Date:', effectiveDate);
            });

            // Final status logging
            if (status === 'success') {
              console.log('The external withdrawal was successful.');
            } else {
              console.log('The external withdrawal failed:', status);
            }
          } catch (error) {
            console.error('Error processing external withdrawal:', error);
          }
        }


        // Example usage:

        processExternalWithdrawal();

        ```
      operationId: VirtualAccountsTransfersWithdrawal_WithdrawalExternal
      parameters:
        - name: virtualAccountId
          in: path
          required: true
          description: The virtual account number from which funds will be withdrawn.
          schema:
            type: string
            maxLength: 36
            minLength: 1
          x-position: 1
      requestBody:
        x-name: request
        description: Payload containing external withdrawal transfer details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/VirtualAccountWithDrawalTransferRequestExternal
            example:
              debitCurrency: USD
              creditAmount:
                currency: USD
                amount: 2500
              debtor: John Smith Corporation
              debtorAgent: CHASUS33XXX
              creditorAccount:
                identification: GB29NWBK60161331926819
                name: Acme Manufacturing Ltd
                additionalInformation:
                  - 123 Business Street
                  - London, UK SW1A 1AA
              chargesType: OUR
              creditorAgent:
                identification: NWBKGB2L
                name: NatWest Bank
                additionalInformation:
                  - 250 Bishopsgate
                  - London, UK EC2M 4AA
              intermediaryAgent:
                identification: CHASUS33
                name: JPMorgan Chase Bank
                additionalInformation:
                  - 383 Madison Avenue
                  - New York, NY 10017
              remittanceInformation:
                - Withdrawal from Virtual Account VA-2024-001
                - Transfer to external beneficiary account
                - 'Reference: WD-2024-789456'
        required: true
        x-position: 2
      responses:
        '201':
          description: The withdrawal transfer was processed successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VirtualAccountTransferOfVirtualAccountWithdrawalTransfer
              example:
                id: FT252324K67K
                status: success
                uniqueIdentifier: IRFX252332872527361.00
                details:
                  creditAmount:
                    currency: USD
                    amount: 10.01
                  debitAmountCurrency: USD
                  debitAccountNumber:
                    number: 1000320559
                    accountRoutings: []
                  creditAccountNumber:
                    number: 1000076925
                    accountRoutings: []
                  valueDate: '2025-08-20T07:36:00.0000000Z'
                linkedActivities: []
        '400':
          description: >-
            The request is invalid; verify account numbers, amounts, and ensure
            currencies match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred processing the withdrawal transfer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/jobs:
    get:
      tags:
        - Background Jobs
      summary: Get All Background Jobs
      description: >-
        Retrieves a paginated list of background jobs for the authenticated
        client. This endpoint:


        - Returns only **active** jobs (status: Pending or InProgress)

        - Completed, failed, or cancelled jobs are not included in this list

        - Provides job status information including progress summaries

        - Supports pagination for efficient handling of large job datasets


        ### Job Status Information

        Each job entry includes:

        - **JobId**: Unique identifier for the batch job

        - **JobStatus**: Current status (Pending, InProgress, Completed,
        CompletedWithErrors, Cancelled)
          - **Pending**: Job has been created and is waiting to be processed
          - **InProgress**: Job is currently being processed  
          - **Completed**: Job has completed successfully with no errors
          - **CompletedWithErrors**: Job has completed but some items failed during processing
          - **Cancelled**: Job has been cancelled and will not be processed further
        - **EventType**: Type of status event (typically "job.status")

        - **Summary**: Progress statistics (Total, Completed, Failed counts)


        ### Pagination

        This endpoint uses simple numeric pagination:

        - **pageStart**: 1-based index of the first record to return (default:
        1)

        - **pageSize**: Number of records to return (default: 100, maximum:
        1000)

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from response metadata


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/jobs

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getAllBackgroundJobs(pageStart = 1, pageSize = 50) {
          try {
            // Build URL with pagination parameters
            let url = 'https://api.bcb.bm/v1/jobs';
            const params = new URLSearchParams();
            
            params.append('pageStart', pageStart.toString());
            params.append('pageSize', pageSize.toString());
            
            url += '?' + params.toString();

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Background jobs retrieval failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const result = await response.json();

            // Access pagination info
            const pagination = result.meta.pagination;
            console.log(`Page: ${pagination.pageStart}, Size: ${pagination.pageSize}, Total: ${pagination.totalSize}`);

            // Process background jobs
            result.data.forEach((job, index) => {
              console.log(`Job ${index + 1}:`);
              console.log(`  Job ID: ${job.jobId}`);
              console.log(`  Status: ${job.jobStatus}`);
              console.log(`  Event Type: ${job.eventType}`);
              console.log(`  Summary:`);
              console.log(`    Total: ${job.summary.total}`);
              console.log(`    Completed: ${job.summary.completed}`);
              console.log(`    Failed: ${job.summary.failed}`);
              console.log('---');
            });

            return result;
          } catch (error) {
            console.error('Failed to retrieve background jobs:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Get first 50 jobs

        getAllBackgroundJobs(1, 50);


        // Get next page

        getAllBackgroundJobs(2, 50);


        // Get all jobs with default pagination

        getAllBackgroundJobs();

        ```
      operationId: BackgroundJobs_GetAll
      parameters:
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 1
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 2
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfBatchStatusOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: ''
                        totalSize: 3
                        pageSize: 100
                    data:
                      - eventType: job.status
                        jobId: 550e8400-e29b-41d4-a716-446655440001
                        jobStatus: InProgress
                        summary:
                          total: 150
                          completed: 45
                          failed: 2
                      - eventType: job.status
                        jobId: 550e8400-e29b-41d4-a716-446655440002
                        jobStatus: Pending
                        summary:
                          total: 75
                          completed: 0
                          failed: 0
                      - eventType: job.status
                        jobId: 550e8400-e29b-41d4-a716-446655440003
                        jobStatus: InProgress
                        summary:
                          total: 200
                          completed: 200
                          failed: 0
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_event_type\",\"data_0_job_id\",\"data_0_job_status\",\"data_0_summary_total\",\"data_0_summary_completed\",\"data_0_summary_failed\",\"data_1_event_type\",\"data_1_job_id\",\"data_1_job_status\",\"data_1_summary_total\",\"data_1_summary_completed\",\"data_1_summary_failed\",\"data_2_event_type\",\"data_2_job_id\",\"data_2_job_status\",\"data_2_summary_total\",\"data_2_summary_completed\",\"data_2_summary_failed\""
                    - >-
                      "1","","3","100","job.status","550e8400-e29b-41d4-a716-446655440001","InProgress","150","45","2","job.status","550e8400-e29b-41d4-a716-446655440002","Pending","75","0","0","job.status","550e8400-e29b-41d4-a716-446655440003","InProgress","200","200","0"
        '400':
          description: Bad Request – Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/jobs/{jobId}:
    get:
      tags:
        - Background Jobs
      summary: Get Job Status
      description: >-
        Retrieves the current status and progress information for a specific
        background job. This endpoint:


        - Returns detailed status information for the specified job

        - Provides real-time progress statistics (total, completed, failed
        counts)

        - Shows current job status (Pending, InProgress, Completed, Failed,
        Cancelled)

        - Includes event type information for status tracking


        ### Job Status Information

        The response includes:

        - **JobId**: Unique identifier for the batch job

        - **JobStatus**: Current status (Pending, InProgress, Completed,
        CompletedWithErrors, Cancelled)
          - **Pending**: Job has been created and is waiting to be processed
          - **InProgress**: Job is currently being processed  
          - **Completed**: Job has completed successfully with no errors
          - **CompletedWithErrors**: Job has completed but some items failed during processing
          - **Cancelled**: Job has been cancelled and will not be processed further
        - **EventType**: Type of status event (typically "job.status")

        - **Summary**: Progress statistics (Total, Completed, Failed counts)


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/jobs/{jobId}

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getJobStatus(jobId) {
          try {
            const url = `https://api.bcb.bm/v1/jobs/${jobId}`;

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Job status retrieval failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const jobStatus = await response.json();

            // Display job information
            console.log('Job Status:');
            console.log(`  Job ID: ${jobStatus.jobId}`);
            console.log(`  Status: ${jobStatus.jobStatus}`);
            console.log(`  Event Type: ${jobStatus.eventType}`);
            console.log(`  Progress Summary:`);
            console.log(`    Total Items: ${jobStatus.summary.total}`);
            console.log(`    Completed: ${jobStatus.summary.completed}`);
            console.log(`    Failed: ${jobStatus.summary.failed}`);
            console.log(`    Progress: ${((jobStatus.summary.completed / jobStatus.summary.total) * 100).toFixed(1)}%`);

            return jobStatus;
          } catch (error) {
            console.error('Failed to retrieve job status:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Get status for a specific job

        getJobStatus('550e8400-e29b-41d4-a716-446655440001');

        ```
      operationId: BackgroundJobs_Get
      parameters:
        - name: jobId
          in: path
          required: true
          description: The unique identifier of the background job to retrieve status for.
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchStatus'
              examples:
                Json:
                  value:
                    eventType: job.status
                    jobId: 550e8400-e29b-41d4-a716-446655440001
                    jobStatus: InProgress
                    summary:
                      total: 150
                      completed: 45
                      failed: 2
                Csv:
                  value:
                    - "\uFEFF\"event_type\",\"job_id\",\"job_status\",\"summary_total\",\"summary_completed\",\"summary_failed\""
                    - >-
                      "job.status","550e8400-e29b-41d4-a716-446655440001","InProgress","150","45","2"
        '400':
          description: Bad Request – Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
    delete:
      tags:
        - Background Jobs
      summary: Cancel Job
      description: >-
        Cancels a background job and stops processing of all pending and
        in-progress items. This endpoint:


        - Cancels the specified job if it's in a cancellable state

        - Stops processing of all pending and in-progress items within the job

        - Marks cancelled items with appropriate error messages

        - Returns the updated job status after cancellation

        - Provides immediate feedback on cancellation success


        ### Cancellation Rules

        A job can only be cancelled if it's in one of these states:

        - **Pending**: Job has been created but not yet started processing

        - **InProgress**: Job is currently being processed


        Jobs in these states **cannot** be cancelled:

        - **Completed**: Job has already finished successfully

        - **CompletedWithErrors**: Job has finished with some failures

        - **Cancelled**: Job has already been cancelled


        ### What Happens During Cancellation

        1. **Job Status Update**: The job status is changed to "Cancelled"

        2. **Item Cancellation**: All pending and in-progress items are marked
        as "Cancelled"

        3. **Error Messages**: Cancelled items receive the error message "Job
        was cancelled by user request"

        4. **Counter Updates**: Job completion counters are recalculated from
        the database

        5. **Immediate Effect**: Processing stops immediately for all affected
        items


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/jobs/{jobId}
            
        ### Idempotency

        The API supports idempotency through the optional `Idempotency-Key`
        header:

        - If no idempotency key is provided, the request is processed normally
        (duplicates are possible)

        - If a valid UUID idempotency key is provided, the system stores the key
        and associates it with the batch job

        - If the same idempotency key is received again, the system returns the
        previously stored response

        - Idempotency keys are user-specific - different users with the same
        keys don't share cached responses

        - The idempotency key must be a valid UUID format (e.g.,
        "123e4567-e89b-12d3-a456-426614174000")


        ### Sample Request in JavaScript
                    
        ```javascript

        async function cancelJob(jobId) {
          try {
            const url = `https://api.bcb.bm/v1/jobs/${jobId}`;

            const response = await fetch(url, {
              method: 'DELETE',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Job cancellation failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const jobStatus = await response.json();

            // Display cancellation result
            console.log('Job Cancellation Result:');
            console.log(`  Job ID: ${jobStatus.jobId}`);
            console.log(`  Status: ${jobStatus.jobStatus}`);
            console.log(`  Event Type: ${jobStatus.eventType}`);
            console.log(`  Final Summary:`);
            console.log(`    Total Items: ${jobStatus.summary.total}`);
            console.log(`    Completed: ${jobStatus.summary.completed}`);
            console.log(`    Failed: ${jobStatus.summary.failed}`);
            console.log(`    Cancelled: ${jobStatus.summary.total - jobStatus.summary.completed - jobStatus.summary.failed}`);

            return jobStatus;
          } catch (error) {
            console.error('Failed to cancel job:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Cancel a specific job

        cancelJob('550e8400-e29b-41d4-a716-446655440001');

        ```
      operationId: BackgroundJobs_CancelJob
      parameters:
        - name: jobId
          in: path
          required: true
          description: The unique identifier of the background job to cancel.
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: OK - The job was cancelled successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchStatus'
              example:
                eventType: job.status
                jobId: 550e8400-e29b-41d4-a716-446655440001
                jobStatus: InProgress
                summary:
                  total: 150
                  completed: 45
                  failed: 2
        '400':
          description: Bad Request – Validation failed or job cannot be cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - The specified job was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - The job cannot be cancelled in its current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/jobs/{jobId}/results:
    get:
      tags:
        - Background Jobs
      summary: Get Job Results
      description: >-
        Retrieves the detailed results for a specific background job. This
        endpoint:


        - Returns paginated results for all items processed in the job

        - Provides detailed information about each item's processing outcome

        - Shows processing status, attempts, HTTP responses, and error details

        - Includes original payload and result data for auditing

        - Supports pagination for efficient handling of large result sets


        ### Job Results Information

        Each result entry includes:

        - **Id**: Internal numeric identifier for this item result

        - **JobId**: Identifier of the parent batch job

        - **ExternalItemId**: Client-supplied item identifier from the original
        batch

        - **PayloadJson**: Original request payload serialized as JSON

        - **Status**: Current processing status (Pending, InProgress, Completed,
        Failed, Cancelled)

        - **Attempt**: Number of processing attempts made for this item

        - **HttpStatusCode**: HTTP status code returned by the target endpoint

        - **ResultJson**: Response payload from the target endpoint (if
        successful)

        - **ErrorMessage**: Error details (if processing failed)


        ### Pagination

        This endpoint uses simple numeric pagination:

        - **pageStart**: 1-based index of the first record to return (default:
        1)

        - **pageSize**: Number of records to return (default: 100, maximum:
        1000)

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from response metadata


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/jobs/{jobId}/results

        ### Sample Request in JavaScript
                    
        ```javascript

        async function getJobResults(jobId, pageStart = 1, pageSize = 50) {
          try {
            const url = `https://api.bcb.bm/v1/jobs/${jobId}/results`;
            const params = new URLSearchParams();
            
            params.append('pageStart', pageStart.toString());
            params.append('pageSize', pageSize.toString());
            
            const fullUrl = url + '?' + params.toString();

            const response = await fetch(fullUrl, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Job results retrieval failed: ${JSON.stringify(errorData)}`);
            }

            // Parse JSON response
            const result = await response.json();

            // Access pagination info
            const pagination = result.meta.pagination;
            console.log(`Page: ${pagination.pageStart}, Size: ${pagination.pageSize}, Total: ${pagination.totalSize}`);

            // Process job results
            result.data.forEach((item, index) => {
              console.log(`Result ${index + 1}:`);
              console.log(`  Item ID: ${item.externalItemId}`);
              console.log(`  Status: ${item.status}`);
              console.log(`  Attempts: ${item.attempt}`);
              console.log(`  HTTP Status: ${item.httpStatusCode}`);
              
              if (item.errorMessage) {
                console.log(`  Error: ${item.errorMessage}`);
              }
              
              if (item.resultJson) {
                console.log(`  Result: ${item.resultJson}`);
              }
              
              console.log('---');
            });

            return result;
          } catch (error) {
            console.error('Failed to retrieve job results:', error.message);
            throw error;
          }
        }


        // Example usage:


        // Get first 50 results for a job

        getJobResults('550e8400-e29b-41d4-a716-446655440001', 1, 50);


        // Get next page of results

        getJobResults('550e8400-e29b-41d4-a716-446655440001', 2, 50);


        // Get all results with default pagination

        getJobResults('550e8400-e29b-41d4-a716-446655440001');

        ```
      operationId: BackgroundJobs_GetResults
      parameters:
        - name: jobId
          in: path
          required: true
          description: The unique identifier of the background job to retrieve results for.
          schema:
            type: string
          x-position: 1
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 2
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 3
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfBatchJobResultOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: ''
                        totalSize: 3
                        pageSize: 100
                    data:
                      - id: fa45cf2a-d8e1-45f3-b021-bb8415492d39
                        jobId: 550e8400-e29b-41d4-a716-446655440001
                        externalItemId: item-001
                        payloadJson: >-
                          {"accountNumber":"1000326948","amount":"1000.00","currency":"USD"}
                        status: 2
                        attempt: 1
                        httpStatus: 200
                        error: null
                        resultJson: >-
                          {"transactionId":"TXN-12345","status":"success","reference":"REF-001"}
                        createdUtc: '2025-10-24T12:11:16.3333299Z'
                        finishedUtc: '2025-10-24T12:16:16.3333426Z'
                      - id: 79f61a11-0ba1-48c0-842f-a01c56a1c67a
                        jobId: 550e8400-e29b-41d4-a716-446655440001
                        externalItemId: item-002
                        payloadJson: >-
                          {"accountNumber":"1000326949","amount":"2500.00","currency":"USD"}
                        status: 3
                        attempt: 3
                        httpStatus: 400
                        error: Invalid account number provided
                        resultJson: null
                        createdUtc: '2025-10-24T12:11:16.3333539Z'
                        finishedUtc: '2025-10-24T12:21:16.3333539Z'
                      - id: 0be3b65d-e919-4f5f-a1eb-20a8195ff5a4
                        jobId: 550e8400-e29b-41d4-a716-446655440001
                        externalItemId: item-003
                        payloadJson: >-
                          {"accountNumber":"1000326950","amount":"500.00","currency":"USD"}
                        status: 1
                        attempt: 1
                        httpStatus: 0
                        error: null
                        resultJson: null
                        createdUtc: '2025-10-24T12:26:16.3333542Z'
                        finishedUtc: null
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_id\",\"data_0_job_id\",\"data_0_external_item_id\",\"data_0_payload_json\",\"data_0_status\",\"data_0_attempt\",\"data_0_http_status\",\"data_0_result_json\",\"data_0_created_utc\",\"data_0_finished_utc\",\"data_1_id\",\"data_1_job_id\",\"data_1_external_item_id\",\"data_1_payload_json\",\"data_1_status\",\"data_1_attempt\",\"data_1_http_status\",\"data_1_error\",\"data_1_created_utc\",\"data_1_finished_utc\",\"data_2_id\",\"data_2_job_id\",\"data_2_external_item_id\",\"data_2_payload_json\",\"data_2_status\",\"data_2_attempt\",\"data_2_http_status\",\"data_2_created_utc\""
                    - >-
                      "1","","3","100","fa45cf2a-d8e1-45f3-b021-bb8415492d39","550e8400-e29b-41d4-a716-446655440001","item-001","{""accountNumber"":""1000326948"",""amount"":""1000.00"",""currency"":""USD""}","2","1","200","{""transactionId"":""TXN-12345"",""status"":""success"",""reference"":""REF-001""}","2025-10-24T12:11:16.3358464Z","2025-10-24T12:16:16.3358469Z","79f61a11-0ba1-48c0-842f-a01c56a1c67a","550e8400-e29b-41d4-a716-446655440001","item-002","{""accountNumber"":""1000326949"",""amount"":""2500.00"",""currency"":""USD""}","3","3","400","Invalid
                      account number
                      provided","2025-10-24T12:11:16.3358472Z","2025-10-24T12:21:16.3358473Z","0be3b65d-e919-4f5f-a1eb-20a8195ff5a4","550e8400-e29b-41d4-a716-446655440001","item-003","{""accountNumber"":""1000326950"",""amount"":""500.00"",""currency"":""USD""}","1","1","0","2025-10-24T12:26:16.3358476Z"
        '400':
          description: Bad Request – Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/system/time:
    get:
      tags:
        - System
      summary: Get system time
      description: >-
        Returns the current server date and time in ISO-8601 format. 

        This endpoint helps integrators synchronize with the server clock and
        craft valid date/time windows for other API requests.


        The response contains **two fields**:

        1. <code>timestamp</code> – Current Bermuda local time in ISO-8601
        format with the correct offset (e.g.,
        <code>2025-01-07T14:30:15-04:00</code>).

        2. <code>timeZone</code>  – Display name of the time zone currently in
        effect (<em>"Atlantic Daylight Time"</em> or <em>"Atlantic Standard
        Time"</em>).
                    
        This allows clients to know both the precise instant and whether
        Daylight-Saving Time is observed.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/system/time

        ### Sample Request in JavaScript:


        ```javascript

        async function getSystemTime() {
          try {
            const response = await fetch('https://api.bcb.bm/v1/system/time', {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const data = await response.json();
            console.log('Server timestamp (Bermuda time UTC-4):', data.timestamp);

            return data;
          } catch (error) {
            console.error('There was a problem retrieving system time:', error.message);
          }
        }


        // Example usage:

        getSystemTime();

        ```
      operationId: System_GetSystemTime
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemTimeResponse'
              example:
                timestamp: '2025-01-07T19:30:15.1230000+01:00'
                timeZone: Atlantic Standard Time
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/accounts/{accountNumber}/payments:
    get:
      tags:
        - Payments
        - Accounts
      summary: List payment statuses for an account
      description: >-
        Retrieves status information for all payments associated with a specific
        account. This endpoint:
                    
        - Provides comprehensive payment status details including type, status,
        transaction ID, external reference, remittance information, amounts,
        value date, and exchange rate.

        - Supports both JSON and CSV response formats based on the Accept
        header.

        - **Supports cursor-based pagination** for efficient handling of large
        payment status datasets.


        ### Pagination

        This endpoint uses cursor-based pagination with server-side result-set
        management:

        - **First Request**: Optionally specify `pageSize` (default: 100, max:
        1000). The server creates a cursor and returns a `pageToken`.

        - **Subsequent Requests**: Use the `pageToken` from previous responses
        with `pageStart` to navigate pages.

        - **Page Token**: Contains encoded pagination context including
        pageSize, so don't specify `pageSize` in subsequent requests.

        - **Total Pages**: Calculate using `Math.ceil(total_size / page_size)`
        from the response metadata.


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/accounts/{accountNumber}/payments

        ### Sample Request in JavaScript


        ```javascript

        async function getAllPaymentStatusesPaginated(accountNumber) {
          try {
            let allPaymentStatuses = [];
            let pageStart = 1;
            let pageToken = null;
            let totalPages = 0;

            do {
              // Build URL with pagination parameters
              let url = `https://api.bcb.bm/v1/accounts/${accountNumber}/payments`;
              const params = new URLSearchParams();
              
              if (pageStart === 1) {
                // First request: specify pageSize
                params.append('pageSize', '100');
              } else {
                // Subsequent requests: use pageToken and pageStart
                params.append('pageToken', pageToken);
                params.append('pageStart', pageStart.toString());
              }
              
              if (params.toString()) {
                url += '?' + params.toString();
              }

              const response = await fetch(url, {
                method: 'GET',
                headers: {
                  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                  'Content-Type': 'application/json',
                  'Accept': 'application/json'
                }
              });

              if (!response.ok) {
                const errorData = await response.json();
                throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
              }

              const data = await response.json();
              console.log(`Page ${pageStart} data:`, data);

              // Store pagination info from first request
              if (pageStart === 1 && data.meta && data.meta.pagination) {
                pageToken = data.meta.pagination.page_token;
                totalPages = Math.ceil(data.meta.pagination.total_size / data.meta.pagination.page_size);
                console.log(`Total pages: ${totalPages}, Page token: ${pageToken}`);
              }

              // Collect payment statuses from this page
              if (data.data && data.data.length > 0) {
                allPaymentStatuses.push(...data.data);
                console.log(`Collected ${data.data.length} payment statuses from page ${pageStart}`);
              }

              pageStart++;
            } while (pageStart <= totalPages);

            console.log(`Total payment statuses collected: ${allPaymentStatuses.length}`);

            // Process all collected payment statuses
            allPaymentStatuses.forEach((payment, index) => {
              console.log(`Payment ${index + 1}:`, payment.transactionId);
              console.log('Type:', payment.type);
              console.log('Status:', payment.status);
              console.log('External Reference:', payment.externalReference);
              console.log('Remittance Information:', payment.remittanceInformation);
              console.log('Value Date:', payment.valueDate);
              console.log('Debit Amount:', `${payment.debitAmount.amount} ${payment.debitAmount.currency}`);
              if (payment.creditAmount && payment.creditAmount.amount) {
                console.log('Credit Amount:', `${payment.creditAmount.amount} ${payment.creditAmount.currency}`);
              }
              console.log('-------------------');
            });

            return allPaymentStatuses;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Alternative: Get single page of payment statuses

        async function getPaymentStatusesPage(accountNumber, pageStart = 1,
        pageToken = null) {
          try {
            let url = `https://api.bcb.bm/v1/accounts/${accountNumber}/payments`;
            const params = new URLSearchParams();
            
            if (pageStart === 1 && !pageToken) {
              params.append('pageSize', '50'); // Custom page size
            } else {
              params.append('pageToken', pageToken);
              params.append('pageStart', pageStart.toString());
            }
            
            if (params.toString()) {
              url += '?' + params.toString();
            }

            const response = await fetch(url, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const data = await response.json();
            console.log('Payment statuses page:', data);
            return data;
          } catch (error) {
            console.error('There was a problem with the fetch operation:', error.message);
            throw error;
          }
        }


        // Example usage:

        getAllPaymentStatusesPaginated('123456789'); // Retrieves all payment
        statuses across multiple pages

        // OR

        getPaymentStatusesPage('123456789', 1).then(firstPage => {
          console.log('First page:', firstPage);
          // Use firstPage.meta.pagination.page_token for subsequent requests
        });

        ```
      operationId: TransactionStatus_GetAccountTransactionStatuses
      parameters:
        - name: accountNumber
          in: path
          required: true
          description: The account number to retrieve payment statuses for.
          schema:
            type: string
          x-position: 1
        - name: pageToken
          in: query
          description: >-
            Optional. Unique cursor ID received from previous response for
            subsequent requests. Contains encoded pagination context including
            page_size.
          schema:
            type: string
            maxLength: 100
            minLength: 0
            nullable: true
          x-position: 2
        - name: pageStart
          in: query
          description: >-
            Optional. The record from which the response should be displayed
            (default: 1).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 3
        - name: pageSize
          in: query
          description: >-
            Optional. The total number of records per page (default: 100, max:
            1000).
          schema:
            type: integer
            format: int32
            nullable: true
          x-position: 4
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfTransactionStatusOf'
              examples:
                Json:
                  value:
                    meta:
                      pagination:
                        pageStart: 1
                        pageToken: 202405250011428721.01,10
                        totalSize: 3
                        pageSize: 10
                    data:
                      - type: Outward Swift Payment MT103 API
                        externalReference: REF123456
                        status: Completed
                        remittanceInformation: 'Invoice payment #INV-2023-001'
                        transactionId: TX-001-2023
                        debitAmount:
                          currency: USD
                          amount: 1000
                        valueDate: '2023-05-15'
                        creditAmount:
                          currency: USD
                          amount: null
                        exchangeRate: null
                      - type: Internal Transfer API
                        externalReference: REF789012
                        status: Pending
                        remittanceInformation: Salary transfer
                        transactionId: TX-002-2023
                        debitAmount:
                          currency: EUR
                          amount: 2500
                        valueDate: '2023-05-16'
                        creditAmount:
                          currency: EUR
                          amount: null
                        exchangeRate: null
                      - type: Inward Swift Payment MT103
                        externalReference: REF345678
                        status: Processing
                        remittanceInformation: Investment return
                        transactionId: TX-003-2023
                        debitAmount:
                          currency: GBP
                          amount: 5000
                        valueDate: '2023-05-17'
                        creditAmount:
                          currency: GBP
                          amount: null
                        exchangeRate: null
                Csv:
                  value:
                    - "\uFEFF\"meta_pagination_page_start\",\"meta_pagination_page_token\",\"meta_pagination_total_size\",\"meta_pagination_page_size\",\"data_0_type\",\"data_0_external_reference\",\"data_0_status\",\"data_0_remittance_information\",\"data_0_transaction_id\",\"data_0_debit_amount_currency\",\"data_0_debit_amount_amount\",\"data_0_value_date\",\"data_0_credit_amount_currency\",\"data_1_type\",\"data_1_external_reference\",\"data_1_status\",\"data_1_remittance_information\",\"data_1_transaction_id\",\"data_1_debit_amount_currency\",\"data_1_debit_amount_amount\",\"data_1_value_date\",\"data_1_credit_amount_currency\",\"data_2_type\",\"data_2_external_reference\",\"data_2_status\",\"data_2_remittance_information\",\"data_2_transaction_id\",\"data_2_debit_amount_currency\",\"data_2_debit_amount_amount\",\"data_2_value_date\",\"data_2_credit_amount_currency\""
                    - >-
                      "1","202405250011428721.01,10","3","10","Outward Swift
                      Payment MT103 API","REF123456","Completed","Invoice
                      payment
                      #INV-2023-001","TX-001-2023","USD","1000.00","2023-05-15","USD","Internal
                      Transfer API","REF789012","Pending","Salary
                      transfer","TX-002-2023","EUR","2500.00","2023-05-16","EUR","Inward
                      Swift Payment MT103","REF345678","Processing","Investment
                      return","TX-003-2023","GBP","5000.00","2023-05-17","GBP"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
  /v1/payments/{paymentId}/status:
    get:
      tags:
        - Payments
      summary: Get payment status
      description: >-
        Retrieves detailed status information for a specific payment identified
        by its payment ID (also known as transaction ID). This endpoint provides
        comprehensive status details including:


        - **Type**: The type of payment (e.g., "Outward Swift Payment MT103
        API")

        - **Status**: Current status of the payment (e.g., "Pending",
        "Completed", "Failed")

        - **TransactionId**: Unique payment identifier (or Transaction Id)

        - **ExternalReference**: External reference number for the payment

        - **RemittanceInformation**: Free-text information about the purpose of
        the payment

        - **DebitAmount**: The amount debited from the account, including
        currency code

        - **CreditAmount**: The amount credited to the account, including
        currency code

        - **ValueDate**: The date when the payment was/will be processed

        - **ExchangeRate**: The exchange rate applied to the payment


        ### Content Negotiation

        Clients must use the HTTP Accept header to indicate the desired response
        format:

        - Set `Accept: application/json` for JSON responses (default)

        - Set `Accept: text/csv` for CSV responses

        If the Accept header is omitted, `application/json` is assumed.


        ### Base URL:

        All API requests use the versioned base URL:

            https://api.bcb.bm/v1/payments/{paymentId}/status

        ### Sample Request in JavaScript:


        ```javascript

        async function getPaymentStatus(paymentId) {
          try {
            const response = await fetch(`https://api.bcb.bm/v1/payments/${paymentId}/status`, {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
            });

            if (!response.ok) {
              const errorData = await response.json();
              throw new Error(`Error: ${errorData.message || 'Unknown error'}`);
            }

            const paymentStatus = await response.json();
            console.log('Payment Status Details:');
            console.log('Payment ID:', paymentStatus.transactionId);
            console.log('Type:', paymentStatus.type);
            console.log('Status:', paymentStatus.status);
            console.log('External Reference:', paymentStatus.externalReference);
            console.log('Remittance Information:', paymentStatus.remittanceInformation);
            console.log('Value Date:', paymentStatus.valueDate);
            console.log('Debit Amount:', `${paymentStatus.debitAmount.amount} ${paymentStatus.debitAmount.currency}`);
            
            if (paymentStatus.creditAmount && paymentStatus.creditAmount.amount) {
              console.log('Credit Amount:', `${paymentStatus.creditAmount.amount} ${paymentStatus.creditAmount.currency}`);
            }
            
            // Implement business logic based on payment status
            if (paymentStatus.status === 'Completed') {
              console.log('Payment has been successfully completed.');
            } else if (paymentStatus.status === 'Pending') {
              console.log('Payment is still being processed.');
            } else if (paymentStatus.status === 'Failed') {
              console.log('Payment failed. Please check the details or contact support.');
            }
          } catch (error) {
            console.error('There was a problem retrieving the payment status:', error.message);
          }
        }


        // Example usage:

        getPaymentStatus('PAY-001-2023');

        ```
      operationId: TransactionStatus_GetTransactionStatus
      parameters:
        - name: paymentId
          in: path
          required: true
          description: >-
            The unique identifier of the payment (also known as transactionId)
            to retrieve status for.
          schema:
            type: string
          x-position: 1
      responses:
        '200':
          description: OK - The request was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionStatus'
              examples:
                Json:
                  value:
                    type: Outward Swift Payment MT103 API
                    externalReference: REF123456
                    status: Completed
                    remittanceInformation: 'Invoice payment #INV-2023-001'
                    transactionId: TX-001-2023
                    debitAmount:
                      currency: USD
                      amount: 1000
                    valueDate: '2023-05-15'
                    creditAmount:
                      currency: USD
                      amount: null
                    exchangeRate: null
                Csv:
                  value:
                    - "\uFEFF\"type\",\"external_reference\",\"status\",\"remittance_information\",\"transaction_id\",\"debit_amount_currency\",\"debit_amount_amount\",\"value_date\",\"credit_amount_currency\""
                    - >-
                      "Outward Swift Payment MT103
                      API","REF123456","Completed","Invoice payment
                      #INV-2023-001","TX-001-2023","USD","1000.00","2023-05-15","USD"
        '400':
          description: >-
            Bad Request - The request was invalid or cannot be served. Check the
            passed parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden – The client is authenticated but does not have permission
            to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too Many Requests - You have exceeded the allowed number of requests
            in a given timeframe. Please wait for the rate limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unknown error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Authorization: []
components:
  schemas:
    Account:
      allOf:
        - $ref: '#/components/schemas/AccountSummary'
        - type: object
          description: >-
            Bank Account following Open Banking API standards with bank-specific
            extensions
          additionalProperties: false
          properties:
            accountType:
              type: string
              description: Specifies the type of account (personal/business)
              nullable: true
            nickname:
              type: string
              description: The nickname of the account, assigned by the account owner
              nullable: true
            openingDate:
              type: string
              description: Date when the account was opened
              nullable: true
            balanceEffectiveDate:
              type: string
              description: Date when the balance was last updated
              nullable: true
            accountRoutings:
              type: array
              description: Routing details for the account
              items:
                $ref: '#/components/schemas/BankRouting'
    BankRouting:
      type: object
      additionalProperties: false
      required:
        - scheme
        - address
      properties:
        scheme:
          type: string
          description: Scheme value
        address:
          type: string
          description: Address value
    AccountSummary:
      type: object
      description: Summary view of a bank account for listing purposes
      additionalProperties: false
      required:
        - accountId
        - cif
        - currency
        - accountSubType
        - accountNumber
        - status
        - availableBalance
        - owners
        - accountAttributes
      properties:
        accountId:
          type: string
          description: A unique ID of the account, composed of account number and CIF
        cif:
          type: string
          description: 11-digit ID of the account holder
        currency:
          type: string
          description: Identification of the currency in which the account is held
        accountSubType:
          type: string
          description: Specifies the sub type of account (product)
        accountNumber:
          type: string
          description: Account number
        status:
          type: string
          description: Specifies the status of the account
        availableBalance:
          type: object
          description: Account balance
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        owners:
          type: array
          description: Ownership details of an account object
          items:
            $ref: '#/components/schemas/AccountOwner'
        accountAttributes:
          type: array
          description: >-
            Additional details or characteristics associated with an account
            object
          items:
            $ref: '#/components/schemas/AccountAttribute'
    CurrencyAmount:
      type: object
      additionalProperties: false
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          description: Currency ISO code
        amount:
          type: string
          description: Amount
    AccountOwner:
      type: object
      additionalProperties: false
      required:
        - displayName
        - accountHolderType
      properties:
        displayName:
          type: string
          description: Account owner name
        accountHolderType:
          type: string
          description: Type of account holder (Primary/Joint)
    AccountAttribute:
      type: object
      description: >-
        Attribute value in form of (name, value)

        This model is used to store additional metadata or characteristics of an
        account in a name-value pair format.
      additionalProperties: false
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: Key or identifier of the account attribute.
        value:
          type: string
          description: Actual data associated with the attribute name
    ErrorResponse:
      type: object
      description: >-
        Represents a standardized error response in the Open Banking API.

        This model is used to provide consistent error information across all
        API endpoints.
      additionalProperties: false
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error code or type that identifies the specific error condition
        message:
          type: string
          description: Human-readable error message that describes the error condition
    ApiResponseOfAccountOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/Account'
    Meta:
      type: object
      additionalProperties: false
      properties:
        pagination:
          type: object
          description: Pagination information
          nullable: true
          properties:
            page_start:
              type: integer
              description: The record from which the response should be displayed
              format: int32
            page_token:
              type: string
              description: >-
                Unique id expected to get as part of response from Transact on
                every enquiry request.
              nullable: true
            total_size:
              type: integer
              description: Total number of records
              format: int32
            page_size:
              type: integer
              description: The total number of records per page
              format: int32
    Pagination:
      type: object
      additionalProperties: false
      required:
        - page_start
        - total_size
        - page_size
      properties:
        page_start:
          type: integer
          description: The record from which the response should be displayed
          format: int32
        page_token:
          type: string
          description: >-
            Unique id expected to get as part of response from Transact on every
            enquiry request.
          nullable: true
        total_size:
          type: integer
          description: Total number of records
          format: int32
        page_size:
          type: integer
          description: The total number of records per page
          format: int32
    ApiClientCredentialsCreateResponse:
      type: object
      description: >-
        Response model returned when new API client credentials are successfully
        created or when a client secret is rotated.

        Contains the complete credential information needed for API
        authentication.
      additionalProperties: false
      required:
        - clientId
        - clientSecret
        - isActive
      properties:
        clientId:
          type: string
          description: >-
            Unique client identifier (GUID) assigned by the authorization
            server.

            This identifier is used in conjunction with the client secret for
            API authentication.
        clientSecret:
          type: string
          description: Client secret assigned by the authorization server.
        isActive:
          type: boolean
          description: >-
            Value indicating whether the client credentials are currently active
            and can be used for authentication.
        allowedIps:
          type: string
          description: >-
            IP address restrictions for the client credentials.

            Defines which IP addresses or IP ranges are allowed to use these
            credentials for authentication.
          nullable: true
    ApiClientCredentialsCreateRequest:
      type: object
      description: Request model for creating new API client credentials
      additionalProperties: false
      properties:
        allowedIps:
          type: string
          description: >-
            Optional IP address restrictions for the new client credentials.

            If omitted (null/empty) or set to "*", all IP addresses will be
            allowed.

            Otherwise, specify a comma-separated list of allowed IP addresses
            and/or CIDR ranges.
          maxLength: 1000
          minLength: 0
          nullable: true
          example: 192.168.1.1,10.0.0.0/24,2001:db8::/32
    PermissionResponse:
      type: object
      description: >-
        Response model representing a permission that can be assigned to an API
        client.
      additionalProperties: false
      required:
        - key
      properties:
        key:
          type: string
          description: |-
            Unique permission key that identifies the specific permission.
            Used in authorization checks and JWT token claims.
          example: get-account
        description:
          type: string
          description: |-
            Human-readable description of what this permission allows.
            Provides context for administrators managing client permissions.
          nullable: true
          example: Allows access to account information endpoints
    FxQuote:
      type: object
      description: Represents a foreign exchange quote with currency conversion details.
      additionalProperties: false
      required:
        - sourceCurrency
        - targetCurrency
        - exchangeRate
      properties:
        sourceCurrency:
          type: object
          description: The source currency and amount.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        targetCurrency:
          type: object
          description: The target currency and amount.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        expiryDateTime:
          type: string
          description: >-
            The expiry date and time of the quote, expressed in **UTC** and
            formatted per ISO 8601 (yyyy-MM-ddTHH:mm:ssZ).
          nullable: true
        exchangeRate:
          type: number
          description: The exchange rate for the currency conversion.
          format: decimal
    InternalTransfer:
      type: object
      description: Represents an internal transfer between accounts
      additionalProperties: false
      required:
        - id
        - status
        - uniqueIdentifier
        - internalTransferDetails
        - linkedActivities
      properties:
        id:
          type: string
          description: Unique identifier for the internal transfer
        status:
          type: string
          description: >-
            The current processing status of the transaction, e.g. Completed,
            Pending, Failed
        uniqueIdentifier:
          type: string
          description: Unique identifier specific to this instance of the internal transfer
        internalTransferDetails:
          type: object
          description: Transfer data
          properties:
            amountCredited:
              type: object
              description: >-
                Amount that has been deposited into or added to a recipient's
                account
                            
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            creditAmountCurrency:
              type: string
              description: |-
                Credit amount currency
                            
            debitAmount:
              type: object
              description: >-
                Amount that was intended to be transferred or paid, not
                including any additional fees or charges. It's the raw amount
                before any processing fees or other costs are added.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            amountDebited:
              type: object
              description: >-
                The total amount that has been debited from an account. This
                includes any and all deductions that have been finalized and
                processed out of an account.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            chargeAmount:
              type: object
              description: >-
                Sum of money that is charged as a fee or cost associated with a
                financial transaction
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            valueDate:
              type: string
              description: >-
                Date on which the transaction is officially settled, meaning the
                funds are considered to have been transferred legally and are
                available for use by the recipient
                            
            chargeAnalysisReceiver:
              type: string
              description: >-
                Refers to the analysis or breakdown of charges that are applied
                to the receiver or beneficiary of an internal transfer.
              nullable: true
            chargeAnalysisSender:
              type: string
              description: >-
                Refers to the breakdown or details of charges that are applied
                to the sender of a transaction
              nullable: true
            debitAccountNumber:
              type: object
              description: >-
                Unique identifier of a bank account from which funds are being
                withdrawn or debited
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            creditAccountNumber:
              type: object
              description: Unique identifier of a bank account that is set to receive funds
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            chargeAccountNumber:
              type: object
              description: >-
                Bank account number from which fees associated with a
                transaction are debited
              nullable: true
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
        linkedActivities:
          type: array
          description: |-
            List of related financial activities
                        
          items:
            $ref: '#/components/schemas/Activity'
    InternalTransferDetails:
      type: object
      additionalProperties: false
      required:
        - amountCredited
        - creditAmountCurrency
        - debitAmount
        - amountDebited
        - chargeAmount
        - valueDate
        - debitAccountNumber
        - creditAccountNumber
      properties:
        amountCredited:
          type: object
          description: >-
            Amount that has been deposited into or added to a recipient's
            account
                        
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        creditAmountCurrency:
          type: string
          description: |-
            Credit amount currency
                        
        debitAmount:
          type: object
          description: >-
            Amount that was intended to be transferred or paid, not including
            any additional fees or charges. It's the raw amount before any
            processing fees or other costs are added.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        amountDebited:
          type: object
          description: >-
            The total amount that has been debited from an account. This
            includes any and all deductions that have been finalized and
            processed out of an account.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        chargeAmount:
          type: object
          description: >-
            Sum of money that is charged as a fee or cost associated with a
            financial transaction
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        valueDate:
          type: string
          description: >-
            Date on which the transaction is officially settled, meaning the
            funds are considered to have been transferred legally and are
            available for use by the recipient
                        
        chargeAnalysisReceiver:
          type: string
          description: >-
            Refers to the analysis or breakdown of charges that are applied to
            the receiver or beneficiary of an internal transfer.
          nullable: true
        chargeAnalysisSender:
          type: string
          description: >-
            Refers to the breakdown or details of charges that are applied to
            the sender of a transaction
          nullable: true
        debitAccountNumber:
          type: object
          description: >-
            Unique identifier of a bank account from which funds are being
            withdrawn or debited
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        creditAccountNumber:
          type: object
          description: Unique identifier of a bank account that is set to receive funds
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        chargeAccountNumber:
          type: object
          description: >-
            Bank account number from which fees associated with a transaction
            are debited
          nullable: true
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
    TransactionAccount:
      type: object
      additionalProperties: false
      required:
        - number
        - accountRoutings
      properties:
        number:
          type: string
          description: Account number
        accountRoutings:
          type: array
          description: Account routing details
          items:
            $ref: '#/components/schemas/BankRouting'
    Activity:
      type: object
      description: >-
        Refers to any transaction or operation performed within a financial
        institution that affects accounts or other financial products.
      additionalProperties: false
      required:
        - id
        - transactionStatus
        - status
        - activityDetails
      properties:
        id:
          type: string
          description: The unique identifier for the activity.
        transactionStatus:
          type: string
          description: The current processing status of the transaction.
        status:
          type: string
          description: The general status of the activity.
        uniqueIdentifier:
          type: string
          description: A unique identifier specific to this instance of the activity.
          nullable: true
        activityDetails:
          type: object
          description: Detailed information about the activity.
          properties:
            arrangementId:
              type: string
              description: >-
                Unique identifier for the arrangement associated with this
                activity.
            activityId:
              type: string
              description: Identifier for the type of activity.
            productId:
              type: string
              description: Product identifier related to the activity.
            currencyId:
              type: string
              description: Currency code for the activity.
            effectiveDate:
              type: string
              description: Date when the activity becomes effective.
    ActivityDetails:
      type: object
      description: Holds details about a specific banking activity.
      additionalProperties: false
      required:
        - arrangementId
        - activityId
        - productId
        - currencyId
        - effectiveDate
      properties:
        arrangementId:
          type: string
          description: Unique identifier for the arrangement associated with this activity.
        activityId:
          type: string
          description: Identifier for the type of activity.
        productId:
          type: string
          description: Product identifier related to the activity.
        currencyId:
          type: string
          description: Currency code for the activity.
        effectiveDate:
          type: string
          description: Date when the activity becomes effective.
    InternalTransferRequest:
      allOf:
        - $ref: '#/components/schemas/TransferRequest'
        - type: object
          description: >-
            Represents a request for an internal funds transfer between two
            accounts.
          additionalProperties: false
          properties:
            endToEndIdentification:
              type: string
              description: >-
                Reference provided by the client to identify the transaction
                end-to-end.
              maxLength: 16
              minLength: 0
              nullable: true
            remittanceInformation:
              type: string
              description: >-
                Free-text remittance information provided by the client,
                describing the purpose of the transaction.
              maxLength: 100
              minLength: 0
              nullable: true
    TransferRequest:
      type: object
      description: Represents a request for an funds transfer between two accounts.
      additionalProperties: false
      required:
        - debitAmountCurrency
        - creditAmountCurrency
        - debitAmount
        - debitAccountNumber
      properties:
        debitAccountNumber:
          type: string
          description: >-
            The account number from which the money will be taken. Please ensure
            this account has enough funds before initiating the transfer.
          maxLength: 36
          minLength: 1
        debitAmountCurrency:
          type: string
          description: |-
            Gets or sets the currency code of the debit amount.
            Exactly 3 letters (ISO 4217).
          maxLength: 3
          minLength: 3
        creditAccountNumber:
          type: string
          description: The account number of the recipient's account.
          maxLength: 36
          minLength: 1
          nullable: true
        creditAmountCurrency:
          type: string
          description: |-
            The currency code for the credit amount, such as "USD", "EUR", etc.
            Exactly 3 letters (ISO 4217).
          maxLength: 3
          minLength: 3
        debitAmount:
          type: string
          description: >-
            The amount of money to be debited from the sender's account and
            credited to the recipient's account. Ensure

            the amount does not exceed the available balance in the debit
            account.
          maxLength: 18
          minLength: 1
    PaymentResponse:
      type: object
      description: Represents the response to a SWIFT payment initiation request.
      additionalProperties: false
      required:
        - id
        - status
        - transactionStatus
        - uniqueIdentifier
        - details
        - linkedActivities
      properties:
        id:
          type: string
          description: >-
            Unique identifier assigned by the bank for the SWIFT transfer.

            This ID can be used for future reference and tracking of the
            payment.
        status:
          type: string
          description: |-
            The current status of the payment processing.
            Possible values include:
            - success: Payment has been accepted for processing
            - failed: Payment failed
        transactionStatus:
          type: string
          description: >-
            Detailed transaction status indicating the current state of the
            transfer.

            This provides more granular status information than the main status
            field.
        uniqueIdentifier:
          type: string
          description: >-
            A unique identifier specific to this instance of the SWIFT transfer.

            This identifier remains constant throughout the lifecycle of the
            payment

            and can be used for reconciliation purposes.
        details:
          type: object
          description: |-
            Detailed information about the payment transaction including
            amounts, accounts, and settlement information.
          properties:
            extReference:
              type: string
              description: >-
                External reference number assigned by the bank's payment
                processing system.

                This reference can be used for tracking and reconciliation
                purposes.
            instructedAmount:
              type: object
              description: >-
                The amount and currency of the payment as instructed by the
                payment initiator.

                This represents the original payment amount before any charges
                or conversions.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            debtorAccount:
              type: object
              description: >-
                Reference information for the account from which the payment is
                debited.

                Includes the account identifier and scheme information.
              properties:
                schemeName:
                  type: string
                  description: >-
                    The name of the identification scheme, e.g. "IBAN", "BBAN",
                    "AccountNumber".
                  nullable: true
                identification:
                  type: string
                  description: >-
                    The identifier within that scheme (e.g. the IBAN or account
                    number).
                Name:
                  type: string
                  description: The name of the account, if available (optional).
            beneficiaryAccount:
              type: object
              description: |-
                Reference information for the beneficiary's account.
                This may differ from the creditor account in certain scenarios.
              properties:
                schemeName:
                  type: string
                  description: >-
                    The name of the identification scheme, e.g. "IBAN", "BBAN",
                    "AccountNumber".
                  nullable: true
                identification:
                  type: string
                  description: >-
                    The identifier within that scheme (e.g. the IBAN or account
                    number).
                Name:
                  type: string
                  description: The name of the account, if available (optional).
            creditorAccount:
              type: object
              description: >-
                Reference information for the account to be credited with the
                payment.

                This represents the immediate recipient account of the funds.
              properties:
                schemeName:
                  type: string
                  description: >-
                    The name of the identification scheme, e.g. "IBAN", "BBAN",
                    "AccountNumber".
                  nullable: true
                identification:
                  type: string
                  description: >-
                    The identifier within that scheme (e.g. the IBAN or account
                    number).
                Name:
                  type: string
                  description: The name of the account, if available (optional).
            settlementDetails:
              type: object
              description: >-
                Details about the settlement of the payment, including credited
                and

                debited amounts, value dates, and settlement status.
              properties:
                amountCredited:
                  type: object
                  description: >-
                    The amount that was credited to the beneficiary account.

                    This may differ from the instructed amount due to currency
                    conversion

                    or intermediary bank charges.
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                amountDebited:
                  type: object
                  description: >-
                    The total amount debited from the sender's account.

                    This includes the payment amount plus any applicable
                    charges.
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                valueDate:
                  type: string
                  description: >-
                    The date on which the payment is settled between banks.

                    This is the date when the funds become available to the
                    beneficiary.

                    Format: ISO 8601 date string (YYYY-MM-DD)
                recordStatus:
                  type: string
                  description: The current status of the settlement record.
            chargeDetails:
              type: object
              description: >-
                Information about the charges applied to the payment, including

                charge type, amounts, and the account to which charges are
                applied.
              properties:
                chargesType:
                  type: string
                  description: |-
                    Specifies how the charges for the payment are allocated.
                    Possible values:
                    - OUR: All charges are paid by the sender
                    - BEN: All charges are paid by the beneficiary
                    - SHA: Charges are shared between sender and beneficiary
                chargeAmount:
                  type: object
                  description: |-
                    The total amount of charges applied to the payment.
                    Includes both sending and receiving bank charges.
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                chargeAccount:
                  type: object
                  description: >-
                    Reference information for the account from which charges are
                    collected.

                    This may be different from the main debit account.
                  properties:
                    schemeName:
                      type: string
                      description: >-
                        The name of the identification scheme, e.g. "IBAN",
                        "BBAN", "AccountNumber".
                      nullable: true
                    identification:
                      type: string
                      description: >-
                        The identifier within that scheme (e.g. the IBAN or
                        account number).
                    Name:
                      type: string
                      description: The name of the account, if available (optional).
                chargeAnalysis:
                  type: object
                  description: |-
                    Detailed breakdown of how charges are distributed between
                    the sending and receiving parties.
                  properties:
                    sender:
                      type: object
                      description: >-
                        The amount of charges applied by and payable to the
                        sending bank.

                        This may include processing fees, wire transfer fees, or
                        other sending bank charges.
                      properties:
                        currency:
                          type: string
                          description: Currency ISO code
                        amount:
                          type: string
                          description: Amount
                    receiver:
                      type: object
                      description: >-
                        The amount of charges applied by and payable to the
                        receiving bank.

                        This may include processing fees, incoming wire fees, or
                        other receiving bank charges.
                      properties:
                        currency:
                          type: string
                          description: Currency ISO code
                        amount:
                          type: string
                          description: Amount
            remittanceInformation:
              type: array
              description: |-
                Collection of unstructured information provided with the payment
                to help with reconciliation and payment identification.
              nullable: true
              items:
                $ref: '#/components/schemas/UnstructuredInformation'
            beneficiary:
              type: object
              description: >-
                Detailed information about the ultimate beneficiary of the
                payment.

                Includes identification, name, and additional information.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            beneficiaryAgent:
              type: object
              description: >-
                Information about the beneficiary's bank or financial
                institution.

                Typically, includes the BIC/SWIFT code and bank details.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            intermediaryAgent:
              type: object
              description: >-
                Details of any intermediary bank involved in the payment chain.

                This is optional and only present for payments requiring
                intermediary processing.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
        linkedActivities:
          type: array
          description: >-
            Collection of related financial activities associated with this
            payment.

            This may include charges, forex conversions, or other related
            transactions.
          items:
            $ref: '#/components/schemas/Activity'
    PaymentResponseDetails:
      type: object
      description: Contains detailed information about a processed SWIFT payment.
      additionalProperties: false
      required:
        - extReference
        - instructedAmount
        - debtorAccount
        - beneficiaryAccount
        - creditorAccount
        - settlementDetails
        - chargeDetails
        - beneficiary
        - beneficiaryAgent
        - intermediaryAgent
      properties:
        extReference:
          type: string
          description: >-
            External reference number assigned by the bank's payment processing
            system.

            This reference can be used for tracking and reconciliation purposes.
        instructedAmount:
          type: object
          description: >-
            The amount and currency of the payment as instructed by the payment
            initiator.

            This represents the original payment amount before any charges or
            conversions.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        debtorAccount:
          type: object
          description: >-
            Reference information for the account from which the payment is
            debited.

            Includes the account identifier and scheme information.
          properties:
            schemeName:
              type: string
              description: >-
                The name of the identification scheme, e.g. "IBAN", "BBAN",
                "AccountNumber".
              nullable: true
            identification:
              type: string
              description: >-
                The identifier within that scheme (e.g. the IBAN or account
                number).
            Name:
              type: string
              description: The name of the account, if available (optional).
        beneficiaryAccount:
          type: object
          description: |-
            Reference information for the beneficiary's account.
            This may differ from the creditor account in certain scenarios.
          properties:
            schemeName:
              type: string
              description: >-
                The name of the identification scheme, e.g. "IBAN", "BBAN",
                "AccountNumber".
              nullable: true
            identification:
              type: string
              description: >-
                The identifier within that scheme (e.g. the IBAN or account
                number).
            Name:
              type: string
              description: The name of the account, if available (optional).
        creditorAccount:
          type: object
          description: >-
            Reference information for the account to be credited with the
            payment.

            This represents the immediate recipient account of the funds.
          properties:
            schemeName:
              type: string
              description: >-
                The name of the identification scheme, e.g. "IBAN", "BBAN",
                "AccountNumber".
              nullable: true
            identification:
              type: string
              description: >-
                The identifier within that scheme (e.g. the IBAN or account
                number).
            Name:
              type: string
              description: The name of the account, if available (optional).
        settlementDetails:
          type: object
          description: |-
            Details about the settlement of the payment, including credited and
            debited amounts, value dates, and settlement status.
          properties:
            amountCredited:
              type: object
              description: >-
                The amount that was credited to the beneficiary account.

                This may differ from the instructed amount due to currency
                conversion

                or intermediary bank charges.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            amountDebited:
              type: object
              description: |-
                The total amount debited from the sender's account.
                This includes the payment amount plus any applicable charges.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            valueDate:
              type: string
              description: >-
                The date on which the payment is settled between banks.

                This is the date when the funds become available to the
                beneficiary.

                Format: ISO 8601 date string (YYYY-MM-DD)
            recordStatus:
              type: string
              description: The current status of the settlement record.
        chargeDetails:
          type: object
          description: |-
            Information about the charges applied to the payment, including
            charge type, amounts, and the account to which charges are applied.
          properties:
            chargesType:
              type: string
              description: |-
                Specifies how the charges for the payment are allocated.
                Possible values:
                - OUR: All charges are paid by the sender
                - BEN: All charges are paid by the beneficiary
                - SHA: Charges are shared between sender and beneficiary
            chargeAmount:
              type: object
              description: |-
                The total amount of charges applied to the payment.
                Includes both sending and receiving bank charges.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            chargeAccount:
              type: object
              description: >-
                Reference information for the account from which charges are
                collected.

                This may be different from the main debit account.
              properties:
                schemeName:
                  type: string
                  description: >-
                    The name of the identification scheme, e.g. "IBAN", "BBAN",
                    "AccountNumber".
                  nullable: true
                identification:
                  type: string
                  description: >-
                    The identifier within that scheme (e.g. the IBAN or account
                    number).
                Name:
                  type: string
                  description: The name of the account, if available (optional).
            chargeAnalysis:
              type: object
              description: |-
                Detailed breakdown of how charges are distributed between
                the sending and receiving parties.
              properties:
                sender:
                  type: object
                  description: >-
                    The amount of charges applied by and payable to the sending
                    bank.

                    This may include processing fees, wire transfer fees, or
                    other sending bank charges.
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                receiver:
                  type: object
                  description: >-
                    The amount of charges applied by and payable to the
                    receiving bank.

                    This may include processing fees, incoming wire fees, or
                    other receiving bank charges.
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
        remittanceInformation:
          type: array
          description: |-
            Collection of unstructured information provided with the payment
            to help with reconciliation and payment identification.
          nullable: true
          items:
            $ref: '#/components/schemas/UnstructuredInformation'
        beneficiary:
          type: object
          description: |-
            Detailed information about the ultimate beneficiary of the payment.
            Includes identification, name, and additional information.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
        beneficiaryAgent:
          type: object
          description: |-
            Information about the beneficiary's bank or financial institution.
            Typically, includes the BIC/SWIFT code and bank details.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
        intermediaryAgent:
          type: object
          description: >-
            Details of any intermediary bank involved in the payment chain.

            This is optional and only present for payments requiring
            intermediary processing.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
    AccountReference:
      type: object
      description: Reference to a debtor or creditor account
      additionalProperties: false
      required:
        - identification
        - Name
      properties:
        schemeName:
          type: string
          description: >-
            The name of the identification scheme, e.g. "IBAN", "BBAN",
            "AccountNumber".
          nullable: true
        identification:
          type: string
          description: The identifier within that scheme (e.g. the IBAN or account number).
        Name:
          type: string
          description: The name of the account, if available (optional).
    SettlementDetails:
      type: object
      description: Contains details about the settlement of a payment transaction.
      additionalProperties: false
      required:
        - amountCredited
        - amountDebited
        - valueDate
        - recordStatus
      properties:
        amountCredited:
          type: object
          description: >-
            The amount that was credited to the beneficiary account.

            This may differ from the instructed amount due to currency
            conversion

            or intermediary bank charges.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        amountDebited:
          type: object
          description: |-
            The total amount debited from the sender's account.
            This includes the payment amount plus any applicable charges.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        valueDate:
          type: string
          description: |-
            The date on which the payment is settled between banks.
            This is the date when the funds become available to the beneficiary.
            Format: ISO 8601 date string (YYYY-MM-DD)
        recordStatus:
          type: string
          description: The current status of the settlement record.
    ChargeDetails:
      type: object
      description: Contains information about charges applied to a payment transaction.
      additionalProperties: false
      required:
        - chargesType
        - chargeAmount
        - chargeAccount
        - chargeAnalysis
      properties:
        chargesType:
          type: string
          description: |-
            Specifies how the charges for the payment are allocated.
            Possible values:
            - OUR: All charges are paid by the sender
            - BEN: All charges are paid by the beneficiary
            - SHA: Charges are shared between sender and beneficiary
        chargeAmount:
          type: object
          description: |-
            The total amount of charges applied to the payment.
            Includes both sending and receiving bank charges.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        chargeAccount:
          type: object
          description: >-
            Reference information for the account from which charges are
            collected.

            This may be different from the main debit account.
          properties:
            schemeName:
              type: string
              description: >-
                The name of the identification scheme, e.g. "IBAN", "BBAN",
                "AccountNumber".
              nullable: true
            identification:
              type: string
              description: >-
                The identifier within that scheme (e.g. the IBAN or account
                number).
            Name:
              type: string
              description: The name of the account, if available (optional).
        chargeAnalysis:
          type: object
          description: |-
            Detailed breakdown of how charges are distributed between
            the sending and receiving parties.
          properties:
            sender:
              type: object
              description: >-
                The amount of charges applied by and payable to the sending
                bank.

                This may include processing fees, wire transfer fees, or other
                sending bank charges.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            receiver:
              type: object
              description: >-
                The amount of charges applied by and payable to the receiving
                bank.

                This may include processing fees, incoming wire fees, or other
                receiving bank charges.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
    ChargeAnalysis:
      type: object
      description: >-
        Provides a detailed breakdown of charges applied to a payment
        transaction.
      additionalProperties: false
      required:
        - sender
        - receiver
      properties:
        sender:
          type: object
          description: >-
            The amount of charges applied by and payable to the sending bank.

            This may include processing fees, wire transfer fees, or other
            sending bank charges.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        receiver:
          type: object
          description: >-
            The amount of charges applied by and payable to the receiving bank.

            This may include processing fees, incoming wire fees, or other
            receiving bank charges.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
    UnstructuredInformation:
      type: object
      description: >-
        A single line of unstructured text, e.g. per Open Banking’s
        RemittanceInformation Unstructured field.
      additionalProperties: false
      required:
        - unstructured
      properties:
        unstructured:
          type: string
          description: The narrative text (e.g. remittance line, beneficiary note, etc.).
    PartyDetails:
      type: object
      description: >-
        Represents details of a party involved in a payment transaction.

        This class can be used for various parties such as creditors, agents, or
        intermediaries.
      additionalProperties: false
      required:
        - identification
        - name
        - additionalInformation
      properties:
        identification:
          type: string
          description: >-
            Unique identification of the party, such as a BIC (Bank Identifier
            Code) for financial institutions

            or an account number for account holders.
          maxLength: 35
          minLength: 1
        name:
          type: string
          description: >-
            Name by which the party is known and which is usually used to
            identify the party.
          maxLength: 35
          minLength: 1
        additionalInformation:
          type: array
          description: >-
            Additional information about the party that may be required for
            processing the payment,

            such as address details, country codes, or specific payment
            instructions.

            Max 4 lines; each line max 35 characters.
          maxItems: 4
          items:
            type: string
            maxLength: 35
    PaymentRequest:
      type: object
      description: |-
        Represents a payment initiation request in the Open Banking API.
        This is the root object for initiating a payment transaction.
      additionalProperties: false
      required:
        - instructionIdentification
        - debtorAccount
        - instructedAmount
        - creditorAccount
        - creditorAgent
        - chargesType
        - remittanceInformation
      properties:
        instructionIdentification:
          type: string
          description: >-
            Unique identification as assigned by an instructing party for an
            instructed party to unambiguously identify the instruction.
          maxLength: 16
          minLength: 1
        debtorAccount:
          type: object
          description: >-
            Unambiguous identification of the account of the debtor to which a
            debit entry will be made as a result of the transaction.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the account, such as an IBAN
                (International Bank Account Number)

                or a local account number.
              maxLength: 36
              minLength: 1
        instructedAmount:
          type: object
          description: >-
            Amount of money to be moved between the debtor and creditor, before
            deduction of charges, expressed in the currency as ordered by the
            initiating party.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        creditorAccount:
          type: object
          description: >-
            Unambiguous identification of the account of the creditor to which a
            credit entry will be posted as a result of the payment transaction.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
        creditorAgent:
          type: object
          description: Financial institution servicing an account for the creditor.
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
        intermediaryAgent:
          type: object
          description: Agent between the debtor's agent and the creditor's agent.
          nullable: true
          properties:
            identification:
              type: string
              description: >-
                Unique identification of the party, such as a BIC (Bank
                Identifier Code) for financial institutions

                or an account number for account holders.
              maxLength: 35
              minLength: 1
            name:
              type: string
              description: >-
                Name by which the party is known and which is usually used to
                identify the party.
              maxLength: 35
              minLength: 1
            additionalInformation:
              type: array
              description: >-
                Additional information about the party that may be required for
                processing the payment,

                such as address details, country codes, or specific payment
                instructions.

                Max 4 lines; each line max 35 characters.
              maxItems: 4
              items:
                type: string
                maxLength: 35
        chargesType:
          type: string
          description: >-
            Specifies which party/parties will bear the charges associated with
            the processing of the payment transaction.

            Max length: 3 characters (e.g., OUR/SHA/BEN).
          maxLength: 3
          minLength: 1
        remittanceInformation:
          type: array
          description: >-
            Information supplied to enable the matching/reconciliation of an
            entry with the items that the payment is intended to settle.

            Limit: up to 4 lines; each line max 35 characters.
          items:
            type: string
    AccountDetails:
      type: object
      description: >-
        Represents basic account identification details used in payment
        transactions.

        This class is used for both debtor and creditor accounts.
      additionalProperties: false
      required:
        - identification
      properties:
        identification:
          type: string
          description: >-
            Unique identification of the account, such as an IBAN (International
            Bank Account Number)

            or a local account number.
          maxLength: 36
          minLength: 1
    ApiToken:
      type: object
      description: Represents an API token with its value and expiration date.
      additionalProperties: false
      required:
        - token
        - expiration
      properties:
        token:
          type: string
          description: Gets or sets the JWT token.
        expiration:
          type: string
          description: Gets or sets the expiration date and time of the token.
          format: date-time
    ApiCredentials:
      type: object
      description: Represents the credentials required to generate an API token.
      additionalProperties: false
      required:
        - clientId
        - clientSecret
      properties:
        clientId:
          type: string
          description: The client ID assigned by the authorization server.
          minLength: 1
        clientSecret:
          type: string
          description: The client secret assigned by the authorization server.
          minLength: 1
    ApiResponseOfTransactionOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/Transaction'
    Transaction:
      type: object
      description: Details related to a financial transaction
      additionalProperties: false
      required:
        - id
        - thisAccount
        - details
        - metadata
        - transactionAttributes
      properties:
        id:
          type: string
          description: A unique ID of the transaction
        thisAccount:
          type: object
          description: |-
            Account associated with the transaction
             
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        otherAccount:
          type: object
          description: Refers to the counter-party's account in a transaction
          nullable: true
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        details:
          type: object
          description: Provides further transaction details
          properties:
            type:
              type: string
              description: Balance type, in a coded form.
            description:
              type: string
              description: Transaction description
            posted:
              type: string
              description: >-
                Date and time when a transaction entry is posted to an account
                on the account servicer's books
            completed:
              type: string
              description: >-
                Date and time at which assets become available to the account
                owner in case of a credit entry, or cease to be available to the
                account owner in case of a debit transaction entry.
            newBalance:
              type: object
              description: >-
                New balance after a transaction entry is posted to an account on
                the account servicer's books
              nullable: true
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            value:
              type: object
              description: Amount of money in the transaction entry
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
        metadata:
          type: object
          description: Provides transaction metadata
          properties:
            narrative:
              type: string
              description: |-
                Provide additional details about the transaction
                            
              nullable: true
        transactionAttributes:
          type: array
          description: >-
            Additional details or characteristics associated with an transaction
            object.
          items:
            $ref: '#/components/schemas/TransactionAttribute'
    TransactionDetails:
      type: object
      additionalProperties: false
      required:
        - type
        - description
        - posted
        - completed
        - value
      properties:
        type:
          type: string
          description: Balance type, in a coded form.
        description:
          type: string
          description: Transaction description
        posted:
          type: string
          description: >-
            Date and time when a transaction entry is posted to an account on
            the account servicer's books
        completed:
          type: string
          description: >-
            Date and time at which assets become available to the account owner
            in case of a credit entry, or cease to be available to the account
            owner in case of a debit transaction entry.
        newBalance:
          type: object
          description: >-
            New balance after a transaction entry is posted to an account on the
            account servicer's books
          nullable: true
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        value:
          type: object
          description: Amount of money in the transaction entry
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
    TransactionMetadata:
      type: object
      additionalProperties: false
      properties:
        narrative:
          type: string
          description: |-
            Provide additional details about the transaction
                        
          nullable: true
    TransactionAttribute:
      type: object
      description: Attribute value in form of (name, value)
      additionalProperties: false
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: >-
            refers to a specific property or characteristic associated with the
            transaction, such as "amount" or "transaction_type".
        value:
          type: string
          description: >-
            Corresponds to the actual data or content assigned to that
            particular property, e.g., "100.00" for "amount" or "debit" for
            "transaction_type"
    BatchCreateResponse:
      type: object
      description: >-
        Response returned after a batch create job is accepted for asynchronous
        processing.
      additionalProperties: false
      required:
        - jobId
        - status
        - statusUrl
        - resultUrl
      properties:
        jobId:
          type: string
          description: Unique identifier assigned to the batch job.
        status:
          type: string
          description: >-
            Current lifecycle state of the batch job (e.g.Pending, InProgress,
            Completed, CompletedWithErrors, Cancelled).
        statusUrl:
          type: string
          description: >-
            Absolute URL that can be polled to retrieve up-to-date job status
            information.
        resultUrl:
          type: string
          description: >-
            Absolute URL to obtain the final per-item results once the job has
            completed.
    VirtualAccountCreateBatchRequest:
      type: object
      description: Represents a request to create a batch of virtual accounts.
      additionalProperties: false
      required:
        - items
      properties:
        callbackUrl:
          type: string
          description: >-
            Optional URL to receive asynchronous notifications about the async
            job processing status. 
          nullable: true
        customHeaders:
          type: object
          description: >-
            Optional custom headers to include in the account creation request.
            It will be sent back in callbacks.

            Max 10 headers, each key max 50 chars, each value max 500 chars
          nullable: true
          additionalProperties:
            type: string
        items:
          type: array
          description: >-
            Payload containing the details of virtual accounts to be created in
            batch.
          items:
            $ref: '#/components/schemas/VirtualAccountCreateRequest'
    VirtualAccountCreateRequest:
      type: object
      description: >-
        Request model for creating a new virtual account following Open Banking
        standards.

        Virtual accounts are subaccounts associated with a corporate client that
        can be used 

        for specific business purposes while maintaining separation of funds.
      additionalProperties: false
      required:
        - currency
        - accountHolderName
        - accountName
      properties:
        currency:
          type: string
          description: >-
            ISO 4217 currency code for the virtual account (e.g., USD, EUR,
            BMD).

            Must be a supported currency by the bank.
          maxLength: 3
          minLength: 3
        accountHolderName:
          type: string
          description: |-
            Human-readable nickname or label for the virtual account.
            Used for display purposes and client identification.
          maxLength: 70
          minLength: 1
        accountName:
          type: string
          description: >-
            Official account name as it will appear on statements and official
            documents.

            This is the formal name of the virtual account.
          maxLength: 70
          minLength: 1
        clientReference:
          type: string
          description: >-
            Client-provided reference identifier for tracking and identification
            purposes.

            This reference should be unique within the client's system for
            easier reconciliation.
          maxLength: 35
          minLength: 0
          nullable: true
    VirtualAccountDetails:
      allOf:
        - $ref: '#/components/schemas/VirtualAccount'
        - type: object
          description: >-
            Virtual Account following Open Banking API standards with
            bank-specific extensions

            Represents a sub-account or virtual account associated with a
            corporate client
          additionalProperties: false
          properties:
            clientReference:
              type: string
              description: Client-provided reference identifier for the virtual account
              nullable: true
            effectiveDate:
              type: string
              description: >-
                Date when the virtual account becomes effective (YYYY-MM-DD
                format)
              nullable: true
            createdAt:
              type: string
              description: >-
                Date when the virtual account was created (ISO 8601 format).
                Bermuda Time Zone.
              nullable: true
            parentAccount:
              type: object
              description: Parent account summary, if applicable
              properties:
                accountId:
                  type: string
                  description: >-
                    A unique ID of the account, composed of account number and
                    CIF
                cif:
                  type: string
                  description: 11-digit ID of the account holder
                currency:
                  type: string
                  description: Identification of the currency in which the account is held
                accountSubType:
                  type: string
                  description: Specifies the sub type of account (product)
                accountNumber:
                  type: string
                  description: Account number
                status:
                  type: string
                  description: Specifies the status of the account
                availableBalance:
                  type: object
                  description: Account balance
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                owners:
                  type: array
                  description: Ownership details of an account object
                  items:
                    $ref: '#/components/schemas/AccountOwner'
                accountAttributes:
                  type: array
                  description: >-
                    Additional details or characteristics associated with an
                    account object
                  items:
                    $ref: '#/components/schemas/AccountAttribute'
            settlementAccount:
              type: object
              description: Settlement account summary, if applicable
              properties:
                accountId:
                  type: string
                  description: >-
                    A unique ID of the account, composed of account number and
                    CIF
                cif:
                  type: string
                  description: 11-digit ID of the account holder
                currency:
                  type: string
                  description: Identification of the currency in which the account is held
                accountSubType:
                  type: string
                  description: Specifies the sub type of account (product)
                accountNumber:
                  type: string
                  description: Account number
                status:
                  type: string
                  description: Specifies the status of the account
                availableBalance:
                  type: object
                  description: Account balance
                  properties:
                    currency:
                      type: string
                      description: Currency ISO code
                    amount:
                      type: string
                      description: Amount
                owners:
                  type: array
                  description: Ownership details of an account object
                  items:
                    $ref: '#/components/schemas/AccountOwner'
                accountAttributes:
                  type: array
                  description: >-
                    Additional details or characteristics associated with an
                    account object
                  items:
                    $ref: '#/components/schemas/AccountAttribute'
    VirtualAccount:
      type: object
      description: >-
        Virtual Account following Open Banking API standards with bank-specific
        extensions

        Represents a sub-account or virtual account associated with a corporate
        client
      additionalProperties: false
      required:
        - virtualAccountNumber
        - bicCode
        - accountHolderName
        - accountName
        - currency
        - balance
        - category
      properties:
        virtualAccountNumber:
          type: string
          description: Account number for the virtual account
        bicCode:
          type: string
          description: BIC (Bank Identifier Code)
        accountHolderName:
          type: string
          description: Owner for the virtual account
        accountName:
          type: string
          description: >-
            Virtual account name as it appears on statements and official
            documents
        currency:
          type: string
          description: ISO 4217 currency code for the virtual account
        balance:
          type: object
          description: Current balance of the virtual account
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        category:
          type: string
          description: Category or type of the (virtual) account, if applicable
    VirtualAccountUpdateRequest:
      allOf:
        - $ref: '#/components/schemas/PatchDto'
        - type: object
          description: >-
            Request model for creating a new virtual account following Open
            Banking standards.

            Virtual accounts are sub-accounts associated with a corporate client
            that can be used 

            for specific business purposes while maintaining separation of
            funds.
          additionalProperties: false
          properties:
            accountHolderName:
              type: string
              description: |-
                Virtual account name
                Used for display purposes and client identification.
              maxLength: 70
              minLength: 0
              nullable: true
            accountName:
              type: string
              description: >-
                Official account title as it will appear on statements and
                official documents.

                This is the formal name of the virtual account.
              maxLength: 70
              minLength: 0
              nullable: true
            clientReference:
              type: string
              description: >-
                Client-provided reference identifier for tracking and
                identification purposes.

                This reference should be unique within the client's system for
                easier reconciliation.
              maxLength: 35
              minLength: 0
              nullable: true
    PatchDto:
      type: object
      x-abstract: true
      additionalProperties: false
    ApiResponseOfVirtualAccountOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/VirtualAccount'
    ApiResponseOfVirtualAccountTransactionDetailOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/VirtualAccountTransactionDetail'
    VirtualAccountTransactionDetail:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountTransaction'
        - type: object
          additionalProperties: false
          properties:
            debitAccountNumber:
              type: object
              description: >-
                Unique identifier of a bank account from which funds are being
                withdrawn or debited
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            creditAccountNumber:
              type: object
              description: Unique identifier of a bank account that is set to receive funds
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            status:
              type: string
              description: Transaction Status
    VirtualAccountTransaction:
      type: object
      additionalProperties: false
      required:
        - id
        - bookingDate
        - valueDate
        - value
      properties:
        id:
          type: string
          description: A unique identifier of the virtual account transaction.
        description:
          type: string
          description: Human-readable description of the transaction.
          nullable: true
        bookingDate:
          type: string
          description: The booking date of the transaction in YYYY-MM-DD format.
        valueDate:
          type: string
          description: The value date of the transaction in YYYY-MM-DD format.
        value:
          type: object
          description: >-
            Transaction amount with currency. Positive values indicate credits;
            negative values indicate debits.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        proprietaryBankTransactionCode:
          type: string
          description: >-
            Bank-specific transaction-type code (e.g. PARENT.TO.SUB,
            SUB.TO.PARENT).
          nullable: true
    VirtualAccountTransactionReversal:
      type: object
      description: >-
        Represents a reversal of a previously posted virtual account
        transaction.

        Aligns with the Virtual Accounts transaction framework and mirrors T24
        reversal

        response semantics while conforming to Open Banking model patterns.
      additionalProperties: false
      required:
        - transactionId
        - transactionStatus
        - status
        - uniqueIdentifier
        - value
      properties:
        transactionId:
          type: string
          description: >-
            Unique identifier of the original (now reversed) transaction (e.g.,
            FT1234567).
        transactionStatus:
          type: string
          description: >-
            Reversal processing status reported by the core system (e.g.,
            REVERSED, REVE).

            Typically reflects the system's internal status code for the
            reversal lifecycle.
        status:
          type: string
          description: >-
            High-level execution status of the reversal request (e.g., success,
            failed).
        uniqueIdentifier:
          type: string
          description: >-
            Unique correlation / tracking identifier supplied by or derived from
            the core system (e.g., message or processing reference).
        value:
          type: object
          description: Transaction amount with currency
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
    VirtualAccountTransferOfVirtualAccountTransferDetails:
      type: object
      description: Represents an transfer between virtual accounts
      additionalProperties: false
      required:
        - id
        - status
        - uniqueIdentifier
        - linkedActivities
      properties:
        id:
          type: string
          description: Unique identifier for the transfer
        status:
          type: string
          description: >-
            The current processing status of the transaction, e.g. Completed,
            Pending, Failed
        uniqueIdentifier:
          type: string
          description: Unique identifier specific to this instance of the transfer
        details:
          type: object
          description: Transfer data
          nullable: true
          properties:
            debitAmount:
              type: object
              description: >-
                Amount that was intended to be transferred or paid, not
                including any additional fees or charges. It's the raw amount
                before any processing fees or other costs are added.
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            valueDate:
              type: string
              description: >-
                Date on which the transaction is officially settled, meaning the
                funds are considered to have been transferred legally and are
                available for use by the recipient
                            
            childTransactionId:
              type: string
              description: Child transaction ID
              nullable: true
            creditAmountCurrency:
              type: string
              description: |-
                Credit amount currency
                            
            debitAccountNumber:
              type: object
              description: >-
                Unique identifier of a bank account from which funds are being
                withdrawn or debited
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            creditAccountNumber:
              type: object
              description: Unique identifier of a bank account that is set to receive funds
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
        linkedActivities:
          type: array
          description: |-
            List of related financial activities
                        
          items:
            $ref: '#/components/schemas/Activity'
    VirtualAccountTransferDetails:
      type: object
      additionalProperties: false
      required:
        - debitAmount
        - valueDate
        - creditAmountCurrency
        - debitAccountNumber
        - creditAccountNumber
      properties:
        debitAmount:
          type: object
          description: >-
            Amount that was intended to be transferred or paid, not including
            any additional fees or charges. It's the raw amount before any
            processing fees or other costs are added.
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        valueDate:
          type: string
          description: >-
            Date on which the transaction is officially settled, meaning the
            funds are considered to have been transferred legally and are
            available for use by the recipient
                        
        childTransactionId:
          type: string
          description: Child transaction ID
          nullable: true
        creditAmountCurrency:
          type: string
          description: |-
            Credit amount currency
                        
        debitAccountNumber:
          type: object
          description: >-
            Unique identifier of a bank account from which funds are being
            withdrawn or debited
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        creditAccountNumber:
          type: object
          description: Unique identifier of a bank account that is set to receive funds
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
    VirtualAccountCreditRequest:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountTransferRequestBase'
        - type: object
          description: >-
            Represents a request to credit a virtual account.

            The virtual account number (creditAccountNumber) is specified in the
            URL route.
          additionalProperties: false
          required:
            - debitAccountNumber
          properties:
            debitAccountNumber:
              type: string
              description: >-
                The account number from which the money will be taken
                (source/parent account).

                Please ensure this account has enough funds before initiating
                the transfer.
              maxLength: 36
              minLength: 1
    VirtualAccountTransferRequestBase:
      type: object
      description: >-
        Base class for virtual account transfer requests containing common
        fields.
      x-abstract: true
      additionalProperties: false
      required:
        - debitAmountCurrency
        - creditAmountCurrency
        - debitAmount
      properties:
        debitAmountCurrency:
          type: string
          description: |-
            Gets or sets the currency code of the debit amount.
            Exactly 3 letters (ISO 4217).
          maxLength: 3
          minLength: 3
        creditAmountCurrency:
          type: string
          description: |-
            The currency code for the credit amount, such as "USD", "EUR", etc.
            Exactly 3 letters (ISO 4217).
          maxLength: 3
          minLength: 3
        debitAmount:
          type: string
          description: >-
            The amount of money to be transferred.

            Ensure the amount does not exceed the available balance in the debit
            account.
          maxLength: 18
          minLength: 1
    VirtualAccountDebitRequest:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountTransferRequestBase'
        - type: object
          description: >-
            Represents a request to debit a virtual account.

            The virtual account number (debitAccountNumber) is specified in the
            URL route.
          additionalProperties: false
          required:
            - creditAccountNumber
          properties:
            creditAccountNumber:
              type: string
              description: >-
                The account number of the recipient's account
                (destination/parent/settlement account).
              maxLength: 36
              minLength: 1
    VirtualAccountTransferOfVirtualAccountSettlementTransfer:
      type: object
      description: Represents an transfer between virtual accounts
      additionalProperties: false
      required:
        - id
        - status
        - uniqueIdentifier
        - linkedActivities
      properties:
        id:
          type: string
          description: Unique identifier for the transfer
        status:
          type: string
          description: >-
            The current processing status of the transaction, e.g. Completed,
            Pending, Failed
        uniqueIdentifier:
          type: string
          description: Unique identifier specific to this instance of the transfer
        details:
          type: object
          description: Transfer data
          nullable: true
          properties:
            creditAmount:
              type: object
              description: Amount moved from settlement account to the account
              properties:
                currency:
                  type: string
                  description: Currency ISO code
                amount:
                  type: string
                  description: Amount
            debitAmountCurrency:
              type: string
              description: |-
                Debit amount currency
                            
            debitAccountNumber:
              type: object
              description: >-
                Unique identifier of a bank account from which funds are being
                withdrawn or debited
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            creditAccountNumber:
              type: object
              description: Unique identifier of a bank account that is set to receive funds
              properties:
                number:
                  type: string
                  description: Account number
                accountRoutings:
                  type: array
                  description: Account routing details
                  items:
                    $ref: '#/components/schemas/BankRouting'
            valueDate:
              type: string
              description: |-
                Date on which the transaction
                            
        linkedActivities:
          type: array
          description: |-
            List of related financial activities
                        
          items:
            $ref: '#/components/schemas/Activity'
    VirtualAccountSettlementTransfer:
      type: object
      additionalProperties: false
      required:
        - creditAmount
        - debitAmountCurrency
        - debitAccountNumber
        - creditAccountNumber
        - valueDate
      properties:
        creditAmount:
          type: object
          description: Amount moved from settlement account to the account
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        debitAmountCurrency:
          type: string
          description: |-
            Debit amount currency
                        
        debitAccountNumber:
          type: object
          description: >-
            Unique identifier of a bank account from which funds are being
            withdrawn or debited
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        creditAccountNumber:
          type: object
          description: Unique identifier of a bank account that is set to receive funds
          properties:
            number:
              type: string
              description: Account number
            accountRoutings:
              type: array
              description: Account routing details
              items:
                $ref: '#/components/schemas/BankRouting'
        valueDate:
          type: string
          description: |-
            Date on which the transaction
                        
    VirtualAccountSettlementTransferRequestInternal:
      type: object
      description: Internal request model for virtual account settlement transfers.
      additionalProperties: false
      required:
        - debitCurrency
        - creditAmount
        - creditAccountNumber
      properties:
        debitCurrency:
          type: string
          description: |-
            The currency code for the debit amount (e.g., "USD", "EUR").
            Exactly 3 letters (ISO 4217).
          maxLength: 3
          minLength: 3
        creditAmount:
          type: object
          description: >-
            The amount to be credited to the destination account (amount and
            currency).
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        creditAccountNumber:
          type: string
          description: >-
            The account number to which funds will be credited (destination
            account).

            Max length: 36 characters.
          maxLength: 36
          minLength: 1
    VirtualAccountSettlementTransferRequestExternal:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountSettlementTransferRequestInternal'
        - type: object
          description: External request model for virtual account settlement transfers.
          additionalProperties: false
          required:
            - debtor
            - debtorAgent
            - creditorAccount
            - chargesType
            - creditorAgent
          properties:
            debtor:
              type: string
              description: |-
                The ordering customer information or reference
                Max length: 35 characters.
              maxLength: 35
              minLength: 1
            debtorAgent:
              type: string
              description: |-
                The ordering customer agent (e.g., bank identifier code).
                Max length: 35 characters.
              maxLength: 35
              minLength: 1
            creditorAccount:
              type: object
              description: >-
                Unambiguous identification of the account of the creditor to
                which a credit entry will be posted as a result of the payment
                transaction.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            chargesType:
              type: string
              description: >-
                Specifies which party/parties will bear the charges associated
                with the processing of the transaction, e.g. 'OUR'

                Max length: 3 characters.
              maxLength: 3
              minLength: 1
            creditorAgent:
              type: object
              description: Financial institution servicing an account for the creditor.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            intermediaryAgent:
              type: object
              description: Agent between the debtor's agent and the creditor's agent.
              nullable: true
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            remittanceInformation:
              type: array
              description: >-
                Remittance Information. Limit: up to 4 lines; each line max 35
                characters.
              items:
                type: string
    VirtualAccountTransferOfVirtualAccountWithdrawalTransfer:
      type: object
      description: Represents an transfer between virtual accounts
      additionalProperties: false
      required:
        - id
        - status
        - uniqueIdentifier
        - linkedActivities
      properties:
        id:
          type: string
          description: Unique identifier for the transfer
        status:
          type: string
          description: >-
            The current processing status of the transaction, e.g. Completed,
            Pending, Failed
        uniqueIdentifier:
          type: string
          description: Unique identifier specific to this instance of the transfer
        details:
          description: Transfer data
          nullable: true
        linkedActivities:
          type: array
          description: |-
            List of related financial activities
                        
          items:
            $ref: '#/components/schemas/Activity'
    VirtualAccountWithdrawalTransfer:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountSettlementTransfer'
        - type: object
          additionalProperties: false
    VirtualAccountWithDrawalTransferRequestInternal:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountSettlementTransferRequestInternal'
        - type: object
          additionalProperties: false
    VirtualAccountWithDrawalTransferRequestExternal:
      allOf:
        - $ref: '#/components/schemas/VirtualAccountWithDrawalTransferRequestInternal'
        - type: object
          additionalProperties: false
          required:
            - debtor
            - debtorAgent
            - creditorAccount
            - chargesType
            - creditorAgent
          properties:
            debtor:
              type: string
              description: |-
                The ordering customer information or reference
                Max length: 35 characters.
              maxLength: 35
              minLength: 1
            debtorAgent:
              type: string
              description: |-
                The ordering customer agent (e.g., bank identifier code).
                Max length: 35 characters.
              maxLength: 35
              minLength: 1
            creditorAccount:
              type: object
              description: >-
                Unambiguous identification of the account of the creditor to
                which a credit entry will be posted as a result of the payment
                transaction.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            chargesType:
              type: string
              description: >-
                Specifies which party/parties will bear the charges associated
                with the processing of the transaction, e.g. 'OUR'

                Max length: 3 characters.
              maxLength: 3
              minLength: 1
            creditorAgent:
              type: object
              description: Financial institution servicing an account for the creditor.
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            intermediaryAgent:
              type: object
              description: Agent between the debtor's agent and the creditor's agent.
              nullable: true
              properties:
                identification:
                  type: string
                  description: >-
                    Unique identification of the party, such as a BIC (Bank
                    Identifier Code) for financial institutions

                    or an account number for account holders.
                  maxLength: 35
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Name by which the party is known and which is usually used
                    to identify the party.
                  maxLength: 35
                  minLength: 1
                additionalInformation:
                  type: array
                  description: >-
                    Additional information about the party that may be required
                    for processing the payment,

                    such as address details, country codes, or specific payment
                    instructions.

                    Max 4 lines; each line max 35 characters.
                  maxItems: 4
                  items:
                    type: string
                    maxLength: 35
            remittanceInformation:
              type: array
              description: >-
                Remittance Information. Limit: up to 4 lines; each line max 35
                characters.
              items:
                type: string
    ApiResponseOfBatchStatusOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/BatchStatus'
    BatchStatus:
      type: object
      description: Batch job status information
      additionalProperties: false
      required:
        - eventType
        - jobId
        - jobStatus
        - summary
      properties:
        eventType:
          type: string
          description: The type of event (e.g., "job.completed", "job.failed")
        jobId:
          type: string
          description: Unique identifier for the batch job
        jobStatus:
          type: string
          description: Job status (e.g., "Pending", "InProgress", "Completed", "Failed")
        summary:
          type: object
          description: Summary of job execution statistics
          properties:
            total:
              type: integer
              description: Total number of items in the batch
              format: int32
            completed:
              type: integer
              description: Number of items successfully completed
              format: int32
            failed:
              type: integer
              description: Number of items that failed
              format: int32
    BatchJobSummary:
      type: object
      description: Summary statistics for a batch job
      additionalProperties: false
      required:
        - total
        - completed
        - failed
      properties:
        total:
          type: integer
          description: Total number of items in the batch
          format: int32
        completed:
          type: integer
          description: Number of items successfully completed
          format: int32
        failed:
          type: integer
          description: Number of items that failed
          format: int32
    ApiResponseOfBatchJobResultOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/BatchJobResult'
    BatchJobResult:
      type: object
      description: >-
        Represents the persisted processing state and outcome of a single item
        within a submitted batch job.
      additionalProperties: false
      required:
        - id
        - jobId
        - externalItemId
        - payloadJson
        - status
        - attempt
        - httpStatus
        - createdUtc
      properties:
        id:
          type: string
          description: Internal identifier for this item result.
        jobId:
          type: string
          description: Identifier of the parent batch job that this item belongs to.
        externalItemId:
          type: string
          description: >-
            Client supplied item identifier (mirrors the batch Items[i].Id
            provided at submission time).
        payloadJson:
          type: string
          description: >-
            Original request payload serialized as JSON for auditing and replay
            diagnostics.
        status:
          type: string
          description: >-
            Current processing status of the item (e.g. Pending, InProgress,
            Completed, Failed, Cancelled).
        attempt:
          type: integer
          description: >-
            Number of processing attempts made for this item (incremented on
            retry).
          format: int32
        httpStatus:
          type: integer
          description: >-
            HTTP status code returned by the target endpoint for the most recent
            attempt.
          format: int32
        error:
          type: string
          description: >-
            Error message or diagnostic detail if processing failed; otherwise
            null.
          nullable: true
        resultJson:
          type: string
          description: >-
            Serialized JSON response body produced by the target endpoint on
            success (or last attempt); may be null.
          nullable: true
        createdUtc:
          type: string
          description: UTC timestamp when the item result record was created (queued).
          format: date-time
        finishedUtc:
          type: string
          description: >-
            UTC timestamp when the item reached a terminal state (Completed,
            Failed, Cancelled); otherwise null.
          format: date-time
          nullable: true
    BatchJobItemStatus:
      type: string
      description: ''
      x-enumNames:
        - Pending
        - InProgress
        - Completed
        - Failed
        - Cancelled
      enum:
        - Pending
        - InProgress
        - Completed
        - Failed
        - Cancelled
    SystemTimeResponse:
      type: object
      description: Response model for system time endpoint
      additionalProperties: false
      required:
        - timestamp
        - timeZone
      properties:
        timestamp:
          type: string
          description: >-
            Current server timestamp in ISO-8601 format (e.g.,
            2025-01-07T14:30:15-04:00)
        timeZone:
          type: string
          description: >-
            Current server time zone in IANA format (e.g., "Atlantic Daylight
            Time")
    ApiResponseOfTransactionStatusOf:
      type: object
      additionalProperties: false
      properties:
        meta:
          type: object
          description: Response metadata
          nullable: true
          properties:
            pagination:
              type: object
              description: Pagination information
              nullable: true
              properties:
                page_start:
                  type: integer
                  description: The record from which the response should be displayed
                  format: int32
                page_token:
                  type: string
                  description: >-
                    Unique id expected to get as part of response from Transact
                    on every enquiry request.
                  nullable: true
                total_size:
                  type: integer
                  description: Total number of records
                  format: int32
                page_size:
                  type: integer
                  description: The total number of records per page
                  format: int32
        data:
          type: array
          description: Response data
          nullable: true
          items:
            $ref: '#/components/schemas/TransactionStatus'
    TransactionStatus:
      type: object
      description: Represents the status of a transaction in the Open Banking API.
      additionalProperties: false
      required:
        - type
        - status
        - transactionId
        - debitAmount
        - valueDate
        - creditAmount
      properties:
        type:
          type: string
          description: The type of transaction (e.g., "Outward Swift Payment MT103 API")
        externalReference:
          type: string
          description: External reference number for the transaction
          nullable: true
        status:
          type: string
          description: >-
            Current status of the transaction (e.g., "Pending", "Completed",
            "Failed")
        remittanceInformation:
          type: string
          description: >-
            Free-text remittance information provided by the client, describing
            the purpose of the transaction.
          nullable: true
        transactionId:
          type: string
          description: Unique transaction number
        debitAmount:
          type: object
          description: The amount debited from the account
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        valueDate:
          type: string
          description: The date when the transaction will be processed
        creditAmount:
          type: object
          description: The amount credited from the account
          properties:
            currency:
              type: string
              description: Currency ISO code
            amount:
              type: string
              description: Amount
        exchangeRate:
          type: number
          description: Exchange rate applied to the transaction
          format: decimal
          nullable: true
  securitySchemes:
    Authorization:
      type: http
      description: Access token
      in: header
      scheme: bearer
      bearerFormat: jwt
    Feature Permissions:
      type: http
      description: >-
        Feature-based permissions are claims contained in the JWT token. The
        token must include the specified permission claim to access the
        endpoint. These permissions are validated during token validation.
      in: header
      scheme: bearer
      bearerFormat: jwt
