openapi: 3.0.0
info:
  description: ''
  title: Flagright API
  contact: {}
  version: '1.0'
servers:
  - url: https://sandbox.api.flagright.com
    description: Sandbox API server (eu-1)
    x-fern-server-name: Sandbox API server (eu-1)
  - url: https://sandbox-asia-1.api.flagright.com
    description: Sandbox API server (asia-1)
    x-fern-server-name: Sandbox API server (asia-1)
paths:
  /transactions:
    post:
      x-fern-sdk-group-name: transactions
      x-fern-sdk-method-name: verify
      security:
        - x-api-key: []
      summary: Verify a Transaction
      description: >-
        ## POST Transactions


        `/transactions` endpoint allows you to operate on the [Transaction entity.](/guides/overview/entities#transaction)


        In order to pass the payload of a transaction to Flagright and verify the transaction, you will need to call this endpoint with the transaction payload. Not all fields are mandatory, you will only need to pass in the fields that you have and are relevant for your compliance setup.



        ### Payload


        Here are some of the most used payload fields explained (you can find the full payload [schema below](/api-reference/api-reference/transactions/verify#request) with 1 line descriptions):


        * `type`: Type of transaction (Ex: `WITHDRAWAL`, `DEPOSIT`, `TRANSFER` etc).

        * `transactionId` - Unique Identifier for the transaction.

        * `timestamp` - UNIX timestamp in *milliseconds* of when the transaction took place

        * `transactionState` - The state of the transaction, set to `CREATED` by default. [More details here](/guides/overview/entities#transaction-lifecycle-through-transaction-events)

        * `originUserId` - Unique identifier (if any) of the user who is sending the money. This user must be created within the Flagright system before using the [create a consumer user](/api-reference/api-reference/consumer-users/create) or [create a business user](/api-reference/api-reference/business-users/create) endpoint

        * `destinationUserId` - Unique identifier (if any) of the user who is receiving the money. This user must be created within the Flagright system before using the [create a consumer user](/api-reference/api-reference/consumer-users/create) or [create a business user](/api-reference/api-reference/business-users/create) endpoint

        * `originAmountDetails` - Details of the amount being sent from the origin

        * `destinationAmountDetails` - Details of the amount being received at the destination

        * `originPaymentDetails` - Payment details (if any) used at the origin (ex: `CARD`, `IBAN`, `WALLET` etc). You can click on the dropdown next to the field in the schema below to view all supported payment types.

        * `destinationPaymentDetails` - Payment details (if any) used at the destination (ex: `CARD`, `IBAN`, `WALLET` etc). You can click on the dropdown next to the field in the schema below to view all supported payment types.
      operationId: post-consumer-transaction
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: validateOriginUserId
          description: Boolean string whether Flagright should validate if provided
            originUserId exist. True by default
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          description: Boolean string whether Flagright should validate if provided
            destinationUserId exist. True by default
          name: validateDestinationUserId
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          description: Boolean string whether Flagright should validate if provided
            transactionId exist. True by default
          name: validateTransactionId
          x-fern-ignore: true
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: _trsOnly
          x-fern-ignore: true
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Transaction'
            examples:
              example-1:
                value:
                  transactionId: 7b80a539eea6e78acbd6d458e5971482
                  type: DEPOSIT
                  originUserId: 8650a2611d0771cba03310f74bf6
                  destinationUserId: 9350a2611e0771cba03310f74bf6
                  originAmountDetails:
                    country: DE
                    transactionAmount: 800
                    transactionCurrency: EUR
                  destinationAmountDetails:
                    country: IN
                    transactionAmount: 68351.34
                    transactionCurrency: INR
                  promotionCodeUsed: true
                  timestamp: 1641654664000
                  originPaymentDetails:
                    method: CARD
                    cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                    cardIssuedCountry: US
                    transactionReferenceField: Deposit
                    3dsDone: true
                  destinationPaymentDetails:
                    method: CARD
                    cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                    cardIssuedCountry: IN
                    transactionReferenceField: Deposit
                    3dsDone: true
                  reference: loan repayment
                  originDeviceData:
                    batteryLevel: 95
                    deviceLatitude: 13.0033
                    deviceLongitude: 76.1004
                    ipAddress: 10.23.191.2
                    deviceIdentifier: 3c49f915d04485e34caba
                    vpnUsed: false
                    operatingSystem: Android 11.2
                    deviceMaker: ASUS
                    deviceModel: Zenphone M2 Pro Max
                    deviceYear: '2018'
                    appVersion: 1.1.0
                  destinationDeviceData:
                    batteryLevel: 95
                    deviceLatitude: 13.0033
                    deviceLongitude: 76.1004
                    ipAddress: 10.23.191.2
                    deviceIdentifier: 3c49f915d04485e34caba
                    vpnUsed: false
                    operatingSystem: Android 11.2
                    deviceMaker: ASUS
                    deviceModel: Zenphone M2 Pro Max
                    deviceYear: '2018'
                    appVersion: 1.1.0
                  tags:
                    - key: customKey
                      value: customValue
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TransactionMonitoringResult'
                  - type: object
                    properties:
                      message:
                        type: string
              examples:
                example-1:
                  value:
                    transactionId: 7b80a539eea6e78acbd6d458e5971482
                    executedRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
                        ruleHit: true
                    hitRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /transactions/{transactionId}:
    get:
      x-fern-sdk-group-name: transactions
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Transaction
      description: >-
        ### GET Transactions


        `/transactions` endpoint allows you to operate on the [Transaction entity](/guides/overview/entities#transaction).


        Calling `GET /transactions/{transactionId}` will return the entire transaction payload and rule execution results for the transaction with the corresponding `transactionId`
      operationId: get-consumer-transaction
      parameters:
        - name: transactionId
          in: path
          description: Unique Transaction Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionWithRulesResult'
              examples:
                example-1:
                  value:
                    transactionId: 7b80a539eea6e78acbd6d458e5971482
                    type: DEPOSIT
                    originUserId: 8650a2611d0771cba03310f74bf6
                    destinationUserId: 9350a2611e0771cba03310f74bf6
                    originAmountDetails:
                      country: DE
                      transactionAmount: 800
                      transactionCurrency: EUR
                    destinationAmountDetails:
                      country: IN
                      transactionAmount: 68351.34
                      transactionCurrency: INR
                    promotionCodeUsed: true
                    timestamp: 1641654664000
                    originPaymentDetails:
                      method: CARD
                      cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                      cardIssuedCountry: US
                      transactionReferenceField: Deposit
                      3dsDone: true
                    destinationPaymentDetails:
                      method: CARD
                      cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                      cardIssuedCountry: IN
                      transactionReferenceField: Deposit
                      3dsDone: true
                    reference: loan repayment
                    originDeviceData:
                      batteryLevel: 95
                      deviceLatitude: 13.0033
                      deviceLongitude: 76.1004
                      ipAddress: 10.23.191.2
                      deviceIdentifier: 3c49f915d04485e34caba
                      vpnUsed: false
                      operatingSystem: Android 11.2
                      deviceMaker: ASUS
                      deviceModel: Zenphone M2 Pro Max
                      deviceYear: '2018'
                      appVersion: 1.1.0
                    destinationDeviceData:
                      batteryLevel: 95
                      deviceLatitude: 13.0033
                      deviceLongitude: 76.1004
                      ipAddress: 10.23.191.2
                      deviceIdentifier: 3c49f915d04485e34caba
                      vpnUsed: false
                      operatingSystem: Android 11.2
                      deviceMaker: ASUS
                      deviceModel: Zenphone M2 Pro Max
                      deviceYear: '2018'
                      appVersion: 1.1.0
                    tags:
                      - key: customKey
                        value: customValue
                    executedRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
                        ruleHit: true
                    hitRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/transactions:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: verify_transaction
      security:
        - x-api-key: []
      summary: Bulk create transactions
      operationId: post-batch-transactions
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: validateOriginUserId
          description: Boolean string whether Flagright should validate if provided
            originUserId exist. True by default
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          description: Boolean string whether Flagright should validate if provided
            destinationUserId exist. True by default
          name: validateDestinationUserId
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionBatchRequest'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/transactions/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a transaction batch
      operationId: get-batch-transactions
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchTransactionMonitoringResults'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /events/transaction:
    post:
      x-fern-sdk-group-name: transaction_events
      x-fern-sdk-method-name: create
      security:
        - x-api-key: []
      summary: Create a Transaction Event
      description: >
        ## POST Transaction Events


        `/events/transaction` endpoint allows you to operate on the [Transaction Events entity.](/guides/overview/entities#transaction-event)


        Transaction events are created after the initial `POST /transactions` call (which creates a transaction) and are used to:


        * Update the STATE of the transaction, using the `transactionState` field and manage the [Transaction Lifecycle](/guides/overview/entities#transaction-lifecycle-through-transaction-events)

        * Update the transaction details, using the `updatedTransactionAttributes` field.


        > If you have neither of the above two use cases, you do not need to use transaction events.


        ### Payload


        Each transaction event needs three mandatory fields:


        * `transactionState` - STATE of the transaction -> value is set to `CREATED` after `POST /transactions` call

        * `timestamp`- the timestamp of when the event was created or occured in your system

        * `transactionId` - The ID of the transaction for which this event is generated.


        In order to make individual events retrievable, you also need to pass in a unique `eventId` to the request body.
      operationId: post-transaction-event
      parameters: []
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionEvent'
            examples:
              example-2:
                value:
                  timestamp: 1752526580000
                  transactionId: 443dea26147a406b957d9ee3a1247b11
                  transactionState: SUCCESSFUL
                  eventId: aaeeb166147a406b957dd9147a406b957
                  eventDescription: Transaction created
                  status: ALLOW
                  metaData:
                    batteryLevel: 76.3
                    deviceLatitude: 13.009711
                    deviceLongitude: 76.102898
                    ipAddress: 79.144.2.20
                    vpnUsed: true
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionEventMonitoringResult'
              examples:
                example-1:
                  value:
                    eventId: 7b80a539eea6e78acbd6d458e5971482
                    transaction:
                      transactionId: 7b80a539eea6e78acbd6d458e5971482
                      type: DEPOSIT
                      originUserId: 8650a2611d0771cba03310f74bf6
                      destinationUserId: 9350a2611e0771cba03310f74bf6
                      originAmountDetails:
                        country: DE
                        transactionAmount: 800
                        transactionCurrency: EUR
                      destinationAmountDetails:
                        country: IN
                        transactionAmount: 68351.34
                        transactionCurrency: INR
                      promotionCodeUsed: true
                      timestamp: 1752526580000
                      originPaymentDetails:
                        method: CARD
                        cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                        cardIssuedCountry: US
                        transactionReferenceField: Deposit
                        3dsDone: true
                      destinationPaymentDetails:
                        method: CARD
                        cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
                        cardIssuedCountry: IN
                        transactionReferenceField: Deposit
                        3dsDone: true
                      reference: loan repayment
                      originDeviceData:
                        batteryLevel: 95
                        deviceLatitude: 13.0033
                        deviceLongitude: 76.1004
                        ipAddress: 10.23.191.2
                        deviceIdentifier: 3c49f915d04485e34caba
                        vpnUsed: false
                        operatingSystem: Android 11.2
                        deviceMaker: ASUS
                        deviceModel: Zenphone M2 Pro Max
                        deviceYear: '2018'
                        appVersion: 1.1.0
                      destinationDeviceData:
                        batteryLevel: 95
                        deviceLatitude: 13.0033
                        deviceLongitude: 76.1004
                        ipAddress: 10.23.191.2
                        deviceIdentifier: 3c49f915d04485e34caba
                        vpnUsed: false
                        operatingSystem: Android 11.2
                        deviceMaker: ASUS
                        deviceModel: Zenphone M2 Pro Max
                        deviceYear: '2018'
                        appVersion: 1.1.0
                      tags:
                        - key: customKey
                          value: customValue
                    executedRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
                        ruleHit: true
                    hitRules:
                      - ruleId: R-1a
                        ruleName: Proof of funds for high value transactions
                        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                          for proof of funds
                        ruleAction: BLOCK
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: false
  /batch/events/transaction:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: create_transaction_events
      security:
        - x-api-key: []
      summary: Batch create transaction events
      operationId: post-batch-transaction-events
      parameters: []
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionEventBatchRequest'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: false
  /batch/events/transaction/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrive transaction events batch
      operationId: get-batch-transaction-events
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchTransactionEventMonitoringResults'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /events/transaction/{eventId}:
    get:
      x-fern-sdk-group-name: transaction_events
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Transaction Event
      description: >
        ### GET Transaction Events


        `/events/transaction` endpoint allows you to operate on the [Transaction Events entity.](/guides/overview/entities#transaction-event).


        You can retrieve any transaction event you created using the [POST Transaction Events](/api-reference/api-reference/transaction-events/create) call.
      operationId: get-transaction-event
      parameters:
        - name: eventId
          in: path
          description: Unique Transaction Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionEventWithRulesResult'
              examples:
                example-1:
                  value:
                    transactionId: 443dea26147a406b957d9ee3a1247b11
                    transactionState: SUCCESSFUL
                    timestamp: 1641654664000
                    metaData:
                      ipAddress: 144.13.22.19
                      vpnUsed: true
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: true
  /consumer/users:
    post:
      x-fern-sdk-group-name: consumer_users
      x-fern-sdk-method-name: create
      security:
        - x-api-key: []
      summary: Create a Consumer User
      description: >
        ## POST Consumer User


        `/consumer/user` endpoint allows you to operate on the Consumer user entity.


        In order to pass the payload of a User to Flagright and verify the User, you will need to call this endpoint with the User payload. Not all fields are mandatory, you will only need to pass in the fields that you have and are relevant for your compliance setup.


        ### Payload


        Each consumer user needs two mandatory fields:


        * `userId` - Unique identifier for the user

        * `createdTimestamp` - UNIX timestamp in *milliseconds* for when the User is created in your system
      operationId: post-consumer-user
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockCraRiskLevel
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockKycRiskLevel
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: validateUserId
          description: Boolean string whether Flagright should validate the userId
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: _krsOnly
          x-fern-ignore: true
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
            examples:
              example-1:
                value:
                  createdTimestamp: 1641654664000
                  userId: 96647cfd9e8fe66ee0f3362e011e34e8
                  userDetails:
                    name:
                      firstName: Baran
                      middleName: Realblood
                      lastName: Ozkan
                    dateOfBirth: 1991-01-01
                    countryOfResidence: US
                    countryOfNationality: DE
                  legalDocuments:
                    - documentType: passport
                      documentNumber: Z9431P
                      documentIssuedDate: 1639939034000
                      documentExpirationDate: 1839939034000
                      documentIssuedCountry: DE
                      tags:
                        - key: customerType
                          value: wallet
                  contactDetails:
                    emailIds:
                      - baran@flagright.com
                    contactNumbers:
                      - '+37112345432'
                    websites:
                      - flagright.com
                    addresses:
                      - addressLines:
                          - Klara-Franke Str 20
                        postcode: '10557'
                        city: Berlin
                        state: Berlin
                        country: Germany
                        tags:
                          - key: customKey
                            value: customValue
                  tags:
                    - key: customKey
                      value: customValue
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ConsumerUserMonitoringResult'
                  - type: object
                    properties:
                      message:
                        type: string
              examples:
                example-1:
                  value:
                    userId: 96647cfd9e8fe66ee0f3362e011e34e8
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /consumer/users/{userId}:
    get:
      x-fern-sdk-group-name: consumer_users
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Consumer User
      description: >-
        ### GET Consumer User


        `/consumer/user` endpoint allows you to operate on the Consumer User entity.


        Calling `GET /consumer/user/{userId}` will return the entire user payload and rule execution results for the user with the corresponding `userId`
      operationId: get-consumer-user
      parameters:
        - name: userId
          in: path
          description: ''
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithRulesResult'
              examples:
                example-1:
                  value:
                    createdTimestamp: 1641654664000
                    userId: 96647cfd9e8fe66ee0f3362e011e34e8
                    userDetails:
                      name:
                        firstName: Baran
                        middleName: Realblood
                        lastName: Ozkan
                      dateOfBirth: 1991-01-01
                      countryOfResidence: US
                      countryOfNationality: DE
                    legalDocuments:
                      - documentType: passport
                        documentNumber: Z9431P
                        documentIssuedDate: 1639939034000
                        documentExpirationDate: 1839939034000
                        documentIssuedCountry: DE
                        tags:
                          - key: customerType
                            value: wallet
                    riskScoreDetails:
                      kycRiskScore: 11.72
                      craRiskScore: 41.72
                      kycRiskLevel: MEDIUM
                      craRiskLevel: HIGH
                    contactDetails:
                      emailIds:
                        - baran@flagright.com
                      contactNumbers:
                        - '+37112345432'
                      websites:
                        - flagright.com
                      addresses:
                        - addressLines:
                            - Klara-Franke Str 20
                          postcode: '10557'
                          city: Berlin
                          state: Berlin
                          country: Germany
                          tags:
                            - key: customKey
                              value: customValue
                    tags:
                      - key: customKey
                        value: customValue
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/consumer/users:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: create_consumer_users
      security:
        - x-api-key: []
      summary: Batch create consumer users
      operationId: post-batch-consumer-users
      parameters:
        - name: lockCraRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
        - name: lockKycRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserBatchRequest'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/consumer/users/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a consumer user batch
      operationId: get-batch-consumer-users
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchConsumerUsersWithRulesResults'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/business/users/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a business user batch
      operationId: get-batch-business-users
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchBusinessUsersWithRulesResults'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /business/users:
    post:
      x-fern-sdk-group-name: business_users
      x-fern-sdk-method-name: create
      security:
        - x-api-key: []
      summary: Create a Business User
      description: >-
        ## POST Business User


        `/business/user` endpoint allows you to operate on the Business user entity.


        In order to pass the payload of a User to Flagright and verify the User, you will need to call this endpoint with the User payload. Not all fields are mandatory, you will only need to pass in the fields that you have and are relevant for your compliance setup.


        ### Payload



        Each business user needs three mandatory fields:


        * `userId` - Unique identifier for the user

        * `legalEntity` - Details of the business legal entity (CompanyGeneralDetails, FinancialDetails etc) - only `legalName`in `CompanyGeneralDetails` is mandatory

        * `createdTimestamp` - UNIX timestamp in *milliseconds* for when the User is created in your system
      operationId: post-business-user
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockCraRiskLevel
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockKycRiskLevel
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: validateUserId
          description: Boolean string whether Flagright should validate the userId
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: _krsOnly
          x-fern-ignore: true
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Business'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BusinessUserMonitoringResult'
                  - type: object
                    properties:
                      message:
                        type: string
              examples:
                example-1:
                  value:
                    userId: 96647cfd9e8fe66ee0f3362e011e34e8
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /business/users/{userId}:
    get:
      x-fern-sdk-group-name: business_users
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Business User
      description: >-
        ### GET Business User


        `/business/user` endpoint allows you to operate on the Business User entity.


        Calling `GET /business/user/{userId}` will return the entire User payload and rule execution results for the User with the corresponding `userId`
      operationId: get-business-user-userId
      parameters:
        - name: userId
          in: path
          description: ''
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessWithRulesResult'
              examples:
                example-2:
                  value:
                    createdTimestamp: 1641654664000
                    userId: 96647cfd9e8fe66ee0f3362e011e34e8
                    legalEntity:
                      companyGeneralDetails:
                        legalName: Ozkan Hazelnut Export JSC
                        businessIndustry:
                          - Farming
                        mainProductsServicesSold:
                          - Hazelnut
                      companyFinancialDetails:
                        expectedTransactionAmountPerMonth:
                          amountValue: 800
                          amountCurrency: GBP
                        expectedTurnoverPerMonth:
                          amountValue: 8000
                          amountCurrency: USD
                      companyRegistrationDetails:
                        registrationIdentifier: PSJ554342
                        registrationCountry: DE
                      reasonForAccountOpening:
                        - string
                      contactDetails:
                        addresses:
                          - addressLines:
                              - Klara-Franke Str 20
                            postcode: '10557'
                            city: Berlin
                            state: Berlin
                            country: Germany
                            tags:
                              - key: customKey
                                value: customValue
                    shareHolders:
                      - generalDetails:
                          name:
                            firstName: Baran
                            middleName: Realblood
                            lastName: Ozkan
                          dateOfBirth: 1991-01-01
                          countryOfResidence: US
                          countryOfNationality: DE
                        legalDocuments:
                          - documentType: passport
                            documentNumber: Z9431P
                            documentIssuedDate: 1639939034000
                            documentExpirationDate: 1839939034000
                            documentIssuedCountry: DE
                            tags:
                              - key: customerType
                                value: wallet
                        contactDetails:
                          emailIds:
                            - baran@flagright.com
                          contactNumbers:
                            - +371 123132
                          websites:
                            - flagright.com
                          addresses:
                            - addressLines:
                                - Klara-Franke Str 20
                              postcode: '10557'
                              city: Berlin
                              state: Berlin
                              country: Germany
                              tags:
                                - key: customKey
                                  value: customValue
                        tags:
                          - key: customKey
                            value: customValue
                    directors:
                      - generalDetails:
                          name:
                            firstName: Baran
                            middleName: Realblood
                            lastName: Ozkan
                          dateOfBirth: 1991-01-01
                          countryOfResidence: US
                          countryOfNationality: DE
                        legalDocuments:
                          - documentType: passport
                            documentNumber: Z9431P
                            documentIssuedDate: 1639939034000
                            documentExpirationDate: 1839939034000
                            documentIssuedCountry: DE
                            tags:
                              - key: customerType
                                value: wallet
                        contactDetails:
                          emailIds:
                            - baran@flagright.com
                          contactNumbers:
                            - +371 123132
                          websites:
                            - flagright.com
                          addresses:
                            - addressLines:
                                - Klara-Franke Str 20
                              postcode: '10557'
                              city: Berlin
                              state: Berlin
                              country: Germany
                              tags:
                                - key: customKey
                                  value: customValue
                        tags:
                          - key: customKey
                            value: customValue
                    tags:
                      - key: customKey
                        value: customValue
                    riskScoreDetails:
                      kycRiskScore: 11.72
                      craRiskScore: 41.72
                      kycRiskLevel: MEDIUM
                      craRiskLevel: HIGH
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/business/users:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: create_business_users
      security:
        - x-api-key: []
      summary: Batch create business users
      operationId: post-batch-business-users
      parameters:
        - name: lockCraRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
        - name: lockKycRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessBatchRequest'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
  /events/consumer/user:
    post:
      x-fern-sdk-group-name: consumer_user_events
      x-fern-sdk-method-name: create
      security:
        - x-api-key: []
      summary: Create a Consumer User Event
      description: >
        ## POST Consumer User Events


        `/events/consumer/user` endpoint allows you to operate on the Consumer User Events entity.


        User events are created after the initial `POST /consumer/users` call (which creates a user) and are used to:


        * Update the STATE and KYC Status of the user, using the `userStateDetails` or `kycStatusDetails` field

        * Update the user details, using the `updatedConsumerUserAttributes` field.


        > If you have neither of the above two use cases, you do not need to use user events.


        ### Payload


        Each user event needs three mandatory fields:


        * `timestamp`- the timestamp of when the event was created or occured in your system

        * `userId` - The ID of the transaction for which this event is generated.


        In order to make individual events retrievable, you also need to pass in a unique `eventId` to the request body.
      operationId: post-user-event
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: allowUserTypeConversion
          description: Boolean string whether Flagright should allow a Consumer user event
            to be applied to a Business user with the same user ID. This will
            converts a Business user to a Consumer user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockKycRiskLevel
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockCraRiskLevel
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumerUserEvent'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithRulesResult'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: false
  /batch/events/consumer/user/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrive consumer user events batch
      operationId: get-batch-consumer-user-events
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchConsumerUserEventsWithRulesResult'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/events/business/user/{batchId}:
    get:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrive business user events batch
      operationId: get-batch-business-user-events
      parameters:
        - name: batchId
          in: path
          description: Unique Batch Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          name: pageSize
          description: Page size (default 20)
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Page'
          name: page
          description: Page
          in: query
          required: false
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchBusinessUserEventsWithRulesResult'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: NotFound
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
  /batch/events/consumer/user:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: create_consumer_user_events
      security:
        - x-api-key: []
      summary: Batch create consumer user events
      operationId: post-batch-consumer-user-events
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumerUserEventBatchRequest'
        required: true
      parameters:
        - name: lockCraRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
        - name: lockKycRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: false
  /events/consumer/user/{eventId}:
    get:
      x-fern-sdk-group-name: consumer_user_events
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Consumer User Event
      description: >
        ### GET a Consumer User Event

        You can retrieve any consumer user event you created using the [POST Consumer User Events](/api-reference/api-reference/consumer-user-events/create) call.
      operationId: get-consumer-user-event
      parameters:
        - name: eventId
          in: path
          description: Unique Consumer User Event Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerUserEventWithRulesResult'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: true
  /events/business/user:
    post:
      x-fern-sdk-group-name: business_user_events
      x-fern-sdk-method-name: create
      security:
        - x-api-key: []
      summary: Create a Business User Event
      description: >
        ## POST Business User Events


        `/events/business/user` endpoint allows you to operate on the Business User Events entity.


        User events are created after the initial `POST /business/users` call (which creates a user) and are used to:


        * Update the STATE and KYC Status of the user, using the `userStateDetails` or `kycStatusDetails` field

        * Update the user details, using the `updatedBusinessUserAttributes` field.


        > If you have neither of the above two use cases, you do not need to use user events.


        ### Payload


        Each user event needs three mandatory fields:


        * `timestamp`- the timestamp of when the event was created or occured in your system

        * `userId` - The ID of the transaction for which this event is generated.


        In order to make individual events retrievable, you also need to pass in a unique `eventId` to the request body.
      operationId: post-business-user-event
      parameters:
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: allowUserTypeConversion
          description: Boolean string whether Flagright should allow a Business user event
            to be applied to a Consumer user with the same user ID. This will
            converts a Consumer user to a Business user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockKycRiskLevel
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
        - schema:
            $ref: '#/components/schemas/BooleanString'
          in: query
          name: lockCraRiskLevel
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessUserEvent'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessWithRulesResult'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: false
  /batch/events/business/user:
    post:
      x-fern-sdk-group-name: batch
      x-fern-sdk-method-name: create_business_user_events
      security:
        - x-api-key: []
      summary: Batch create business user events
      operationId: post-batch-business-user-events
      parameters:
        - name: lockCraRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the CRA risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
        - name: lockKycRiskLevel
          in: query
          description: Boolean string whether Flagright should lock the KYC risk level for
            the user.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanString'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessUserEventBatchRequest'
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
  /events/business/user/{eventId}:
    get:
      x-fern-sdk-group-name: business_user_events
      x-fern-sdk-method-name: get
      security:
        - x-api-key: []
      summary: Retrieve a Business User Event
      description: >
        ### GET a Business User Event

        You can retrieve any business user event you created using the [POST Business User Events](/api-reference/api-reference/business-user-events/create) call.
      operationId: get-business-user-event
      parameters:
        - name: eventId
          in: path
          description: Unique Business User Event Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessUserEventWithRulesResult'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      deprecated: false
      tags: []
      x-internal: true
components:
  schemas:
    Address:
      title: Address
      required:
        - addressLines
      type: object
      properties:
        addressLines:
          type: array
          items:
            type: string
          description: Address lines of the user's residence address
        postcode:
          minLength: 1
          type: string
          description: Post code of the user's residence address
        city:
          minLength: 1
          type: string
          description: City of the user's residence address
        state:
          minLength: 1
          type: string
          description: State of the user's residence address
        country:
          minLength: 1
          type: string
          description: User's country of residence
        addressType:
          type: string
          description: Type of the address (ex - Residential, Postal, etc.)
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Additional information that can be added via tags
      description: Model for standardized address
      example:
        addressLines:
          - Klara-Franke Str 20
        postcode: '10557'
        city: Berlin
        state: Berlin
        country: Germany
        tags:
          - key: customKey
            value: customValue
    UserBase:
      title: UserBase
      type: object
      description: Model for User details
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        userDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - '+37112345432'
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          userDetails:
            name:
              firstName: Baran
              middleName: Realblood
              lastName: Ozkan
            dateOfBirth:
              day: 1
              month: 1
              year: 1990
            countryOfResidence: US
            countryOfNationality: DE
          legalDocuments:
            - documentType: passport
              documentNumber: Z9431P
              documentIssuedDate: 1639939034000
              documentExpirationDate: 1839939034000
              documentIssuedCountry: DE
              tags:
                - key: customerType
                  value: wallet
          contactDetails:
            emailIds:
              - baran@flagright.com
            contactNumbers:
              - '+37112345432'
            websites:
              - flagright.com
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
          tags:
            - key: customKey
              value: customValue
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
      required:
        - userId
        - createdTimestamp
    UserOptional:
      title: UserOptional
      type: object
      description: Model for User details
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        userDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - '+37112345432'
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
        metaData:
          batteryLevel: 76.3
          deviceLatitude: 13.009711
          deviceLongitude: 76.102898
          ipAddress: 79.144.2.20
          vpnUsed: true
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          userDetails:
            name:
              firstName: Baran
              middleName: Realblood
              lastName: Ozkan
            dateOfBirth:
              day: 1
              month: 1
              year: 1990
            countryOfResidence: US
            countryOfNationality: DE
          legalDocuments:
            - documentType: passport
              documentNumber: Z9431P
              documentIssuedDate: 1639939034000
              documentExpirationDate: 1839939034000
              documentIssuedCountry: DE
              tags:
                - key: customerType
                  value: wallet
          contactDetails:
            emailIds:
              - baran@flagright.com
            contactNumbers:
              - '+37112345432'
            websites:
              - flagright.com
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
          tags:
            - key: customKey
              value: customValue
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      properties:
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
    ProductsEnabled:
      title: ProductsEnabled
      type: object
      properties:
        productName:
          type: string
    ConsumerUserSegment:
      title: ConsumerUserSegment
      type: string
      enum:
        - RETAIL
        - PROFESSIONAL
    User:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
      required:
        - userId
        - createdTimestamp
    Person:
      title: Person
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the person
        generalDetails:
          $ref: '#/components/schemas/UserDetails'
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
      required:
        - generalDetails
      description: Model for a generic individual - different from User model by not
        having userId field
      example:
        generalDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - +371 123132
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
    LegalDocument:
      title: LegalDocument
      required:
        - documentType
        - documentNumber
        - documentIssuedCountry
      type: object
      properties:
        documentType:
          minLength: 1
          type: string
          description: User's identity document type such as passport, national ID etc.
        documentNumber:
          minLength: 1
          type: string
          description: User's unique identity document number such as passport number
        documentIssuedDate:
          type: number
          description: User's identity document issuance date (UNIX timestamp in
            milliseconds)
          maximum: 4133890801000
        documentExpirationDate:
          type: number
          description: User's identity document expiration date (UNIX timestamp in
            milliseconds)
          maximum: 4133890801000
        documentIssuedCountry:
          $ref: '#/components/schemas/CountryCode'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Additional information that can be added via tags
        nameOnDocument:
          $ref: '#/components/schemas/ConsumerName'
      description: "LegalDocument model generalizes User's identity document type (ex:
        Passport)"
      example:
        documentType: passport
        documentNumber: Z9431P
        documentIssuedDate: 1639939034000
        documentExpirationDate: 1839939034000
        documentIssuedCountry: DE
        tags:
          - key: customerType
            value: wallet
    Attachment:
      title: FileInfo
      type: object
      properties:
        s3Key:
          type: string
        bucket:
          type: string
        filename:
          type: string
        size:
          type: number
        downloadLink:
          type: string
        aiSummary:
          type: string
      required:
        - s3Key
        - filename
        - size
    PersonAttachment:
      title: PersonAttachment
      required:
        - files
        - userId
      type: object
      properties:
        id:
          type: string
        comment:
          type: string
          description: User's comment on the attached file.
        files:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        userId:
          type: string
        createdAt:
          type: number
        deletedAt:
          type: number
        tags:
          type: array
          items:
            type: string
      description: PersonAttachment model generalizes User's uploaded attachments
      example:
        comment: Arun's tax information
        files:
          filename: Tax Receipt FY 23-24
          s3Key: flagright/693c2df4-ec15-4bd6-8d0b-3237dfdb701ed
          size: 112419
    EmploymentDetails:
      title: EmploymentDetails
      type: object
      properties:
        employmentSector:
          type: string
          description: Sector of employment
        employerName:
          minLength: 1
          type: string
          description: Name of the employer
        businessIndustry:
          type: array
          description: The industry in which the business operates for a business customer
          items:
            type: string
      description: Details of User's employment
    UserTag:
      type: object
      properties:
        key:
          minLength: 1
          type: string
          description: Key value when you are creating a custom variable
        value:
          minLength: 1
          type: string
          description: Value for a given key when you are creating a custom variable
        isTimestamp:
          type: boolean
          description: Flag to indicate if the tag value is a timestamp
        isEditable:
          type: boolean
          description: Flag to indicate if the tag is editable over the console
      required:
        - key
        - value
    Tag:
      title: Tag
      required:
        - key
        - value
      type: object
      properties:
        key:
          minLength: 1
          type: string
          description: Key value when you are creating a custom variable
        value:
          minLength: 1
          type: string
          description: Value for a given key when you are creating a custom variable
        isTimestamp:
          type: boolean
          description: Flag to indicate if the tag value is a timestamp
      description: Generic key-value pair model to append a custom variable being sent
        to Flagright API
      example:
        key: customKey
        value: customValue
    EmailId:
      title: EmailId
      type: string
      description: 'Email ID format. Ex: baran@flagright.com'
    Transaction:
      type: object
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
      required:
        - type
        - transactionId
        - timestamp
    TransactionUpdatable:
      title: TransactionUpdatable
      type: object
      description: Model for transaction additional payload
      example:
        originAmountDetails:
          country: DE
          transactionAmount: 800
          transactionCurrency: EUR
        destinationAmountDetails:
          country: IN
          transactionAmount: 68351.34
          transactionCurrency: INR
        promotionCodeUsed: true
        timestamp: 1641654664000
        originPaymentDetails:
          method: CARD
          cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
          cardIssuedCountry: US
          transactionReferenceField: Deposit
          3dsDone: true
        destinationPaymentDetails:
          method: CARD
          cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
          cardIssuedCountry: IN
          transactionReferenceField: Deposit
          3dsDone: true
        reference: loan repayment
        originDeviceData:
          batteryLevel: 95
          deviceLatitude: 13.0033
          deviceLongitude: 76.1004
          ipAddress: 10.23.191.2
          deviceIdentifier: 3c49f915d04485e34caba
          vpnUsed: false
          operatingSystem: Android 11.2
          deviceMaker: ASUS
          deviceModel: Zenphone M2 Pro Max
          deviceYear: '2018'
          appVersion: 1.1.0
        destinationDeviceData:
          batteryLevel: 95
          deviceLatitude: 13.0033
          deviceLongitude: 76.1004
          ipAddress: 10.23.191.2
          deviceIdentifier: 3c49f915d04485e34caba
          vpnUsed: false
          operatingSystem: Android 11.2
          deviceMaker: ASUS
          deviceModel: Zenphone M2 Pro Max
          deviceYear: '2018'
          appVersion: 1.1.0
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          originAmountDetails:
            country: DE
            transactionAmount: 800
            transactionCurrency: EUR
          destinationAmountDetails:
            country: IN
            transactionAmount: 68351.34
            transactionCurrency: INR
          promotionCodeUsed: true
          timestamp: 1641654664
          originPaymentDetails:
            method: CARD
            cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
            cardIssuedCountry: US
            transactionReferenceField: Deposit
            3dsDone: true
          destinationPaymentDetails:
            method: CARD
            cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
            cardIssuedCountry: IN
            transactionReferenceField: Deposit
            3dsDone: true
          reference: loan repayment
          originDeviceData:
            batteryLevel: 95
            deviceLatitude: 13.0033
            deviceLongitude: 76.1004
            ipAddress: 10.23.191.2
            deviceIdentifier: 3c49f915d04485e34caba
            vpnUsed: false
            operatingSystem: Android 11.2
            deviceMaker: ASUS
            deviceModel: Zenphone M2 Pro Max
            deviceYear: '2018'
            appVersion: 1.1.0
          destinationDeviceData:
            batteryLevel: 95
            deviceLatitude: 13.0033
            deviceLongitude: 76.1004
            ipAddress: 10.23.191.2
            deviceIdentifier: 3c49f915d04485e34caba
            vpnUsed: false
            operatingSystem: Android 11.2
            deviceMaker: ASUS
            deviceModel: Zenphone M2 Pro Max
            deviceYear: '2018'
            appVersion: 1.1.0
          tags:
            - key: customKey
              value: customValue
      properties:
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
    TransactionBase:
      title: TransactionBase
      type: object
      description: Model for transaction base Payload
      example:
        transactionId: 7b80a539eea6e78acbd6d458e5971482
        type: DEPOSIT
        originUserId: 8650a2611d0771cba03310f74bf6
        destinationUserId: 9350a2611e0771cba03310f74bf6
        timestamp: 1262300400111
        transactionState: CREATED
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          type: DEPOSIT
          originUserId: 8650a2611d0771cba03310f74bf6
          destinationUserId: 9350a2611e0771cba03310f74bf6
          transactionState: CREATED
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
      required:
        - type
        - transactionId
        - timestamp
    TransactionMetadata:
      title: TransactionMetadata
      description: Additional metadata for transactions including risk analysis and
        counterparty information
      type: object
      properties:
        blockchainRisk:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainRisk'
          description: List of blockchain risk analyses from different providers
    BlockchainRisk:
      title: BlockchainRisk
      description: Blockchain-specific risk analysis from a provider including risk
        assessment and counterparty information
      type: object
      properties:
        provider:
          type: string
          description: Risk analysis provider (e.g., chainalysis)
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
          description: Overall risk level of the transaction
        riskScore:
          type: number
          minimum: 0
          maximum: 100
          description: Numeric risk score from 0 to 100
        counterparties:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainCounterparty'
          description: List of counterparties involved in the transaction
        subject:
          $ref: '#/components/schemas/BlockchainRiskSubject'
          description: Subject of the risk analysis (address, transaction, entity, or
            smart contract)
        risks:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainRiskDetail'
          description: Detailed risk categories and their analysis
    BlockchainCounterparty:
      title: BlockchainCounterparty
      description: Information about a counterparty in a blockchain transaction
      type: object
      properties:
        name:
          type: string
          description: Name of the counterparty (e.g., exchange name)
        categoryId:
          type: string
          description: Category identifier for the counterparty
    BlockchainRiskSubject:
      title: BlockchainRiskSubject
      description: Subject of the blockchain risk analysis
      type: object
      properties:
        type:
          $ref: '#/components/schemas/BlockchainRiskSubjectType'
          description: Type of the subject being analyzed
        value:
          type: string
          description: Single canonical value for the subject (e.g., address hash)
        direction:
          $ref: '#/components/schemas/BlockchainRiskSubjectDirection'
          description: Direction of the subject in the transaction (maps to
            origin/destination)
    BlockchainRiskDetail:
      title: BlockchainRiskDetail
      description: Detailed risk category analysis for a specific risk type
      type: object
      properties:
        alertId:
          type: string
          description: Optional alert identifier (alerts don't always exist)
        categoryId:
          type: string
          description: Unique identifier for the risk category
        categoryName:
          type: string
          description: Human-readable name of the risk category
        categoryRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
          description: Risk level specific to this category
        categoryRiskScore:
          type: number
          minimum: 0
          maximum: 100
          description: Numeric risk score for this specific category
        exposureType:
          $ref: '#/components/schemas/RiskExposureType'
          description: Type of exposure to the risk entity
        entity:
          type: string
          description: Name of the specific entity that poses the risk
        exposureAmount:
          $ref: '#/components/schemas/TransactionAmountDetails'
          description: Amount of the transaction exposed to this risk
    BlockchainRiskSubjectType:
      title: BlockchainRiskSubjectType
      type: string
      enum:
        - ADDRESS
        - TRANSACTION
        - SMART_CONTRACT
        - ENTITY
    BlockchainRiskSubjectDirection:
      title: BlockchainRiskSubjectDirection
      type: string
      enum:
        - ORIGIN
        - DESTINATION
    RiskExposureType:
      title: RiskExposureType
      type: string
      enum:
        - DIRECT
        - INDIRECT
    TransactionWithRulesResult:
      type: object
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - type
        - transactionId
        - timestamp
        - executedRules
        - hitRules
        - status
    TransactionEventWithRulesResult:
      type: object
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - transactionState
        - timestamp
        - transactionId
    DeviceData:
      title: DeviceData
      type: object
      properties:
        batteryLevel:
          type: number
          description: Battery level of the device used for a transaction or event at a
            given timestamp
        deviceLatitude:
          type: number
          description: Device latitude at a give timestamp for an event or transaction
        deviceLongitude:
          type: number
          description: Device longitude at a give timestamp for an event or transaction
        ipAddress:
          minLength: 1
          type: string
          description: IP address of the device at a given timestamp for an event or
            transaction
        ipCountry:
          $ref: '#/components/schemas/CountryCode'
        deviceIdentifier:
          minLength: 1
          type: string
          description: Device identifier number
        vpnUsed:
          type: boolean
          description: Whether VPN was used at a given timestamp for an event or transaction
        operatingSystem:
          minLength: 1
          type: string
          description: Operating system of the device at a given timestamp for an event or
            transaction
        deviceMaker:
          minLength: 1
          type: string
          description: The maker of the device at a given timestamp for an event or
            transaction
        deviceModel:
          minLength: 1
          type: string
          description: The model of the device at a given timestamp for an event or
            transaction
        deviceYear:
          minLength: 1
          type: string
          description: The year the device was manufactured at a given timestamp for an
            event or transaction
        appVersion:
          minLength: 1
          type: string
          description: The version of the app your user is using on their device at a
            given timestamp for an event or transaction
      description: Model for device data
    BatchTransactionMonitoringResults:
      type: object
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/BatchTransactionMonitoringResult'
        totalCount:
          type: number
      required:
        - transactions
        - totalCount
    BatchTransactionMonitoringResult:
      type: object
      properties:
        transactionId:
          type: string
          description: Transaction ID that the results pertain to
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        hitRules:
          type: array
          description: Uniquue transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - transactionId
        - status
        - hitRules
    TransactionMonitoringResult:
      type: object
      properties:
        transactionId:
          type: string
          description: Transaction ID that the results pertain to
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - transactionId
        - status
        - executedRules
        - hitRules
    BatchTransactionEventMonitoringResults:
      type: object
      title: BatchTransactionEventMonitoringResults
      properties:
        transactionEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchTransactionEventMonitoringResult'
        totalCount:
          type: number
      required:
        - transactionEvents
        - totalCount
    BatchTransactionEventMonitoringResult:
      type: object
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - transactionState
        - timestamp
        - transactionId
    TransactionEventMonitoringResult:
      type: object
      properties:
        eventId:
          type: string
        transaction:
          $ref: '#/components/schemas/Transaction'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - eventId
        - transaction
        - executedRules
        - hitRules
    RulesResults:
      title: RulesResults
      type: object
      example:
        transactionId: 7b80a539eea6e78acbd6d458e5971482
        executedRules:
          - ruleId: R-1a
            ruleName: Proof of funds for high value transactions
            ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
              for proof of funds
            ruleAction: BLOCK
            ruleHit: true
        hitRules:
          - ruleId: R-1a
            ruleName: Proof of funds for high value transactions
            ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
              for proof of funds
            ruleAction: BLOCK
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          executedRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
              ruleHit: true
          hitRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
      properties:
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - executedRules
        - hitRules
    HitRulesResults:
      title: HitRulesResults
      type: object
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          hitRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
      properties:
        hitRules:
          type: array
          description: Uniquue transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - hitRules
    TransactionRiskScoringResult:
      title: TransactionRiskScoringResult
      type: object
      properties:
        trsScore:
          type: number
          description: Transaction risk scoring score
        trsRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        originUserCraRiskScore:
          type: number
          description: Origin user's CRA risk score
        destinationUserCraRiskScore:
          type: number
          description: Destination user's CRA risk score
        originUserCraRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        destinationUserCraRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - trsScore
        - trsRiskLevel
    ExecutedLogicVars:
      title: ExecutedLogicVars
      type: object
      properties:
        direction:
          $ref: '#/components/schemas/RuleHitDirection'
        value:
          type: object
      required:
        - value
    RuleExecutionSanctionsDetails:
      type: object
      properties:
        name:
          type: string
        searchId:
          type: string
        iban:
          type: string
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        sanctionHitIds:
          type: array
          items:
            type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        hitDirection:
          $ref: '#/components/schemas/RuleHitDirection'
        isRuleHit:
          type: boolean
      required:
        - name
        - searchId
    ExecutedRulesResult:
      title: ExecutedRulesResult
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        ruleAction: BLOCK
        ruleHit: true
      description: Model for list of executed rules
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleInstanceId:
          type: string
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        ruleAction:
          $ref: '#/components/schemas/RuleAction'
        ruleHit:
          type: boolean
        executedAt:
          type: number
          description: Timestamp when the rule was executed
          minimum: 315529200000
          maximum: 4133890801000
        ruleHitMeta:
          $ref: '#/components/schemas/RuleHitMeta'
        vars:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedLogicVars'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        nature:
          $ref: '#/components/schemas/RuleNature'
        isShadow:
          type: boolean
        sanctionsDetails:
          type: array
          items:
            $ref: '#/components/schemas/RuleExecutionSanctionsDetails'
          x-fern-ignore: true
      required:
        - ruleInstanceId
        - ruleName
        - ruleDescription
        - ruleAction
        - ruleHit
    HitRulesDetails:
      title: HitRulesDetails
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        ruleAction: BLOCK
        ruleHit: true
        nature: FRAUD
      description: Model for list of hit rules
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleInstanceId:
          type: string
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        executedAt:
          type: number
          description: Timestamp when the rule was hit
          minimum: 315529200000
          maximum: 4133890801000
        ruleAction:
          $ref: '#/components/schemas/RuleAction'
        ruleHitMeta:
          $ref: '#/components/schemas/RuleHitMeta'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        nature:
          $ref: '#/components/schemas/RuleNature'
        isShadow:
          type: boolean
      required:
        - ruleInstanceId
        - ruleName
        - ruleDescription
        - ruleAction
    FailedRulesResult:
      title: FailedRulesResult
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        failureException:
          exceptionName: MISSING_DATA
          exceptionDescription: Some data is missing
      description: Model for list of rules failed execution. It means rules could not be run
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        failureException:
          $ref: '#/components/schemas/RuleFailureException'
      required:
        - ruleId
        - ruleName
        - ruleDescription
        - failureException
    RuleFailureException:
      title: RuleFailureException
      required:
        - exceptionName
        - exceptionDescription
      type: object
      properties:
        exceptionName:
          minLength: 1
          type: string
          description: Unique rule identifier
        exceptionDescription:
          minLength: 1
          type: string
          description: Name of the rule
      example:
        exceptionName: MISSING_DATA
        exceptionDescription: Some data is missing
    ConsumerName:
      title: ConsumerName
      required:
        - firstName
      type: object
      properties:
        firstName:
          minLength: 1
          type: string
          description: First name of the user
        middleName:
          minLength: 1
          type: string
          description: Middle name of the user
        lastName:
          minLength: 1
          type: string
          description: Last name of the user
      description: Model for a generic consumer name
      example:
        firstName: Baran
        middleName: Realblood
        lastName: Ozkan
    TransactionAmountDetails:
      title: TransactionAmountDetails
      type: object
      example:
        country: DE
        transactionAmount: 800
        transactionCurrency: EUR
      description: Model for transaction amount details
      properties:
        transactionAmount:
          type: number
          description: Amount of the transaction
        transactionCurrency:
          $ref: '#/components/schemas/CurrencyCode'
        country:
          $ref: '#/components/schemas/CountryCode'
      required:
        - transactionAmount
        - transactionCurrency
    Amount:
      title: Amount
      type: object
      example:
        amountValue: 800
        amountCurrency: GBP
      description: Model for amount
      properties:
        amountValue:
          type: number
          description: Numerical value of the transaction
        amountCurrency:
          $ref: '#/components/schemas/CurrencyCode'
      required:
        - amountValue
        - amountCurrency
    OriginFundsInfo:
      title: OriginFundsInfo
      type: object
      description: Model for origin funds information
      properties:
        sourceOfFunds:
          type: string
          description: Source of funds for the transaction
        sourceOfWealth:
          type: string
          description: Source of wealth
    LegalEntity:
      title: LegalEntity
      type: object
      description: Model for business user legal entity details
      properties:
        companyGeneralDetails:
          $ref: '#/components/schemas/CompanyGeneralDetails'
        companyFinancialDetails:
          $ref: '#/components/schemas/CompanyFinancialDetails'
        companyRegistrationDetails:
          $ref: '#/components/schemas/CompanyRegistrationDetails'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
      required:
        - companyGeneralDetails
    CorporateEntityDetails:
      title: CorporateEntityDetails
      type: object
      description: Model for corporate entity details
      properties:
        legalName:
          minLength: 1
          type: string
          description: Legal name of the corporate entity
      required:
        - legalName
    SourceOfFunds:
      title: SourceOfFunds
      type: string
      enum:
        - Earnings
        - Savings
        - Investments/Deposits
        - Wealth
        - Gift
        - Pension
        - Inheritance
        - Gambling
        - Benefits
        - Passive
        - Family
        - Insurance
        - Legal
        - Sales
        - Rollover
        - Equity
        - Crypto
        - Business
        - Employment
        - Salary
        - Real Estate Sale
        - Real Estate Rental
        - Company Exit
    ContactDetails:
      title: ContactDetails
      type: object
      description: Model for business user contact information details
      properties:
        emailIds:
          type: array
          description: Email addresses of the contacts for a given business customer
          items:
            type: string
        contactNumbers:
          type: array
          description: Phone numbers to contact a given business customer
          items:
            type: string
        faxNumbers:
          type: array
          description: Fax numbers to contact a business customer
          items:
            type: string
        websites:
          type: array
          description: Website of the company
          items:
            type: string
        addresses:
          type: array
          description: Address(es) of the company
          items:
            $ref: '#/components/schemas/Address'
        name:
          $ref: '#/components/schemas/ConsumerName'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    CompanyFinancialDetails:
      title: CompanyFinancialDetails
      type: object
      example:
        expectedTransactionAmountPerMonth:
          amountValue: 800
          amountCurrency: GBP
        expectedTurnoverPerMonth:
          amountValue: 8000
          amountCurrency: USD
      description: Model for business user company financial details
      properties:
        expectedTransactionAmountPerMonth:
          $ref: '#/components/schemas/Amount'
        expectedTurnoverPerMonth:
          $ref: '#/components/schemas/Amount'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    UserDetails:
      title: UserDetails
      type: object
      example:
        name:
          firstName: Baran
          middleName: Realblood
          lastName: Ozkan
        dateOfBirth: 1991-01-01
        countryOfResidence: US
        countryOfNationality: DE
      description: Model for consumer user personal details
      properties:
        name:
          $ref: '#/components/schemas/ConsumerName'
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the user (YYYY-MM-DD)
        userCategory:
          type: string
          description: Internal category of the user
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        countryOfTaxResidence:
          $ref: '#/components/schemas/CountryCode'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        gender:
          $ref: '#/components/schemas/Gender'
        maritalStatus:
          $ref: '#/components/schemas/MaritalStatus'
        placeOfBirth:
          $ref: '#/components/schemas/PlaceOfBirth'
        alias:
          type: array
          items:
            type: string
          description: Alias names of the user
    UserRegistrationStatus:
      title: UserRegistrationStatus
      type: string
      enum:
        - REGISTERED
        - UNREGISTERED
    BusinessUserSegment:
      title: BusinessUserSegment
      type: string
      enum:
        - SOLE_PROPRIETORSHIP
        - LIMITED
        - SMB
        - SMALL
        - MEDIUM
        - LARGE
        - UNKNOWN
    CompanyGeneralDetails:
      title: CompanyGeneralDetails
      type: object
      example:
        legalName: Ozkan Hazelnut Export JSC
        businessIndustry:
          - Farming
        mainProductsServicesSold:
          - Hazelnut
      description: Model for business user company general details
      properties:
        legalName:
          minLength: 1
          type: string
          description: Legal name of the company
        businessIndustry:
          type: array
          description: The industry in which the business operates for a business customer
          items:
            type: string
        mainProductsServicesSold:
          type: array
          description: The key products and services provided by the company
          items:
            type: string
        userSegment:
          $ref: '#/components/schemas/BusinessUserSegment'
          description: Segmentation of the business user
        userRegistrationStatus:
          $ref: '#/components/schemas/UserRegistrationStatus'
        operatingCountries:
          type: array
          description: Countries where the business operates
          items:
            $ref: '#/components/schemas/CountryCode'
        alias:
          type: array
          items:
            type: string
          description: Alias names of the business entity
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    CompanyRegistrationDetails:
      title: CompanyRegistrationDetails
      type: object
      example:
        registrationIdentifier: PSJ554342
        registrationCountry: DE
      description: Model for business user company registration details
      properties:
        registrationIdentifier:
          minLength: 1
          type: string
          description: Commercial registry registration number for the company in its
            registration country
        registrationCountry:
          $ref: '#/components/schemas/CountryCode'
        taxResidenceCountry:
          $ref: '#/components/schemas/CountryCode'
        taxIdentifier:
          type: string
          description: Tax ID number of the registered entity
        legalEntityType:
          type: string
          description: Type of legal entity, e.g., Limited Liability
        dateOfRegistration:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    Business:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BusinessBase:
      title: BusinessBase
      type: object
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        legalEntity:
          companyGeneralDetails:
            legalName: Ozkan Hazelnut Export JSC
            businessIndustry:
              - Farming
            mainProductsServicesSold:
              - Hazelnut
          companyFinancialDetails:
            expectedTransactionAmountPerMonth:
              amountValue: 800
              amountCurrency: GBP
            expectedTurnoverPerMonth:
              amountValue: 8000
              amountCurrency: USD
          companyRegistrationDetails:
            registrationIdentifier: PSJ554342
            registrationCountry: DE
          reasonForAccountOpening:
            - string
          contactDetails:
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
        shareHolders:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        directors:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          legalEntity:
            companyGeneralDetails:
              legalName: Ozkan Hazelnut Export JSC
              businessIndustry:
                - Farming
              mainProductsServicesSold:
                - Hazelnut
            companyFinancialDetails:
              expectedTransactionAmountPerMonth:
                amountValue: 800
                amountCurrency: GBP
              expectedTurnoverPerMonth:
                amountValue: 8000
                amountCurrency: USD
            companyRegistrationDetails:
              registrationIdentifier: PSJ554342
              registrationCountry: DE
            reasonForAccountOpening:
              - string
            contactDetails:
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
          shareHolders:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          directors:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          tags:
            - key: customKey
              value: customValue
      description: Model for a business user base fields
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BusinessOptional:
      title: BusinessOptional
      type: object
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        legalEntity:
          companyGeneralDetails:
            legalName: Ozkan Hazelnut Export JSC
            businessIndustry:
              - Farming
            mainProductsServicesSold:
              - Hazelnut
          companyFinancialDetails:
            expectedTransactionAmountPerMonth:
              amountValue: 800
              amountCurrency: GBP
            expectedTurnoverPerMonth:
              amountValue: 8000
              amountCurrency: USD
          companyRegistrationDetails:
            registrationIdentifier: PSJ554342
            registrationCountry: DE
          reasonForAccountOpening:
            - string
          contactDetails:
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
        shareHolders:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        directors:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        tags:
          - key: customKey
            value: customValue
        metaData:
          batteryLevel: 76.3
          deviceLatitude: 13.009711
          deviceLongitude: 76.102898
          ipAddress: 79.144.2.20
          vpnUsed: true
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          legalEntity:
            companyGeneralDetails:
              legalName: Ozkan Hazelnut Export JSC
              businessIndustry:
                - Farming
              mainProductsServicesSold:
                - Hazelnut
            companyFinancialDetails:
              expectedTransactionAmountPerMonth:
                amountValue: 800
                amountCurrency: GBP
              expectedTurnoverPerMonth:
                amountValue: 8000
                amountCurrency: USD
            companyRegistrationDetails:
              registrationIdentifier: PSJ554342
              registrationCountry: DE
            reasonForAccountOpening:
              - string
            contactDetails:
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
          shareHolders:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          directors:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          tags:
            - key: customKey
              value: customValue
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      description: Model for a business user - optional fields
      properties:
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
    BusinessUserMonitoringResult:
      title: BusinessUserMonitoringResult
      type: object
      description: Model for business user risk score response
      x-examples:
        example-1:
          userId: string
          riskScoreDetails:
            kycRiskScore: 27.5
            craRiskScore: 23.92
            kycRiskLevel: LOW
            craRiskLevel: LOW
      properties:
        userId:
          minLength: 1
          type: string
          description: user ID the risk score pertains to
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
      required:
        - userId
    ConsumerUserMonitoringResult:
      title: ConsumerUserMonitoringResult
      type: object
      x-examples:
        example-1:
          userId: string
          riskScoreDetails:
            kycRiskScore: 27.5
            craRiskScore: 23.92
            kycRiskLevel: LOW
            craRiskLevel: LOW
      description: Model for consumer user risk score response
      properties:
        userId:
          minLength: 1
          type: string
          description: user ID the risk score pertains to
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
      required:
        - userId
    CardStatus:
      title: CardStatus
      type: string
      description: Status of the card
      enum:
        - ACTIVE
        - FROZEN
        - BLOCKED
        - SUSPECTED_FRAUD
        - STOLEN
        - LOST
        - CLOSED
        - OTHER
    CardDetails:
      title: CardDetails
      type: object
      description: Model for credit or debit card details
      example:
        method: CARD
        cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
        cardIssuedCountry: TR
        transactionReferenceField: Deposit
        3dsDone: true
      properties:
        method:
          $ref: '#/components/schemas/CardPaymentMethod'
        cardFingerprint:
          minLength: 1
          type: string
          description: Unique card fingerprint that helps identify a specific card without
            having to use explicit card number. This is likely available at your
            card payment scheme provider
        emailId:
          $ref: '#/components/schemas/EmailId'
        cardStatus:
          $ref: '#/components/schemas/CardStatus'
        cardIssuedCountry:
          $ref: '#/components/schemas/CountryCode'
        transactionReferenceField:
          minLength: 1
          type: string
          description: Reference for the transaction
        3dsDone:
          type: boolean
          description: Whether 3ds was successfully enforced for the transaction
        nameOnCard:
          $ref: '#/components/schemas/ConsumerName'
        cardExpiry:
          $ref: '#/components/schemas/CardExpiry'
        posDetails:
          $ref: '#/components/schemas/POSDetails'
        cardLast4Digits:
          type: string
          minLength: 4
          maxLength: 4
          description: Last 4 digits of Card
        cardBrand:
          $ref: '#/components/schemas/CardBrand'
        cardFunding:
          $ref: '#/components/schemas/CardFunding'
        cardAuthenticated:
          type: boolean
          description: Authentication of Card
        cardTokenized:
          type: boolean
          description: Was the card tokenized
        cardPresent:
          type: boolean
          description: Card Present
        paymentChannel:
          type: string
        cardType:
          $ref: '#/components/schemas/CardType'
        cardBalance:
          $ref: '#/components/schemas/Amount'
        merchantDetails:
          $ref: '#/components/schemas/CardMerchantDetails'
        networkProviderRiskScore:
          type: number
          description: Risk score of the card from your network provider
        address:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    NPPDetails:
      title: NPPDetails
      type: object
      description: New Payment Platform Details for Australia
      properties:
        method:
          $ref: '#/components/schemas/NPPPaymentMethod'
        accountNumber:
          type: string
          description: Account number
        name:
          $ref: '#/components/schemas/ConsumerName'
        emailId:
          $ref: '#/components/schemas/EmailId'
        contactNumber:
          type: string
          description: Contact number
        bsb:
          type: string
          description: BSB number
        payId:
          type: string
          description: PayID
        endToEndId:
          type: string
          description: End to End ID
        oskoReference:
          type: string
          description: OSKO reference
        payIdReference:
          type: string
          description: PayID reference
        isInstant:
          type: boolean
          description: Whether the payment is instant
        remittanceInformation:
          type: string
          description: Remittance information
        remittanceAdvice:
          type: string
          description: Remittance advice
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        processingDate:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        settlementDate:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        referenceNumber:
          type: string
          description: Unique reference number for transaction reconciliation
        traceNumber:
          type: string
          description: Trace number for tracking the payment through the NPP system
        messageFormat:
          type: string
          description: Format of the NPP message (e.g., JSON, XML)
        bankName:
          type: string
          description: Name of the bank associated with the account
        address:
          $ref: '#/components/schemas/Address'
      required:
        - method
    IBANDetails:
      title: IBANDetails
      type: object
      description: Standardized model for Bank Details
      example:
        method: IBAN
        BIC: DE761234561
        bankName: Merryl Lynch
        IBAN: '1234321'
        bankAddress:
          addressLines:
            - Klara-Franke Str 20
          postcode: '10557'
          city: Berlin
          state: Berlin
          country: Germany
          tags:
            - key: customKey
              value: customValue
      x-examples:
        example-1:
          method: IBAN
          bankIdentifierType: IBAN
          bankIdentifier: DE761234561
          bankName: Merryl Lynch
          accountNumber: '1234321'
          bankAddress:
            addressLines:
              - Klara-Franke Str 20
            postcode: '10557'
            city: Berlin
            state: Berlin
            country: Germany
            tags:
              - key: customKey
                value: customValue
      properties:
        method:
          $ref: '#/components/schemas/IBANPaymentMethod'
        BIC:
          minLength: 1
          type: string
          description: Identifier for the bank. Can be routing number, BIK number, SWIFT
            code, BIC number etc.
        bankName:
          minLength: 1
          type: string
          description: Name of the bank
        bankAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        country:
          $ref: '#/components/schemas/CountryCode'
        IBAN:
          type: string
          description: Account number of the user. Can be account number, IBAN number etc.
        accountBalance:
          $ref: '#/components/schemas/Amount'
        name:
          type: string
          description: Name of the bank account holder
        emailId:
          $ref: '#/components/schemas/EmailId'
        bankBranchCode:
          type: string
          description: Branch code of the bank. In some countries, this can be the same as
            the bank's SWIFT code
        paymentChannel:
          type: string
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    WalletDetails:
      title: WalletDetails
      type: object
      description: Standardized model for a Generic wallet transaction
      x-examples: {}
      properties:
        method:
          $ref: '#/components/schemas/WalletPaymentMethod'
        walletType:
          type: string
          description: Wallet type if there are various types of wallets belonging to the
            same user. E.g. Checking, savings, vault, different currency wallets
            etc.
        walletId:
          minLength: 1
          type: string
          description: Unique ID of the wallet
        paymentChannel:
          type: string
          description: Payment Channel used through wallet
        name:
          type: string
          description: Name of the account holder for a specific wallet
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        walletPhoneNumber:
          type: string
          description: Phone number associated with the wallet, if any
        walletBalance:
          $ref: '#/components/schemas/Amount'
        network:
          $ref: '#/components/schemas/WalletNetwork'
        address:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        authorizedRepresentative:
          type: array
          items:
            $ref: '#/components/schemas/UserDetails'
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the account holder (YYYY-MM-DD)
        transactionHash:
          type: string
          description: A hash is a cryptographic fingerprint that uniquely identifies a
            blockchain transaction on the network, whereas a transactionId is
            just an internal reference used by a wallet or platform to track the
            transaction in its own system.
      required:
        - method
    WalletNetwork:
      type: string
      description: Network of the wallet
      enum:
        - BITCOIN
        - ETHEREUM
        - POLYGON
        - BNB_SMART_CHAIN
        - BNB_BEACON_CHAIN
        - ARBITRUM_L2
        - SOLANA
        - AVALANCHE_C_CHAIN
        - TEZOS
        - VICTION
        - LITECOIN
        - BITCOIN_CASH
        - RIPPLE
        - STELLAR
        - EOS_PUBLIC
        - TRON
        - CARDANO
        - POLKADOT
        - NEAR_PROTOCOL
        - COSMOS
        - DOGECOIN
        - OPTIMISM_MAINNET
        - FANTOM
        - HEDERA
        - ALGORAND
        - CELESTIA
    ACHDetails:
      description: Model for ACH payment method
      type: object
      x-examples:
        example-2:
          method: ACH
          routingNumber: '1231241'
          accountNumber: '543456675'
          bankName: Wells Fargo
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          bankAddress:
            addressLines:
              - 1201 N Monroe St
            postcode: '32303'
            city: Tallahassee
            state: FL
            country: United States of America
            tags:
              - key: userType
                value: customValue
      title: ACHDetails
      properties:
        method:
          $ref: '#/components/schemas/ACHPaymentMethod'
        routingNumber:
          type: string
          minLength: 1
          description: Routing number of the bank
        accountNumber:
          type: string
          minLength: 1
          description: Bank account number of the individual
        accountBalance:
          $ref: '#/components/schemas/Amount'
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        name:
          type: string
          description: Name of the account holder
        bankAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        beneficiaryName:
          type: string
          description: Beneficiary name of the account
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    CorrespondentBankDetails:
      description: Model for Correspondent bank details
      type: object
      x-examples: {}
      title: CorrespondentBankDetails
      properties:
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    SWIFTDetails:
      description: Model for SWIFT payment method
      type: object
      x-examples: {}
      title: SWIFTDetails
      properties:
        method:
          $ref: '#/components/schemas/SWIFTPaymentMethod'
        swiftCode:
          type: string
          minLength: 1
          description: SWIFT code of the financial institution
        accountNumber:
          type: string
          minLength: 1
          description: Account number
        routingNumber:
          type: string
          description: Routing number of the bank
        accountBalance:
          $ref: '#/components/schemas/Amount'
        accountType:
          type: string
          description: Account type. E.g. Checking, Savings etc.
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        name:
          type: string
          description: Name of the account holder
        bankAddress:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        emailId:
          $ref: '#/components/schemas/EmailId'
        specialInstructions:
          type: string
          description: Special instructions if any
        address:
          $ref: '#/components/schemas/Address'
        correspondentBankDetails:
          type: array
          items:
            $ref: '#/components/schemas/CorrespondentBankDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    MpesaDetails:
      description: Model for Mpesa payment method
      type: object
      x-examples: {}
      title: MpesaDetails
      properties:
        method:
          $ref: '#/components/schemas/MpesaPaymentMethod'
        businessShortCode:
          type: string
          minLength: 1
          description: Business code
        transactionType:
          $ref: '#/components/schemas/MpesaTransactionType'
        phoneNumber:
          type: string
          description: Contact Number of the account holder
        emailId:
          $ref: '#/components/schemas/EmailId'
        name:
          type: string
          description: Name of the account holder
        address:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
        - businessShortCode
        - transactionType
        - phoneNumber
    GenericBankAccountDetails:
      description: Model for any generic bank account
      type: object
      x-examples: {}
      title: GenericBankAccountDetails
      properties:
        method:
          $ref: '#/components/schemas/GeneralBankAccountPaymentMethod'
        accountNumber:
          type: string
          minLength: 1
          description: Bank account number
        accountType:
          type: string
          description: Bank account type. E.g. Checking, Savings etc.
        accountBalance:
          $ref: '#/components/schemas/Amount'
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        bankCode:
          type: string
          description: Unique identifier of the bank. In some countries, this can be the
            same as the bank's SWIFT code
        country:
          $ref: '#/components/schemas/CountryCode'
        name:
          type: string
          description: Name of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
          description: Country of nationality of the account holder
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
          description: Country of residence of the account holder
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the account holder (YYYY-MM-DD)
        bankAddress:
          $ref: '#/components/schemas/Address'
        emailId:
          $ref: '#/components/schemas/EmailId'
        specialInstructions:
          type: string
          description: Special instructions to be specified if any
        paymentChannel:
          type: string
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        transitNumber:
          type: string
          description: Transit number of the bank account
        address:
          $ref: '#/components/schemas/Address'
        routingNumber:
          type: string
          description: Routing number of the bank
      required:
        - method
    UPIDetails:
      description: Model for UPI payment method
      type: object
      x-examples:
        example-1:
          method: UPI
          upiID: user@okhdfcbank
          bankProvider: HDFC Bank
          interfaceProvider: PhonePe
      title: UPIDetails
      properties:
        method:
          $ref: '#/components/schemas/UPIPaymentMethod'
        upiID:
          type: string
          minLength: 1
          description: UPI Id number
        bankProvider:
          type: string
          minLength: 1
          description: Bank provider name
        interfaceProvider:
          type: string
          minLength: 1
          description: Interface provider name
        name:
          type: string
          description: Name of the account holder
        address:
          $ref: '#/components/schemas/Address'
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
        - upiID
    TransactionLimits:
      title: TransactionLimits
      type: object
      x-examples:
        example-1:
          maximumDailyTransactionLimit:
            amountValue: 800
            amountCurrency: EUR
          maximumWeeklyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          maximumMonthlyTransactionLimit:
            amountValue: 800
            amountCurrency: EUR
          maximumQuarterlyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          maximumYearlyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          paymentMethodLimits:
            CARD:
              transactionCountLimit:
                day: 100
                month: 100
              transactionAmountLimit:
                day:
                  amountValue: 100
                  amountCurrency: GBP
                month:
                  amountValue: 1000
                  amountCurrency: GBP
              averageTransactionAmountLimit:
                day:
                  amountValue: 100
                  amountCurrency: GBP
                month:
                  amountValue: 1000
                  amountCurrency: GBP
            IBAN:
              transactionCountLimit:
                day: 50
                month: 500
              transactionAmountLimit:
                day:
                  amountValue: 500
                  amountCurrency: EUR
                month:
                  amountValue: 5000
                  amountCurrency: EUR
              averageTransactionAmountLimit:
                day:
                  amountValue: 500
                  amountCurrency: EUR
                month:
                  amountValue: 5000
                  amountCurrency: EUR
      description: Model for transaction limits for a given user
      properties:
        maximumDailyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumWeeklyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumMonthlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumQuarterlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumYearlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        paymentMethodLimits:
          type: object
          properties:
            ACH:
              $ref: '#/components/schemas/TransactionLimit'
            CARD:
              $ref: '#/components/schemas/TransactionLimit'
            IBAN:
              $ref: '#/components/schemas/TransactionLimit'
            UPI:
              $ref: '#/components/schemas/TransactionLimit'
            GENERIC_BANK_ACCOUNT:
              $ref: '#/components/schemas/TransactionLimit'
            MPESA:
              $ref: '#/components/schemas/TransactionLimit'
            SWIFT:
              $ref: '#/components/schemas/TransactionLimit'
            WALLET:
              $ref: '#/components/schemas/TransactionLimit'
            CHECK:
              $ref: '#/components/schemas/TransactionLimit'
            CASH:
              $ref: '#/components/schemas/TransactionLimit'
            NPP:
              $ref: '#/components/schemas/TransactionLimit'
    ExpectedIncome:
      title: ExpectedIncome
      type: object
      description: Model for expected income details
      properties:
        dailyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        weeklyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        monthlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        quarterlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        yearlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
    RuleAction:
      type: string
      title: RuleAction
      enum:
        - ALLOW
        - FLAG
        - BLOCK
        - SUSPEND
      x-examples:
        example-1: ALLOW
      description: Model for rule action if a rule is hit. This is returned in the API
        response and can be configured on Console by operational accounts like a
        Compliance Analyst
    RuleHitMeta:
      type: object
      description: Details of rule execution, for internal purposes only
      properties:
        hitDirections:
          type: array
          items:
            $ref: '#/components/schemas/RuleHitDirection'
        falsePositiveDetails:
          $ref: '#/components/schemas/FalsePositiveDetails'
        sanctionsDetails:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsDetails'
        isOngoingScreeningHit:
          type: boolean
    RuleHitDirection:
      type: string
      title: RuleHitDirection
      enum:
        - ORIGIN
        - DESTINATION
    RuleNature:
      type: string
      title: Rule nature type
      enum:
        - AML
        - FRAUD
        - CTF
        - SCREENING
    RuleLabels:
      type: string
      title: RuleLabels
      enum:
        - UNEXPECTED_BEHAVIOR
        - ILLICIT_GAINS_CHECK
        - RFI_TRIGGER
        - EDD_TRIGGER
        - KYC_TRIGGER
        - SCAM
        - ABUSE
        - ACCOUNT_TAKEOVER
        - DISPUTE
        - SANCTIONS
        - SANCTIONS_PEP
        - SANCTIONS_PEP_ADVERSE_MEDIA
        - SANCTIONS_MANUAL_REVIEW
    TransactionEvent:
      description: Model for transaction-related events
      type: object
      x-examples:
        example-1:
          transactionState: CREATED
          timestamp: 1262300441294
          transactionId: 443dea26147a406b957d9ee3a1247b11
          eventId: aaeeb166147a406b957dd9147a406b957
          eventDescription: Transaction created
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      additionalProperties: false
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - transactionState
        - timestamp
        - transactionId
    BatchConsumerUsersWithRulesResults:
      title: BatchConsumerUsersWithRulesResult
      type: object
      properties:
        consumerUsers:
          type: array
          items:
            $ref: '#/components/schemas/BatchConsumerUserWithRulesResult'
        totalCount:
          type: number
      required:
        - consumerUsers
        - totalCount
    BatchBusinessUsersWithRulesResults:
      type: object
      properties:
        businessUsers:
          type: array
          items:
            $ref: '#/components/schemas/BatchBusinessUserWithRulesResult'
        totalCount:
          type: number
      required:
        - businessUsers
        - totalCount
    BatchConsumerUserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
    BatchBusinessUserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BatchConsumerUserEventsWithRulesResult:
      title: BatchConsumerUserEventsRulesResult
      type: object
      properties:
        consumerUserEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchConsumerUserEventWithRulesResult'
        totalCount:
          type: number
      required:
        - consumerUserEvents
        - totalCount
    BatchBusinessUserEventsWithRulesResult:
      title: BatchBusinessUserEventsWithRulesResult
      type: object
      properties:
        businessUserEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchBusinessUserEventWithRulesResult'
        totalCount:
          type: number
      required:
        - businessUserEvents
        - totalCount
    BatchUserRulesResult:
      title: BatchUserRulesResult
      type: object
      properties:
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
    BatchConsumerUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    BatchBusinessUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    UserRulesResult:
      title: UserRulesResult
      type: object
      properties:
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
    ConsumerUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    BusinessUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    ConsumerUserEvent:
      description: Model for consumer user-related events
      type: object
      x-examples:
        example-1:
          timestamp: 315529200000
          userId: string
          userStateDetails:
            reason: string
            state: UNACCEPTABLE
          eventId: string
          reason: string
          eventDescription: string
          updatedConsumerUserAttributes:
            createdTimestamp: 1641654664000
            userId: 96647cfd9e8fe66ee0f3362e011e34e8
            userDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - '+37112345432'
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
      title: ConsumerUserEvent
      additionalProperties: false
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - timestamp
        - userId
    BusinessUserEvent:
      description: Model for business user-related events
      type: object
      x-examples:
        example-1:
          timestamp: 315529200000
          userId: string
          userStateDetails:
            reason: string
            state: UNACCEPTABLE
          eventId: string
          reason: string
          eventDescription: string
          updatedConsumerUserAttributes:
            createdTimestamp: 1641654664000
            userId: 96647cfd9e8fe66ee0f3362e011e34e8
            userDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - '+37112345432'
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
      title: BusinessUserEvent
      additionalProperties: false
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - timestamp
        - userId
    CaseManagementEvent:
      type: object
      x-examples:
        example-1:
          caseStatus: Unsuspended
          timestamp: 1262300441294
          transactionId: 443dea26147a406b957d9ee3a1247b11
          eventId: aaeeb166147a406b957dd9147a406b957
          eventDescription: Case Unsuspended
      title: CaseManagementEvent
      description: Model for case management events
      properties:
        caseStatus:
          type: string
          minLength: 1
          enum:
            - CLOSED
            - HIT
          description: Status of a case. E.g. Open, Closed etc.
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        caseStatusReason:
          type: string
          enum:
            - FALSE_POSITIVE
            - INVESTIGATION_COMPLETED
            - DOCUMENTS_COLLECTED
            - OTHER
          description: Case status reason. E.g. Closed & False Positive, Closed &
            Investigation Completed etc.
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the case pertains to
        userId:
          type: string
          description: User ID the case pertains to
        eventId:
          type: string
          description: Event ID the case pertains to
        caseStatusReasonDescription:
          type: string
          description: Case status reason description
      required:
        - caseStatus
        - timestamp
        - caseStatusReason
      additionalProperties: false
    Date:
      title: Date
      type: object
      description: Model for date
      properties:
        day:
          type: number
          description: Day of date
        month:
          type: number
          description: Month of date
        year:
          type: number
          description: Year of date
      required:
        - day
        - month
        - year
    TransactionState:
      type: string
      title: TransactionState
      enum:
        - CREATED
        - PROCESSING
        - SENT
        - EXPIRED
        - DECLINED
        - SUSPENDED
        - REFUNDED
        - SUCCESSFUL
        - REVERSED
      minLength: 1
      description: Model for transaction states. E.g. Processing, Refunded, Successful etc.
    AcquisitionChannel:
      type: string
      title: AcquisitionChannel
      minLength: 1
      description: Model for User acquisition channel
      enum:
        - ORGANIC
        - PAID
        - REFERRAL
        - OFFLINE
        - GATHERING
        - UNKNOWN
    UPIPaymentMethod:
      type: string
      title: UPIPaymentMethod
      enum:
        - UPI
      description: Classify the method of payment as "UPI" for UPIDetails
    IBANPaymentMethod:
      type: string
      title: IBANPaymentMethod
      enum:
        - IBAN
      description: |
        Classify the method of payment as "IBAN" for IBANDetails
    CardPaymentMethod:
      type: string
      title: CardPaymentMethod
      enum:
        - CARD
      description: |
        Classify the method of payment as "Card" for CardDetails
    NPPPaymentMethod:
      type: string
      title: NPPPaymentMethod
      enum:
        - NPP
      description: Classify the method of payment as "NPP" for NPPDetails (New Payment
        Platform Details for Australia)
    WalletPaymentMethod:
      type: string
      title: WalletPaymentMethod
      enum:
        - WALLET
      description: Classify the method of payment as "Wallet" for WalletDetails
    ACHPaymentMethod:
      type: string
      title: ACHPaymentMethod
      enum:
        - ACH
      description: Classify the method of payment as "ACH" for ACHDetails
    SWIFTPaymentMethod:
      type: string
      title: SWIFTPaymentMethod
      enum:
        - SWIFT
      description: Classify the method of payment as "SWIFT" for SWIFTDetails
    CheckPaymentMethod:
      type: string
      title: CheckPaymentMethod
      description: Classify the method of payment as "CHECK" for CheckDetails
      enum:
        - CHECK
    CashPaymentMethod:
      type: string
      title: CashPaymentMethod
      description: Classify the method of payment as "CASH" for Details
      enum:
        - CASH
    MpesaPaymentMethod:
      type: string
      title: MpesaPaymentMethod
      enum:
        - MPESA
      description: Classify the method of payment as "Mpesa" for MpesaDetails
    GeneralBankAccountPaymentMethod:
      type: string
      title: GeneralBankAccountPaymentMethod
      enum:
        - GENERIC_BANK_ACCOUNT
      description: Classify the method of payment as "GENERIC_BANK_ACCOUNT" for
        GenericBankAccountDetails
    UserState:
      type: string
      title: UserState
      enum:
        - UNACCEPTABLE
        - TERMINATED
        - ACTIVE
        - DORMANT
        - CREATED
        - SUSPENDED
        - BLOCKED
      x-examples:
        example-1: UNACCEPTABLE
        example-2: ACTIVE
    KYCStatus:
      type: string
      title: KYCStatus
      enum:
        - SUCCESSFUL
        - FAILED
        - NOT_STARTED
        - IN_PROGRESS
        - EXPIRED
        - NEW
        - CANCELLED
        - MANUAL_REVIEW
        - EDD_IN_PROGRESS
    EmploymentStatus:
      type: string
      title: EmploymentStatus
      enum:
        - UNEMPLOYED
        - EMPLOYED
        - SELF_EMPLOYED
        - FREELANCER
        - STUDENT
        - FULL_TIME
        - PART_TIME
        - SOLE_PROPRIETOR
        - PENSIONER
        - COMPANY_OWNER
        - OTHER
        - NA
    PEPStatus:
      type: object
      title: PEPStatus
      properties:
        isPepHit:
          type: boolean
        pepCountry:
          $ref: '#/components/schemas/CountryCode'
        pepRank:
          $ref: '#/components/schemas/PepRank'
      required:
        - isPepHit
    PepRank:
      type: string
      description: PEP rank
      enum:
        - LEVEL_1
        - LEVEL_2
        - LEVEL_3
    SanctionsStatus:
      type: boolean
    AdverseMediaStatus:
      type: boolean
    KYCStatusDetails:
      title: KYCStatusDetails
      type: object
      properties:
        reason:
          type: string
        status:
          $ref: '#/components/schemas/KYCStatus'
    UserTagsUpdate:
      title: UserTagsUpdate
      type: object
      properties:
        userId:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
    UserStateDetails:
      title: UserStateDetails
      type: object
      properties:
        reason:
          type: string
        state:
          $ref: '#/components/schemas/UserState'
      required:
        - state
    WebhookUserStateDetails:
      type: object
      properties:
        reason:
          type: string
        state:
          $ref: '#/components/schemas/UserState'
        userId:
          type: string
      required:
        - state
        - userId
    WebhookKYCStatusDetails:
      type: object
      properties:
        reason:
          type: string
        status:
          $ref: '#/components/schemas/KYCStatus'
        userId:
          type: string
      required:
        - userId
    CaseStatusDetails:
      title: CaseStatusDetails
      type: object
      properties:
        caseId:
          type: string
        status:
          type: string
        reasons:
          type: array
          items:
            type: string
        reasonDescriptionForOther:
          type: string
        comment:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
    CaseOpenedDetails:
      title: CaseOpenedDetails
      type: object
      properties:
        caseId:
          type: string
        status:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
    AlertStatusDetails:
      title: AlertStatusDetails
      type: object
      properties:
        alertId:
          type: string
        status:
          type: string
        reasons:
          type: array
          items:
            type: string
        reasonDescriptionForOther:
          type: string
        comment:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
        ruleName:
          type: string
        ruleDescription:
          type: string
        ruleId:
          type: string
        ruleInstanceId:
          type: string
    AlertOpenedDetails:
      title: AlertOpenedDetails
      type: object
      properties:
        alertId:
          type: string
        status:
          type: string
        transactionIds:
          type: array
          items:
            type: string
        ruleName:
          type: string
        ruleDescription:
          type: string
        ruleId:
          type: string
        ruleInstanceId:
          type: string
        caseId:
          type: string
        userId:
          type: string
    TransactionStatusDetails:
      title: TransactionStatusDetails
      type: object
      properties:
        transactionId:
          type: string
        reasons:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/RuleAction'
        comment:
          type: string
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
      required:
        - transactionId
        - status
        - reasons
    RiskLevel:
      type: string
      title: RiskLevel
      enum:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    CardExpiry:
      title: CardExpiry
      type: object
      properties:
        month:
          type: number
        year:
          type: number
    POSDetails:
      title: POSDetails
      type: object
      properties:
        entryMode:
          $ref: '#/components/schemas/POSEntryMode'
    POSEntryMode:
      title: POSEntryMode
      type: string
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
        - '79'
        - '80'
        - '81'
        - '82'
        - '85'
        - '90'
        - '91'
        - '95'
        - '97'
    WebhookEventBase:
      title: WebhookEventBase
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event
        triggeredBy:
          type: string
          description: Event triggered by a user or system
          enum:
            - MANUAL
            - SYSTEM
        createdTimestamp:
          type: number
          description: Time at which the event was created. Measured in ms since the Unix
            epoch.
          minimum: 315529200000
          maximum: 4133890801000
        account:
          type: string
          description: Email ID associated with the event
      required:
        - id
        - triggeredBy
        - createdTimestamp
    CRARiskLevelUpdatedDetails:
      title: CRARiskLevelUpdatedDetails
      type: object
      properties:
        riskLevel:
          type: string
        userId:
          type: string
    ListUpdatedDetails:
      title: ListUpdatedDetails
      type: object
      properties:
        listId:
          type: string
        action:
          type: string
          enum:
            - SET
            - UNSET
            - CLEAR
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListItem'
      required:
        - listId
        - action
        - items
    WebhookEvent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event
        triggeredBy:
          type: string
          description: Event triggered by a user or system
          enum:
            - MANUAL
            - SYSTEM
        createdTimestamp:
          type: number
          description: Time at which the event was created. Measured in ms since the Unix
            epoch.
          minimum: 315529200000
          maximum: 4133890801000
        account:
          type: string
          description: Email ID associated with the event
        type:
          $ref: '#/components/schemas/WebhookEventType'
        data:
          oneOf:
            - $ref: '#/components/schemas/UserStateDetails'
            - $ref: '#/components/schemas/CaseStatusDetails'
            - $ref: '#/components/schemas/CaseOpenedDetails'
            - $ref: '#/components/schemas/AlertStatusDetails'
            - $ref: '#/components/schemas/AlertOpenedDetails'
            - $ref: '#/components/schemas/TransactionStatusDetails'
            - $ref: '#/components/schemas/KYCStatusDetails'
            - $ref: '#/components/schemas/UserTagsUpdate'
            - $ref: '#/components/schemas/CRARiskLevelUpdatedDetails'
      required:
        - id
        - triggeredBy
        - createdTimestamp
        - type
        - data
    WebhookEventType:
      type: string
      title: WebhookEventType
      enum:
        - CASE_CLOSED
        - USER_STATE_UPDATED
        - ALERT_CLOSED
        - TRANSACTION_STATUS_UPDATED
        - KYC_STATUS_UPDATED
        - CASE_OPENED
        - ALERT_OPENED
        - PEP_STATUS_UPDATED
        - USER_TAGS_UPDATED
        - USER_TAGS_DELETED
        - CRA_RISK_LEVEL_UPDATED
        - LIST_UPDATED
        - SANCTIONS_STATUS_UPDATED
        - ADVERSE_MEDIA_STATUS_UPDATED
        - CASE_ESCALATED
        - ALERT_ESCALATED
    ListType:
      type: string
      enum:
        - WHITELIST
        - BLACKLIST
        - FLAGRIGHT_LIBRARY
    ListSubtype:
      type: string
      enum:
        - USER_ID
        - CARD_FINGERPRINT_NUMBER
        - IBAN_NUMBER
        - BANK_ACCOUNT_NUMBER
        - ACH_ACCOUNT_NUMBER
        - SWIFT_ACCOUNT_NUMBER
        - BIC
        - BANK_SWIFT_CODE
        - UPI_IDENTIFYING_NUMBER
        - IP_ADDRESS
        - DEVICE_IDENTIFIER
        - STRING
        - COUNTRY
        - CUSTOM
    ListKeyMetadata:
      type: object
      title: ListKeyMetadata
      additionalProperties: {}
    ListData:
      type: object
      title: ListData
      description: Payload of a list, new or existed
      properties:
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        items:
          type: array
          description: List items
          items:
            $ref: '#/components/schemas/ListItem'
    ListItem:
      type: object
      title: ListItem
      properties:
        key:
          type: string
        metadata:
          $ref: '#/components/schemas/ListKeyMetadata'
        ttl:
          type: number
      required:
        - key
    ColumnType:
      title: ColumnType
      type: string
      enum:
        - STRING
        - NUMBER
        - DATE
    CustomColumn:
      title: CustomColumn
      type: object
      properties:
        key:
          type: string
        type:
          $ref: '#/components/schemas/ColumnType'
        primaryKey:
          type: boolean
      required:
        - key
        - type
    ListMetadata:
      title: ListMetadata
      type: object
      properties:
        name:
          type: string
          description: List name
        description:
          type: string
          description: List description
        status:
          type: boolean
        checksum:
          type: string
        columns:
          type: array
          items:
            $ref: '#/components/schemas/CustomColumn'
        ttl:
          type: object
          properties:
            unit:
              type: string
              enum:
                - HOUR
                - DAY
            value:
              type: number
          required:
            - unit
            - value
      additionalProperties: {}
    ListExisted:
      type: object
      x-examples:
        example-1:
          header:
            listId: worst_people
            createdTimestamp: 1661782207924
          metadata:
            name: People I hate
          values:
            - key: john
              metadata:
                fullName: John Dow
      title: ListExisted
      description: List with ID and header
      properties:
        listId:
          type: string
        header:
          $ref: '#/components/schemas/ListHeader'
        items:
          type: array
          description: List items
          items:
            $ref: '#/components/schemas/ListItem'
      required:
        - listId
        - header
        - items
    ListHeader:
      title: ListHeader
      type: object
      properties:
        listId:
          type: string
        listType:
          $ref: '#/components/schemas/ListType'
        subtype:
          $ref: '#/components/schemas/ListSubtype'
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        createdTimestamp:
          type: number
        size:
          type: number
        version:
          type: number
      required:
        - listId
        - listType
        - subtype
        - createdTimestamp
    PaymentMethod:
      type: string
      title: PaymentMethod
      enum:
        - ACH
        - CARD
        - IBAN
        - UPI
        - GENERIC_BANK_ACCOUNT
        - MPESA
        - SWIFT
        - WALLET
        - CHECK
        - CASH
        - NPP
    CardMerchantDetails:
      title: CardMerchantDetails
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        category:
          type: string
        MCC:
          type: string
        city:
          type: string
        country:
          $ref: '#/components/schemas/CountryCode'
        state:
          type: string
        postCode:
          type: string
    CheckDetails:
      title: CheckDetails
      type: object
      properties:
        method:
          $ref: '#/components/schemas/CheckPaymentMethod'
        checkNumber:
          type: string
        checkIdentifier:
          type: string
        routingNumber:
          type: string
          description: Routing number of the bank
        name:
          type: string
        deliveryStatus:
          $ref: '#/components/schemas/CheckDeliveryStatus'
        etaTimestamp:
          type: number
          minimum: 315529200000
          maximum: 4133890801000
        shippingAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        accountNumber:
          type: string
        emailId:
          type: string
          description: Email ID of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    CashDetails:
      title: CashDetails
      type: object
      properties:
        method:
          $ref: '#/components/schemas/CashPaymentMethod'
        identifier:
          type: string
          description: Identifier for the cash transaction
        address:
          $ref: '#/components/schemas/Address'
        name:
          type: string
        emailId:
          $ref: '#/components/schemas/EmailId'
      required:
        - method
    CountryCode:
      type: string
      title: CountryCode
      enum:
        - AF
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - CV
        - KH
        - CM
        - CA
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CD
        - CG
        - CK
        - CR
        - HR
        - CU
        - CW
        - CY
        - CZ
        - CI
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MK
        - MP
        - NO
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RO
        - RU
        - RW
        - RE
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TM
        - TC
        - TV
        - TR
        - UG
        - UA
        - AE
        - GB
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - AX
        - XA
        - XB
        - XC
        - XD
        - XE
        - XF
        - XG
        - XH
        - XI
        - XJ
        - XK
        - XL
        - XM
        - XN
        - XO
        - XP
        - XQ
        - XR
        - XS
        - XT
        - XU
        - XV
        - XW
        - XY
        - XZ
        - N/A
    CurrencyCode:
      type: string
      title: CurrencyCode
      enum:
        - 1INCH
        - AAVE
        - ABT
        - ACH
        - ACS
        - ADA
        - AED
        - AERGO
        - AERO
        - AFN
        - AGLD
        - AIOZ
        - ALCX
        - ALEPH
        - ALGO
        - ALICE
        - ALL
        - AMD
        - AMP
        - ANG
        - ANKR
        - ANT
        - AOA
        - APE
        - API3
        - APT
        - ARB
        - ARPA
        - ARS
        - ASM
        - AST
        - ATA
        - ATOM
        - AUCTION
        - AUD
        - AUDIO
        - AURORA
        - AVAX
        - AVT
        - AWG
        - AXL
        - AXS
        - AZN
        - BADGER
        - BAL
        - BAM
        - BAND
        - BAT
        - BBD
        - BCH
        - BDT
        - BGN
        - BHD
        - BICO
        - BIF
        - BIGTIME
        - BIT
        - BLUR
        - BLZ
        - BMD
        - BND
        - BNT
        - BOB
        - BOBA
        - BOND
        - BONK
        - BRL
        - BSD
        - BSV
        - BTC
        - BTN
        - BTRST
        - BUSD
        - BWP
        - BYN
        - BYR
        - BZD
        - C98
        - CAD
        - CBETH
        - CDF
        - CELR
        - CGLD
        - CHF
        - CHZ
        - CLF
        - CLP
        - CLV
        - CNH
        - CNY
        - COMP
        - COP
        - COTI
        - COVAL
        - CRC
        - CRO
        - CRPT
        - CRV
        - CTSI
        - CTX
        - CUC
        - CUP
        - CVC
        - CVE
        - CVX
        - CZK
        - DAI
        - DAR
        - DASH
        - DDX
        - DESO
        - DEXT
        - DIA
        - DIMO
        - DJF
        - DKK
        - DNT
        - DOGE
        - DOP
        - DOT
        - DREP
        - DYDX
        - DYP
        - DZD
        - EEK
        - EGLD
        - EGP
        - ELA
        - ENJ
        - ENS
        - EOS
        - ERN
        - ETB
        - ETC
        - ETH
        - ETH2
        - EUR
        - EURA
        - EURC
        - EURT
        - EUROC
        - ETHFI
        - FARM
        - FET
        - FIDA
        - FIL
        - FIS
        - FJD
        - FKP
        - FLOW
        - FLR
        - FORT
        - FORTH
        - FOX
        - FX
        - FTM
        - GAL
        - GALA
        - GBP
        - GEL
        - GFI
        - GGP
        - GHS
        - GHST
        - GIP
        - GLM
        - GMD
        - GMT
        - GNF
        - GNO
        - GNT
        - GODS
        - GRT
        - GST
        - GTC
        - GTQ
        - GUSD
        - GYD
        - GYEN
        - HBAR
        - HFT
        - HIGH
        - HKD
        - HNL
        - HNT
        - HONEY
        - HOPR
        - HRK
        - HTG
        - HUF
        - ICP
        - IDEX
        - IDR
        - ILS
        - ILV
        - IMP
        - IMX
        - INDEX
        - INJ
        - INR
        - INV
        - IOTA
        - IOTX
        - ISLM
        - IQD
        - IRR
        - ISK
        - JASMY
        - JEP
        - JMD
        - JOD
        - JPY
        - JTO
        - JUP
        - KAVA
        - KEEP
        - KES
        - KGS
        - KHR
        - KLAY
        - KMF
        - KNC
        - KPW
        - KRL
        - KRW
        - KSM
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LCX
        - LDO
        - LINK
        - LIT
        - LKR
        - LOKA
        - LOOM
        - LPT
        - LQTY
        - LRC
        - LRD
        - LSETH
        - LSL
        - LTC
        - LTL
        - LUNA2
        - LVL
        - LYD
        - MAD
        - MAGIC
        - MANA
        - MASK
        - MATH
        - MATIC
        - MCO2
        - MDL
        - MDT
        - MEDIA
        - METIS
        - MGA
        - MINA
        - MIR
        - MKD
        - MKR
        - MLN
        - MMK
        - MNDE
        - MNT
        - MOBILE
        - MONA
        - MOP
        - MPL
        - MRO
        - MRU
        - MSOL
        - MTL
        - MULTI
        - MUR
        - MUSE
        - MVR
        - MWK
        - MXC
        - MXN
        - MXNB
        - MXND
        - MYR
        - MZN
        - NAD
        - NCT
        - NEAR
        - NEO
        - NEST
        - NGN
        - NIO
        - NKN
        - NMR
        - NOK
        - NPC
        - NPR
        - NU
        - NZD
        - OCEAN
        - OGN
        - OMG
        - OMR
        - ONDO
        - OOKI
        - OP
        - ORCA
        - ORN
        - OSMO
        - OXT
        - PAB
        - PAX
        - PEN
        - PENGU
        - PEPE
        - PERP
        - PGK
        - PHP
        - PKR
        - PLA
        - PLN
        - PLU
        - PNG
        - POL
        - POLS
        - POLY
        - POND
        - POWR
        - PRIME
        - PRO
        - PRQ
        - PUNDIX
        - PYG
        - PYR
        - PYUSD
        - QAR
        - QI
        - QNT
        - QSP
        - QUICK
        - RAD
        - RAI
        - RARE
        - RARI
        - RBN
        - REN
        - RENDER
        - REP
        - REPV2
        - REQ
        - RGT
        - RLC
        - RLY
        - RLUSD
        - RNDR
        - RON
        - ROSE
        - RPL
        - RSD
        - RUB
        - RUNE
        - RWF
        - SAND
        - SAR
        - SBD
        - SCR
        - SDG
        - SEAM
        - SEI
        - SEK
        - SGD
        - SHIB
        - SHP
        - SHPING
        - SKK
        - SKL
        - SLL
        - SNT
        - SNX
        - SOL
        - SOS
        - SPA
        - SPELL
        - SRD
        - SSP
        - STD
        - STG
        - STORJ
        - STRK
        - STX
        - SUI
        - SUKU
        - SUPER
        - SUSHI
        - SVC
        - SWFTC
        - SYLO
        - SYN
        - SYP
        - SYRUPUSDC
        - SZL
        - T
        - THB
        - THETA
        - TIA
        - TIME
        - TJS
        - TMM
        - TMT
        - TND
        - TONE
        - TON
        - TOP
        - TRAC
        - TRB
        - TRIBE
        - TRU
        - TRUMP
        - TRY
        - TTD
        - TVK
        - TWD
        - TZS
        - UAH
        - UGX
        - UMA
        - UNFI
        - UNI
        - UPI
        - USD
        - USDG
        - USDAI
        - USDE
        - USDH
        - USDC
        - USDT
        - USYC
        - UST
        - UYU
        - UZS
        - VARA
        - VEF
        - VELO
        - VES
        - VET
        - VGX
        - VND
        - VOXEL
        - VTHO
        - VUV
        - WAMPL
        - WAVES
        - WAXL
        - WBTC
        - WCFG
        - WLUNA
        - WST
        - XAF
        - XAG
        - XAU
        - XCD
        - XCN
        - XDR
        - XLM
        - XMON
        - XOF
        - XPD
        - XPF
        - XPT
        - XRP
        - XTZ
        - XYO
        - YER
        - YFI
        - YFII
        - ZAR
        - ZEC
        - ZEN
        - ZETA
        - ZIL
        - ZMK
        - ZMW
        - ZRX
        - ZWD
        - FDUSD
        - AGX
        - AUX
        - BNB
        - CUBE
        - EMON
        - FDGT
        - KGLD
        - LODE
        - PASS
        - PREMIA
        - TAB1
        - TD-USD
        - TRX
        - TYUGA
        - VIC
        - XAI
        - SLE
        - UDI
    MCCDetails:
      title: MCCDetails
      type: object
      properties:
        code:
          type: number
          description: Merchant code
        description:
          type: string
          description: Merchant Description
      required:
        - code
    TransactionCountLimit:
      title: TransactionCountLimit
      type: object
      properties:
        day:
          type: number
        week:
          type: number
        month:
          type: number
        year:
          type: number
    TransactionAmountLimit:
      title: TransactionAmountLimit
      type: object
      properties:
        day:
          $ref: '#/components/schemas/Amount'
        week:
          $ref: '#/components/schemas/Amount'
        month:
          $ref: '#/components/schemas/Amount'
        year:
          $ref: '#/components/schemas/Amount'
    TransactionLimit:
      title: TransactionLimit
      type: object
      properties:
        transactionCountLimit:
          $ref: '#/components/schemas/TransactionCountLimit'
        transactionAmountLimit:
          $ref: '#/components/schemas/TransactionAmountLimit'
        averageTransactionAmountLimit:
          $ref: '#/components/schemas/TransactionAmountLimit'
    FalsePositiveDetails:
      title: FalsePositiveDetails
      type: object
      properties:
        isFalsePositive:
          type: boolean
        confidenceScore:
          type: number
      required:
        - isFalsePositive
        - confidenceScore
    SanctionsDetails:
      title: SanctionsDetails
      type: object
      properties:
        name:
          type: string
        searchId:
          type: string
        iban:
          type: string
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        sanctionHitIds:
          type: array
          items:
            type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        hitDirection:
          $ref: '#/components/schemas/RuleHitDirection'
      required:
        - name
        - searchId
    SanctionsHitContext:
      type: object
      title: SanctionsHitContext
      properties:
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        userId:
          type: string
        transactionId:
          type: string
        ruleInstanceId:
          type: string
        ruleId:
          type: string
        iban:
          type: string
        yearOfBirth:
          type: number
        searchTerm:
          type: string
        paymentMethodId:
          type: string
      required:
        - entity
    SanctionsScreeningEntity:
      type: string
      enum:
        - USER
        - BANK
        - IBAN
        - EXTERNAL_USER
    SanctionsDetailsEntityType:
      title: SanctionsDetailsEntityType
      type: string
      enum:
        - CONSUMER_NAME
        - LEGAL_NAME
        - SHAREHOLDER
        - DIRECTOR
        - NAME_ON_CARD
        - PAYMENT_NAME
        - PAYMENT_BENEFICIARY_NAME
        - BANK_NAME
        - BANK_ACCOUNT_HOLDER_NAME
    UserEntityLink:
      title: UserEntityLink
      type: object
      properties:
        parentUserId:
          type: string
    UserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
    UserRiskScoreDetails:
      title: UserRiskScoreDetails
      type: object
      properties:
        kycRiskScore:
          type: number
        craRiskScore:
          type: number
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        craRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
    BusinessWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BooleanString:
      title: Boolean string value
      type: string
      enum:
        - 'true'
        - 'false'
    Gender:
      title: Gender
      description: Gender of the individual - Male, Female or Non-Binary
      type: string
      enum:
        - M
        - F
        - NB
    MaritalStatus:
      title: MaritalStatus
      description: Marital status of the individual
      type: string
      enum:
        - DIVORCED
        - MARRIED
        - SINGLE
        - WIDOWED
        - NA
    CardBrand:
      title: CardBrand
      description: Brand of Card
      type: string
      enum:
        - VISA
        - MASTERCARD
        - AMERICAN_EXPRESS
        - DISCOVER
        - UNIONPAY
        - RUPAY
        - JCB
    CardFunding:
      title: CardFunding
      description: Funding of Card
      type: string
      enum:
        - CREDIT
        - DEBIT
        - PREPAID
    BatchResponseStatus:
      title: BatchResponseStatus
      description: Status of the batch response
      type: string
      enum:
        - SUCCESS
        - PARTIAL_FAILURE
        - FAILURE
    BatchResponseFailedRecord:
      title: BatchResponseFailedRecord
      description: Failed record in a batch response
      type: object
      properties:
        id:
          type: string
        reasonCode:
          type: string
    BatchResponse:
      title: BatchResponse
      description: Response from creation of a batch
      type: object
      properties:
        status:
          $ref: '#/components/schemas/BatchResponseStatus'
        batchId:
          type: string
        successful:
          type: number
        failed:
          type: number
        failedRecords:
          type: array
          items:
            $ref: '#/components/schemas/BatchResponseFailedRecord'
        message:
          type: string
      required:
        - status
        - batchId
        - successful
        - failed
    ConsumerUserEventBatchRequest:
      title: ConsumerUserEventBatchRequest
      description: Batch request to create consumer users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConsumerUserEvent'
      required:
        - data
    BusinessUserEventBatchRequest:
      title: BusinessUserEventBatchRequest
      description: Batch request to create business users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/BusinessUserEvent'
      required:
        - data
    TransactionBatchRequest:
      title: TransactionBatchRequest
      description: Batch request to create transactions
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
      required:
        - data
    TransactionEventBatchRequest:
      title: TransactionEventBatchRequest
      description: Batch request to create transaction events
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/TransactionEvent'
      required:
        - data
    UserBatchRequest:
      title: UserBatchRequest
      description: Batch request to create consumer users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/User'
      required:
        - data
    BusinessBatchRequest:
      title: BusinessBatchRequest
      description: Batch request to create business users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Business'
      required:
        - data
    CardType:
      title: CardType
      description: Type of card
      type: string
      enum:
        - VIRTUAL
        - PHYSICAL
    PlaceOfBirth:
      title: PlaceOfBirth
      description: Place of birth of the individual
      type: object
      properties:
        city:
          type: string
        state:
          type: string
        country:
          $ref: '#/components/schemas/CountryCode'
      required:
        - country
    MpesaTransactionType:
      title: MpesaTransactionType
      description: Type of transaction
      type: string
      enum:
        - CustomerPayBillOnline
        - CustomerBuyGoodsOnline
        - SalaryPayment
        - BusinessPayment
        - PromotionPayment
    CheckDeliveryStatus:
      title: CheckDeliveryStatus
      type: string
      enum:
        - COMPLETED
        - PENDING
        - SETTLED
        - CANCELED
        - REFUND
        - DECLINED
    ApiErrorResponse:
      title: ApiErrorResponse
      type: object
      properties:
        message:
          type: string
        validationErrors:
          type: string
      required:
        - message
    Page:
      title: Page
      type: number
      minimum: 1
    PageSize:
      title: PageSize
      type: number
      minimum: 1
      maximum: 100
  securitySchemes:
    x-api-key:
      name: x-api-key
      type: apiKey
      in: header
      description: API keys are used to authenticate the requests.
tags: []
