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

# Prepare financial operation

> Prepare a financial operation before execution. Returns a preparedOrderId used by the execute endpoint.

## Endpoint

`POST /api/v2.1/fintrans/{accountId}/types/{operationType}/prepare`

<Note>
  This endpoint requires `X-Forwarded-From` and a device header. The backend accepts any of:
  `deviceId`, `X-Device-Id`, `device-id`.
</Note>

## Sample cURL

```bash theme={null}
curl --request POST \
  --url 'https://sandbox.finhub.cloud/api/v2.1/fintrans/{accountId}/types/{operationType}/prepare' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'X-Tenant-Id: <TENANT_ID>' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'User-Agent: <USER_AGENT>' \
  --header 'X-Forwarded-From: <FORWARDED_FROM>' \
  --header 'platform: Web' \
  --header 'deviceId: <DEVICE_ID>' \
  --data '{
    "type": "INTERNAL",
    "target": {
      "name": "John Customer",
      "iban": "LT213320011000055860"
    },
    "currency": "EUR",
    "beneficiaryName": "John Customer",
    "amount": {
      "value": "100000",
      "scale": 2,
      "currency": "EUR"
    },
    "beneficiaryId": "eba40e17-e539-430e-a6cc-2b0f01e4c86e",
    "sourceAccount": {
      "walletId": "d7d94804-4d8b-45af-862f-77cbcef740f4"
    },
    "companyName": "John Customer",
    "description": "Internal funding transfer to customer wallet",
    "consent": {
      "consentReference": "f3822ff0-3986-4fef-84eb-7b517e657b6f"
    }
  }'
```

## Response Example

```json theme={null}
{
  "code": 200,
  "data": {
    "preparedOrderId": "621d1386-f2fb-4655-88a8-997db0ec446a",
    "status": "READY"
  },
  "message": "Success"
}
```

<Note>
  Use the returned `preparedOrderId` as input to the execute endpoint.
</Note>

## Missing Headers Error Example

```json theme={null}
{
  "code": 500,
  "data": {
    "deviceId_accepted": [
      "deviceId",
      "X-Device-Id",
      "device-id"
    ],
    "missingHeaders": [
      "X-Forwarded-From",
      "deviceId"
    ]
  },
  "message": "Missing required header(s)"
}
```


## OpenAPI

````yaml openapi.yaml POST /api/v2.1/fintrans/{accountId}/types/{operationType}/prepare
openapi: 3.1.0
info:
  title: Business BFF API
  version: 1.0.0
  description: Backend for Frontend - Business Panels Orchestration Layer
servers:
  - url: https://sandbox.finhub.cloud
    description: Sandbox Environment
security: []
tags:
  - name: AML
    description: Anti-Money Laundering checks and transaction monitoring
  - name: Admin - Consent Management
    description: Operations for managing consent templates and definitions
  - name: B2B Customer - Organization
    description: B2B organization registration and management
  - name: B2C Customer - Individual
    description: Individual customer registration and lifecycle management
  - name: BFF Admin - Tenant Initialization
    description: Lazy tenant initialization for fast startup
  - name: Catalog Hierarchy
    description: Hierarchical catalog management APIs
  - name: Catalog-Process Mapping
    description: APIs for catalog-process relationship management
  - name: Consent
    description: Payment consent creation and approval
  - name: Draft Management
  - name: External Events
    description: Kafka-to-HTTP bridge event ingestion and query
  - name: FinCard Virtual - Webhooks
    description: FinCard Virtual Card Webhook receiver
  - name: FinCard Virtual Account
    description: FinCard Virtual Card Account API proxy
  - name: FinCard Virtual Card Holder
    description: FinCard Virtual Card Holder API proxy
  - name: FinCard Virtual Cards
    description: FinCard Virtual Card API proxy
  - name: FinCard Virtual Common
    description: FinCard Virtual Card Common API proxy
  - name: FinCard Virtual Wallet
    description: FinCard Virtual Card Wallet API v2 proxy
  - name: FinTrans - Operations
    description: Financial transaction operations
  - name: Internal Webhooks
    description: Internal service-to-service webhook trigger (HMAC-secured)
  - name: MFE Preload
    description: MFE preload endpoints for SSR optimization
  - name: MFE Registry
    description: MFE Registry management endpoints
  - name: Payment Consent Management
    description: Operations for managing payment consents and validation
  - name: Person
    description: Person details for process context
  - name: Products
    description: Product Catalog Management API
  - name: Reference Data
    description: Shared reference data (countries, etc.)
  - name: Tenant Lifecycle
    description: Tenant mode transitions and lifecycle management
  - name: Tenant Registration
    description: Self-registration and tenant onboarding
  - name: Transfers
    description: Transfer prepare/execute aliases for muse-proxy compatibility
  - name: Verification
    description: Customer verification (KYC/KYB/AML) management
  - name: Wallet
    description: Wallet operations and balance management
  - name: Webhooks
    description: Webhook subscription and delivery management
paths:
  /api/v2.1/fintrans/{accountId}/types/{operationType}/prepare:
    post:
      tags:
        - FinTrans - Operations
      summary: Prepare financial operation
      description: >-
        Prepare a financial operation before execution. Returns a
        preparedOrderId used by the execute operation endpoint.
      parameters:
        - name: accountId
          schema:
            type: string
            format: uuid
            examples:
              - 00000000-0000-0000-0000-000000000000
          in: path
          required: true
        - description: >-
            Operation kind (see prepare/execute and
            FinTransApiService.deriveAllowedOperationTypes)
          name: operationType
          schema:
            type: string
            enum:
              - transfer
            example: transfer
          in: path
          required: true
        - name: X-Tenant-ID
          in: header
          schema:
            type: string
            example: tenant-demo-001
        - name: X-User-ID
          in: header
          required: false
          schema:
            type: string
        - name: X-Forwarded-For
          in: header
          description: Client IP address
          schema:
            type: string
            example: 127.0.0.1
        - name: X-Forwarded-From
          in: header
          description: Client source identifier
          schema:
            type: string
            example: client-app
        - name: platform
          in: header
          description: Client platform
          schema:
            type: string
            example: mobile
        - name: deviceId
          in: header
          description: Device identifier
          schema:
            type: string
            example: device-demo-001
        - name: Authorization
          in: header
          description: Bearer JWT
          schema:
            type: string
            example: >-
              Bearer
              eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkZW1vLXVzZXIifQ.demo-signature
      requestBody:
        description: Prepare operation payload
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - type
                - target
                - currency
                - beneficiaryName
                - amount
                - beneficiaryId
                - sourceAccount
                - companyName
                - description
                - consent
              properties:
                type:
                  type: string
                  example: INTERNAL
                target:
                  type: object
                  additionalProperties: false
                  required:
                    - name
                    - iban
                  properties:
                    name:
                      type: string
                      example: John Customer
                    iban:
                      type: string
                      example: LT213320011000055860
                currency:
                  type: string
                  example: EUR
                beneficiaryName:
                  type: string
                  example: John Customer
                amount:
                  type: object
                  additionalProperties: false
                  required:
                    - value
                    - scale
                    - currency
                  properties:
                    value:
                      type: string
                      example: '100000'
                    scale:
                      type: integer
                      example: 2
                    currency:
                      type: string
                      example: EUR
                beneficiaryId:
                  type: string
                  example: eba40e17-e539-430e-a6cc-2b0f01e4c86e
                sourceAccount:
                  type: object
                  additionalProperties: false
                  required:
                    - walletId
                  properties:
                    walletId:
                      type: string
                      example: d7d94804-4d8b-45af-862f-77cbcef740f4
                companyName:
                  type: string
                  example: John Customer
                description:
                  type: string
                  example: Internal funding transfer to customer wallet
                consent:
                  type: object
                  additionalProperties: false
                  required:
                    - consentReference
                  properties:
                    consentReference:
                      type: string
                      example: f3822ff0-3986-4fef-84eb-7b517e657b6f
            example:
              type: INTERNAL
              target:
                name: John Customer
                iban: LT213320011000055860
              currency: EUR
              beneficiaryName: John Customer
              amount:
                value: '100000'
                scale: 2
                currency: EUR
              beneficiaryId: eba40e17-e539-430e-a6cc-2b0f01e4c86e
              sourceAccount:
                walletId: d7d94804-4d8b-45af-862f-77cbcef740f4
              companyName: John Customer
              description: Internal funding transfer to customer wallet
              consent:
                consentReference: f3822ff0-3986-4fef-84eb-7b517e657b6f
        required: true
      responses:
        '200':
          description: Operation prepared
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponsePreparedOrderResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
components:
  schemas:
    BaseResponsePreparedOrderResponse:
      type: object
      description: Standard API response wrapper with prepared order in data
      properties:
        code:
          type: integer
          format: int32
          examples:
            - 201
          description: HTTP-style status code
          example: 201
        data:
          $ref: '#/components/schemas/PreparedOrderResponse'
          type: object
          description: Prepared order
        message:
          type: string
          examples:
            - Success
          description: Result message
          example: Success
    PreparedOrderResponse:
      type: object
      description: Prepared order response payload
      properties:
        preparedOrderId:
          type: string
          examples:
            - 8c5a8cc5-56f8-4d63-ae50-4de57f4f9c8b
          description: Prepared order identifier
          example: 8c5a8cc5-56f8-4d63-ae50-4de57f4f9c8b
        sessionId:
          type: string
        status:
          type: string
        balanceCheck: {}
        consent: {}
        documents: {}
        fees: {}
        regulatoryInfo: {}
        statusDetails: {}
        summary: {}
        transactions:
          type: array
          items: {}
        tenantId:
          type: string
        time:
          type: string
        validUntil:
          type: string

````