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

# Create new operation



## OpenAPI

````yaml Wallet post /{walletId}/asset/{assetId}/operation
openapi: 3.0.1
info:
  title: Wallet
  description: wallet
  version: 1.0.0
servers:
  - url: https://gateway.varchev.com/wallet
security:
  - default: []
paths:
  /{walletId}/asset/{assetId}/operation:
    post:
      tags:
        - Allowed Operation
      summary: Create new operation
      operationId: AllowedOperationController_addOperation
      parameters:
        - name: tenantId
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: walletId
          in: path
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: assetId
          in: path
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAllowedOperationReq'
        required: true
      responses:
        '200':
          description: Create new operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllowedOperationDto'
      security:
        - default: []
components:
  schemas:
    AddAllowedOperationReq:
      required:
        - assetType
        - fees
        - isSameWallet
        - limits
        - name
        - operationDestination
        - operationType
        - ownerId
      type: object
      properties:
        operationType:
          type: string
          enum:
            - buy
            - sell
            - deposit
            - withdraw
            - transfer
            - suspend
            - reverse
        assetType:
          type: string
        name:
          type: string
        isSameWallet:
          type: boolean
        ownerId:
          type: string
        operationDestination:
          $ref: '#/components/schemas/AddOperationDestinationReq'
        fees:
          type: array
          items:
            $ref: '#/components/schemas/AddFeeReq'
        limits:
          type: array
          items:
            $ref: '#/components/schemas/AddLimitReq'
    AllowedOperationDto:
      required:
        - assetType
        - fees
        - id
        - isSameWallet
        - limits
        - name
        - operationDestination
        - operationType
        - ownerId
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        operationType:
          type: string
          enum:
            - buy
            - sell
            - deposit
            - withdraw
            - transfer
            - suspend
            - reverse
        assetType:
          type: string
          enum:
            - currency
            - crypto-currency
            - bank-card
            - transport-card
            - id-card
            - qr-code
            - linked_account
            - linked_external_account
        name:
          type: string
        isSameWallet:
          type: boolean
        ownerId:
          type: string
        operationDestination:
          $ref: '#/components/schemas/OperationDestinationDto'
        fees:
          type: array
          items:
            $ref: '#/components/schemas/FeeDto'
        limits:
          type: array
          items:
            $ref: '#/components/schemas/LimitDto'
    AddOperationDestinationReq:
      required:
        - direction
        - operationAddresses
        - ownerId
        - type
      type: object
      properties:
        direction:
          type: string
          enum:
            - source
            - destination
        type:
          type: string
          enum:
            - asset
            - external_source
            - external_destination
        ownerId:
          type: string
        operationAddresses:
          type: array
          items:
            $ref: '#/components/schemas/AddOperationAddressReq'
    AddFeeReq:
      required:
        - appliedTo
        - defaultApiFee
        - feeApiAddress
        - feeLimit
        - feeSharing
        - feeValue
        - group
        - isDynamic
        - order
        - ownerId
        - paidBy
        - type
      type: object
      properties:
        type:
          type: string
          enum:
            - fixed
            - percentage
        feeValue:
          $ref: '#/components/schemas/AddAssetBalanceReq'
        paidBy:
          type: string
          enum:
            - source
            - destination
            - shared
            - tenant
            - owner
        feeSharing:
          $ref: '#/components/schemas/AddFeeSharingReq'
        isDynamic:
          type: boolean
        feeApiAddress:
          type: string
        group:
          type: number
        order:
          type: number
        ownerId:
          type: string
        appliedTo:
          type: string
          enum:
            - base
            - result
        feeLimit:
          $ref: '#/components/schemas/AddLimitReq'
        defaultApiFee:
          $ref: '#/components/schemas/AddAssetBalanceReq'
    AddLimitReq:
      required:
        - action
        - conditions
        - enforcementPoint
        - order
        - ownerId
        - priority
      type: object
      properties:
        enforcementPoint:
          type: string
          enum:
            - UI
            - Backend
            - Database
        priority:
          type: number
        order:
          type: number
        action:
          type: string
          enum:
            - deny
            - allow_and_report
            - deny_and_report
            - ask_user
            - allow_once
        ownerId:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/AddConditionReq'
    IdentityDto:
      required:
        - auditData
        - entityId
        - tenantId
      type: object
      properties:
        tenantId:
          type: string
        entityId:
          $ref: '#/components/schemas/IdResponse'
        auditData:
          $ref: '#/components/schemas/AuditDetailDto'
    OperationDestinationDto:
      required:
        - currencyPairs
        - direction
        - id
        - operationAddresses
        - ownerId
        - type
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        direction:
          type: string
          enum:
            - source
            - destination
        type:
          type: string
          enum:
            - asset
            - external_source
            - external_destination
        ownerId:
          type: string
        operationAddresses:
          type: array
          items:
            $ref: '#/components/schemas/OperationAddressDto'
        currencyPairs:
          type: array
          items:
            $ref: '#/components/schemas/CurrencyPairDto'
    FeeDto:
      required:
        - appliedTo
        - defaultApiFee
        - feeApiAddress
        - feeLimit
        - feeSharing
        - feeValue
        - group
        - id
        - isDynamic
        - order
        - ownerId
        - paidBy
        - type
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        type:
          type: string
          enum:
            - fixed
            - percentage
        feeValue:
          $ref: '#/components/schemas/AssetBalanceDto'
        paidBy:
          type: string
          enum:
            - source
            - destination
            - shared
            - tenant
            - owner
        feeSharing:
          $ref: '#/components/schemas/FeeSharingDto'
        isDynamic:
          type: boolean
        feeApiAddress:
          type: string
        group:
          type: number
        order:
          type: number
        ownerId:
          type: string
        appliedTo:
          type: string
          enum:
            - base
            - result
        feeLimit:
          $ref: '#/components/schemas/LimitDto'
        defaultApiFee:
          $ref: '#/components/schemas/AssetBalanceDto'
    LimitDto:
      required:
        - action
        - conditions
        - enforcementPoint
        - id
        - order
        - ownerId
        - priority
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        enforcementPoint:
          type: string
          enum:
            - UI
            - Backend
            - Database
        priority:
          type: number
        order:
          type: number
        action:
          type: string
          enum:
            - deny
            - allow_and_report
            - deny_and_report
            - ask_user
            - allow_once
        ownerId:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ConditionDto'
    AddOperationAddressReq:
      required:
        - data
        - ownerId
        - type
      type: object
      properties:
        type:
          type: string
          enum:
            - wallet_owner_platform
            - wallet_owner_bank
            - wallet_owner_blockchain
            - swift_bank
            - sepa_bank
            - exchange
            - blockchain
        data:
          $ref: '#/components/schemas/AddDataReq'
        ownerId:
          type: string
    AddAssetBalanceReq:
      required:
        - balanceType
        - instanceBaseRef
        - instanceRef
        - name
        - ownerId
        - value
      type: object
      properties:
        balanceType:
          type: string
          enum:
            - current
            - available
        name:
          type: string
        value:
          type: string
        ownerId:
          type: string
        instanceRef:
          type: string
        instanceBaseRef:
          type: string
    AddFeeSharingReq:
      required:
        - destination
        - ownerId
        - source
      type: object
      properties:
        source:
          $ref: '#/components/schemas/AddAssetBalanceReq'
        destination:
          $ref: '#/components/schemas/AddAssetBalanceReq'
        ownerId:
          type: string
    AddConditionReq:
      required:
        - objectRef
        - operation
        - order
        - ownerId
        - priority
        - requirementType
        - value
      type: object
      properties:
        priority:
          type: number
        order:
          type: number
        requirementType:
          type: string
          enum:
            - kyc
            - kyb
            - pep
            - periodical_limit
            - object_ref
            - transaction_limit
            - customer_state
        operation:
          type: string
          enum:
            - lessThan
            - lessEqual
            - equal
            - isA
            - greaterThan
            - notEqual
            - isNotA
            - betweenInclusive
            - betweenUpper
            - betweenOpen
            - betweenLower
            - contains
        objectRef:
          $ref: '#/components/schemas/AddValueReqDto'
        value:
          $ref: '#/components/schemas/AddValueReqDto'
        ownerId:
          type: string
    IdResponse:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          example: 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
    AuditDetailDto:
      required:
        - archivedAt
        - createdAt
        - createdBy
        - deletedAt
        - deletedBy
        - updatedAt
        - updatedBy
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
        archivedAt:
          type: string
          format: date-time
        createdBy:
          type: string
        updatedBy:
          type: string
        deletedBy:
          type: string
    OperationAddressDto:
      required:
        - data
        - id
        - ownerId
        - type
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        type:
          type: string
          enum:
            - wallet_owner_platform
            - wallet_owner_bank
            - wallet_owner_blockchain
            - swift_bank
            - sepa_bank
            - exchange
            - blockchain
        data:
          $ref: '#/components/schemas/DataDto'
        ownerId:
          type: string
    CurrencyPairDto:
      required:
        - baseCurrency
        - baseCurrencyId
        - id
        - pair
        - quoteCurrency
        - quoteCurrencyId
      type: object
      properties:
        id:
          type: string
        baseCurrency:
          type: string
        quoteCurrency:
          type: string
        pair:
          type: string
        baseCurrencyId:
          type: string
        quoteCurrencyId:
          type: string
    AssetBalanceDto:
      required:
        - id
        - instanceBaseRef
        - instanceRef
        - name
        - ownerId
        - value
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        name:
          type: string
        value:
          type: string
        ownerId:
          type: string
        instanceRef:
          type: string
        instanceBaseRef:
          type: string
    FeeSharingDto:
      required:
        - destination
        - id
        - ownerId
        - source
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        source:
          $ref: '#/components/schemas/AssetBalanceDto'
        destination:
          $ref: '#/components/schemas/AssetBalanceDto'
        ownerId:
          type: string
    ConditionDto:
      required:
        - id
        - objectRef
        - operation
        - order
        - ownerId
        - priority
        - requirementType
        - value
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        priority:
          type: number
        order:
          type: number
        requirementType:
          type: string
          enum:
            - kyc
            - kyb
            - pep
            - periodical_limit
            - object_ref
            - transaction_limit
            - customer_state
        operation:
          type: string
          enum:
            - lessThan
            - lessEqual
            - equal
            - isA
            - greaterThan
            - notEqual
            - isNotA
            - betweenInclusive
            - betweenUpper
            - betweenOpen
            - betweenLower
            - contains
        objectRef:
          $ref: '#/components/schemas/ValueDto'
        value:
          $ref: '#/components/schemas/ValueDto'
        ownerId:
          type: string
    AddDataReq:
      required:
        - name
        - value
      type: object
      properties:
        name:
          type: string
        value:
          type: string
    AddValueReqDto:
      required:
        - name
        - ownerId
        - type
        - value
      type: object
      properties:
        ownerId:
          type: string
        name:
          type: string
        type:
          type: number
        value:
          type: string
    DataDto:
      required:
        - id
        - name
        - value
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        name:
          type: string
        value:
          type: string
    ValueDto:
      required:
        - dataId
        - id
        - name
        - ownerId
        - type
        - value
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdentityDto'
        ownerId:
          type: string
        name:
          type: string
        type:
          type: number
        value:
          type: string
        dataId:
          type: string
  securitySchemes:
    default:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://test.com
          scopes: {}

````