Skip to content

Latest commit

Β 

History

History
2965 lines (2046 loc) Β· 45.4 KB

File metadata and controls

2965 lines (2046 loc) Β· 45.4 KB

Reference

Transactions

client.transactions.verify(...)

πŸ“ Description

POST Transactions

/transactions endpoint allows you to operate on the Transaction entity.

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 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
  • 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 or create a business user 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 or create a business user 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.

πŸ”Œ Usage

from flagright import (
    DeviceData,
    Flagright,
    Tag,
    TransactionAmountDetails,
    TransactionDestinationPaymentDetails_Card,
    TransactionOriginPaymentDetails_Card,
)

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.transactions.verify(
    validate_origin_user_id="true",
    validate_destination_user_id="true",
    type="DEPOSIT",
    transaction_id="7b80a539eea6e78acbd6d458e5971482",
    timestamp=1641654664000.0,
    origin_user_id="8650a2611d0771cba03310f74bf6",
    destination_user_id="9350a2611e0771cba03310f74bf6",
    origin_amount_details=TransactionAmountDetails(
        transaction_amount=2000.0,
        transaction_currency="EUR",
        country="DE",
    ),
    destination_amount_details=TransactionAmountDetails(
        transaction_amount=68351.34,
        transaction_currency="INR",
        country="IN",
    ),
    origin_payment_details=TransactionOriginPaymentDetails_Card(
        card_fingerprint="20ac00fed8ef913aefb17cfae1097cce",
        card_issued_country="TR",
        transaction_reference_field="Deposit",
        f_3_ds_done=True,
    ),
    destination_payment_details=TransactionDestinationPaymentDetails_Card(
        card_fingerprint="20ac00fed8ef913aefb17cfae1097cce",
        card_issued_country="TR",
        transaction_reference_field="Deposit",
        f_3_ds_done=True,
    ),
    promotion_code_used=True,
    reference="loan repayment",
    origin_device_data=DeviceData(
        battery_level=95.0,
        device_latitude=13.0033,
        device_longitude=76.1004,
        ip_address="10.23.191.2",
        device_identifier="3c49f915d04485e34caba",
        vpn_used=False,
        operating_system="Android 11.2",
        device_maker="ASUS",
        device_model="Zenphone M2 Pro Max",
        device_year="2018",
        app_version="1.1.0",
    ),
    destination_device_data=DeviceData(
        battery_level=95.0,
        device_latitude=13.0033,
        device_longitude=76.1004,
        ip_address="10.23.191.2",
        device_identifier="3c49f915d04485e34caba",
        vpn_used=False,
        operating_system="Android 11.2",
        device_maker="ASUS",
        device_model="Zenphone M2 Pro Max",
        device_year="2018",
        app_version="1.1.0",
    ),
    tags=[
        Tag(
            key="customKey",
            value="customValue",
        )
    ],
)

βš™οΈ Parameters

type: str β€” Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER, EXTERNAL_PAYMENT, REFUND, OTHER)

transaction_id: str β€” Unique transaction identifier

timestamp: float β€” Timestamp of when transaction took place

validate_origin_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate if provided originUserId exist. True by default

validate_destination_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate if provided destinationUserId exist. True by default

origin_user_id: typing.Optional[str] β€” UserId for where the transaction originates from

destination_user_id: typing.Optional[str] β€” UserId for transaction's destination. In other words, where the value is being transferred to.

transaction_state: typing.Optional[TransactionState]

origin_amount_details: typing.Optional[TransactionAmountDetails]

destination_amount_details: typing.Optional[TransactionAmountDetails]

origin_payment_details: typing.Optional[TransactionOriginPaymentDetails] β€” Payment details of the origin. It can be a bank account number, wallet ID, card fingerprint etc.

destination_payment_details: typing.Optional[TransactionDestinationPaymentDetails]

origin_funds_info: typing.Optional[OriginFundsInfo]

corporate_entity: typing.Optional[CorporateEntityDetails]

related_transaction_ids: typing.Optional[typing.Sequence[str]] β€” IDs of transactions related to this transaction. Ex: refund, split bills

product_type: typing.Optional[str] β€” Type of produce being used by the consumer (ex wallets, payments etc)

promotion_code_used: typing.Optional[bool] β€” Whether a promotion code was used or not the transaction

reference: typing.Optional[str] β€” Reference field for the transaction indicating the purpose of the transaction etc.

origin_device_data: typing.Optional[DeviceData]

destination_device_data: typing.Optional[DeviceData]

metadata: typing.Optional[TransactionMetadata]

tags: typing.Optional[typing.Sequence[Tag]] β€” Additional information that can be added via tags

jurisdiction: typing.Optional[str] β€” Legal authority or region governing the transaction

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.transactions.get(...)

πŸ“ Description

GET Transactions

/transactions endpoint allows you to operate on the Transaction entity.

Calling GET /transactions/{transactionId} will return the entire transaction payload and rule execution results for the transaction with the corresponding transactionId

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.transactions.get(
    transaction_id="transactionId",
)

βš™οΈ Parameters

transaction_id: str β€” Unique Transaction Identifier

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Batch

client.batch.verify_transaction(...)

πŸ”Œ Usage

from flagright import Flagright, Transaction

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.verify_transaction(
    validate_origin_user_id="true",
    validate_destination_user_id="true",
    data=[
        Transaction(
            type="type",
            transaction_id="transactionId",
            timestamp=1.1,
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[Transaction]

validate_origin_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate if provided originUserId exist. True by default

validate_destination_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate if provided destinationUserId exist. True by default

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_transactions(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_transactions(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.create_transaction_events(...)

πŸ”Œ Usage

from flagright import Flagright, TransactionEvent

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.create_transaction_events(
    data=[
        TransactionEvent(
            transaction_state="CREATED",
            timestamp=1.1,
            transaction_id="transactionId",
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[TransactionEvent]

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_transaction_events(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_transaction_events(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.create_consumer_users(...)

πŸ”Œ Usage

from flagright import Flagright, User

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.create_consumer_users(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    data=[
        User(
            user_id="userId",
            created_timestamp=1.1,
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[User]

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_consumer_users(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_consumer_users(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.create_business_users(...)

πŸ”Œ Usage

from flagright import Business, CompanyGeneralDetails, Flagright, LegalEntity

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.create_business_users(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    data=[
        Business(
            user_id="userId",
            created_timestamp=1.1,
            legal_entity=LegalEntity(
                company_general_details=CompanyGeneralDetails(
                    legal_name="Ozkan Hazelnut Export JSC",
                    business_industry=["Farming"],
                    main_products_services_sold=["Hazelnut"],
                ),
            ),
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[Business]

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_business_users(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_business_users(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.create_consumer_user_events(...)

πŸ”Œ Usage

from flagright import ConsumerUserEvent, Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.create_consumer_user_events(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    data=[
        ConsumerUserEvent(
            timestamp=1.1,
            user_id="userId",
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[ConsumerUserEvent]

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_consumer_user_events(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_consumer_user_events(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.create_business_user_events(...)

πŸ”Œ Usage

from flagright import BusinessUserEvent, Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.create_business_user_events(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    data=[
        BusinessUserEvent(
            timestamp=1.1,
            user_id="userId",
        )
    ],
)

βš™οΈ Parameters

data: typing.Sequence[BusinessUserEvent]

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

batch_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.batch.get_business_user_events(...)

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.batch.get_business_user_events(
    batch_id="batchId",
    page_size=1.1,
    page=1.1,
)

βš™οΈ Parameters

batch_id: str β€” Unique Batch Identifier

page_size: typing.Optional[PageSize] β€” Page size (default 20)

page: typing.Optional[Page] β€” Page

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

TransactionEvents

client.transaction_events.create(...)

πŸ“ Description

POST Transaction Events

/events/transaction endpoint allows you to operate on the Transaction Events entity.

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
  • 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.

πŸ”Œ Usage

from flagright import DeviceData, Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.transaction_events.create(
    transaction_state="SUCCESSFUL",
    timestamp=1752526580000.0,
    transaction_id="443dea26147a406b957d9ee3a1247b11",
    event_id="aaeeb166147a406b957dd9147a406b957",
    event_description="Transaction created",
    meta_data=DeviceData(
        battery_level=76.3,
        device_latitude=13.009711,
        device_longitude=76.102898,
        ip_address="79.144.2.20",
        vpn_used=True,
    ),
)

βš™οΈ Parameters

transaction_state: TransactionState

timestamp: float β€” Timestamp of the event

transaction_id: str β€” Transaction ID the event pertains to

event_id: typing.Optional[str] β€” Unique event ID

reason: typing.Optional[str] β€” Reason for the event or a state change

event_description: typing.Optional[str] β€” Event description

updated_transaction_attributes: typing.Optional[TransactionUpdatable]

meta_data: typing.Optional[DeviceData]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.transaction_events.get(...)

πŸ“ Description

GET Transaction Events

/events/transaction endpoint allows you to operate on the Transaction Events entity..

You can retrieve any transaction event you created using the POST Transaction Events call.

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.transaction_events.get(
    event_id="eventId",
)

βš™οΈ Parameters

event_id: str β€” Unique Transaction Identifier

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

ConsumerUsers

client.consumer_users.create(...)

πŸ“ 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

πŸ”Œ Usage

from flagright import (
    Address,
    ConsumerName,
    ContactDetails,
    Flagright,
    LegalDocument,
    Tag,
    UserDetails,
    UserTag,
)

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.consumer_users.create(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    validate_user_id="true",
    user_id="96647cfd9e8fe66ee0f3362e011e34e8",
    created_timestamp=1641654664000.0,
    user_details=UserDetails(
        name=ConsumerName(
            first_name="Baran",
            middle_name="Realblood",
            last_name="Ozkan",
        ),
        date_of_birth="1991-01-01",
        country_of_residence="US",
        country_of_nationality="DE",
    ),
    legal_documents=[
        LegalDocument(
            document_type="passport",
            document_number="Z9431P",
            document_issued_date=1639939034000.0,
            document_expiration_date=1839939034000.0,
            document_issued_country="DE",
            tags=[
                Tag(
                    key="customerType",
                    value="wallet",
                )
            ],
        )
    ],
    contact_details=ContactDetails(
        email_ids=["baran@flagright.com"],
        contact_numbers=["+37112345432"],
        websites=["flagright.com"],
        addresses=[
            Address(
                address_lines=["Klara-Franke Str 20"],
                postcode="10557",
                city="Berlin",
                state="Berlin",
                country="Germany",
                tags=[
                    Tag(
                        key="customKey",
                        value="customValue",
                    )
                ],
            )
        ],
    ),
    tags=[
        UserTag(
            key="customKey",
            value="customValue",
        )
    ],
)

βš™οΈ Parameters

user_id: str β€” Unique user ID

created_timestamp: float β€” Timestamp when userId is created

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

validate_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate the userId

activated_timestamp: typing.Optional[float] β€” Timestamp when user was activated

user_details: typing.Optional[UserDetails]

user_state_details: typing.Optional[UserStateDetails]

kyc_status_details: typing.Optional[KycStatusDetails]

eodd_date: typing.Optional[float]

employment_status: typing.Optional[EmploymentStatus]

occupation: typing.Optional[str]

legal_documents: typing.Optional[typing.Sequence[LegalDocument]] β€” User's legal identity documents - See Document Model for details

contact_details: typing.Optional[ContactDetails]

employment_details: typing.Optional[EmploymentDetails]

transaction_limits: typing.Optional[TransactionLimits]

expected_income: typing.Optional[ExpectedIncome]

expected_transaction_countries: typing.Optional[ExpectedTransactionCountries]

risk_level: typing.Optional[RiskLevel]

kyc_risk_level: typing.Optional[RiskLevel]

acquisition_channel: typing.Optional[AcquisitionChannel]

reason_for_account_opening: typing.Optional[typing.Sequence[str]]

source_of_funds: typing.Optional[typing.Sequence[SourceOfFunds]]

user_segment: typing.Optional[ConsumerUserSegment]

pep_status: typing.Optional[typing.Sequence[PepStatus]]

sanctions_status: typing.Optional[SanctionsStatus]

adverse_media_status: typing.Optional[AdverseMediaStatus]

corporate_entities: typing.Optional[typing.Sequence[CorporateEntityDetails]] β€” Corporate entities of the user

linked_entities: typing.Optional[UserEntityLink]

saved_payment_details: typing.Optional[typing.Sequence[UserSavedPaymentDetailsItem]]

tags: typing.Optional[typing.Sequence[UserTag]] β€” Additional information that can be added via tags

attachments: typing.Optional[typing.Sequence[PersonAttachment]] β€” Uploaded user's attachment

meta_data: typing.Optional[DeviceData]

jurisdiction: typing.Optional[str] β€” Legal authority or region governing the transaction

products_enabled: typing.Optional[typing.Sequence[ProductsEnabled]]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.consumer_users.get(...)

πŸ“ 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

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.consumer_users.get(
    user_id="userId",
)

βš™οΈ Parameters

user_id: str β€”

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

BusinessUsers

client.business_users.create(...)

πŸ“ 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 legalNamein CompanyGeneralDetails is mandatory
  • createdTimestamp - UNIX timestamp in milliseconds for when the User is created in your system

πŸ”Œ Usage

from flagright import CompanyGeneralDetails, Flagright, LegalEntity

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.business_users.create(
    lock_cra_risk_level="true",
    lock_kyc_risk_level="true",
    validate_user_id="true",
    user_id="userId",
    created_timestamp=1.1,
    legal_entity=LegalEntity(
        company_general_details=CompanyGeneralDetails(
            legal_name="Ozkan Hazelnut Export JSC",
            business_industry=["Farming"],
            main_products_services_sold=["Hazelnut"],
        ),
    ),
)

βš™οΈ Parameters

user_id: str β€” Unique user ID for the user

created_timestamp: float β€” Timestamp when the user was created

legal_entity: LegalEntity

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

validate_user_id: typing.Optional[BooleanString] β€” Boolean string whether Flagright should validate the userId

activated_timestamp: typing.Optional[float] β€” Timestamp when the user was activated

user_state_details: typing.Optional[UserStateDetails]

kyc_status_details: typing.Optional[KycStatusDetails]

eodd_date: typing.Optional[float]

corporate_entities: typing.Optional[typing.Sequence[CorporateEntityDetails]] β€” Corporate entities of the user

share_holders: typing.Optional[typing.Sequence[BusinessShareHoldersItem]] β€” Shareholders (beneficiaries) of the company that hold at least 25% ownership. Can be another company or an individual

directors: typing.Optional[typing.Sequence[BusinessDirectorsItem]] β€” Director(s) of the company. Must be at least one

associated_parties: typing.Optional[typing.Sequence[BusinessAssociatedPartiesItem]] β€” Parties associated with the company. Can be another company or an individual

business_partners: typing.Optional[typing.Sequence[LegalEntity]] β€” Business partners of the company

transaction_limits: typing.Optional[TransactionLimits]

expected_transaction_countries: typing.Optional[ExpectedTransactionCountries]

risk_level: typing.Optional[RiskLevel]

kyc_risk_level: typing.Optional[RiskLevel]

allowed_payment_methods: typing.Optional[typing.Sequence[PaymentMethod]]

linked_entities: typing.Optional[UserEntityLink]

acquisition_channel: typing.Optional[AcquisitionChannel]

saved_payment_details: typing.Optional[typing.Sequence[BusinessSavedPaymentDetailsItem]]

mcc_details: typing.Optional[MccDetails]

tags: typing.Optional[typing.Sequence[UserTag]] β€” Additional information that can be added via tags

attachments: typing.Optional[typing.Sequence[PersonAttachment]] β€” User's attachments uploaded by business user

meta_data: typing.Optional[DeviceData]

jurisdiction: typing.Optional[str] β€” Legal authority or region governing the transaction

products_enabled: typing.Optional[typing.Sequence[ProductsEnabled]]

pep_status: typing.Optional[typing.Sequence[PepStatus]]

sanctions_status: typing.Optional[bool] β€” Whether the user is sanctioned

adverse_media_status: typing.Optional[bool] β€” Whether the user is in the adverse media list

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.business_users.get(...)

πŸ“ 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

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.business_users.get(
    user_id="userId",
)

βš™οΈ Parameters

user_id: str β€”

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

ConsumerUserEvents

client.consumer_user_events.create(...)

πŸ“ 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.

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.consumer_user_events.create(
    allow_user_type_conversion="true",
    lock_kyc_risk_level="true",
    lock_cra_risk_level="true",
    timestamp=1.1,
    user_id="userId",
)

βš™οΈ Parameters

timestamp: float β€” Timestamp of the event

user_id: str β€” Transaction ID the event pertains to

allow_user_type_conversion: typing.Optional[BooleanString] β€” 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.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

event_id: typing.Optional[str] β€” Unique event ID

reason: typing.Optional[str] β€” Reason for the event or a state change

event_description: typing.Optional[str] β€” Event description

updated_consumer_user_attributes: typing.Optional[UserOptional]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.consumer_user_events.get(...)

πŸ“ Description

GET a Consumer User Event

You can retrieve any consumer user event you created using the POST Consumer User Events call.

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.consumer_user_events.get(
    event_id="eventId",
)

βš™οΈ Parameters

event_id: str β€” Unique Consumer User Event Identifier

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

BusinessUserEvents

client.business_user_events.create(...)

πŸ“ 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.

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.business_user_events.create(
    allow_user_type_conversion="true",
    lock_kyc_risk_level="true",
    lock_cra_risk_level="true",
    timestamp=1.1,
    user_id="userId",
)

βš™οΈ Parameters

timestamp: float β€” Timestamp of the event

user_id: str β€” Transaction ID the event pertains to

allow_user_type_conversion: typing.Optional[BooleanString] β€” 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.

lock_kyc_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the KYC risk level for the user.

lock_cra_risk_level: typing.Optional[BooleanString] β€” Boolean string whether Flagright should lock the CRA risk level for the user.

event_id: typing.Optional[str] β€” Unique event ID

reason: typing.Optional[str] β€” Reason for the event or a state change

event_description: typing.Optional[str] β€” Event description

updated_business_user_attributes: typing.Optional[BusinessOptional]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.business_user_events.get(...)

πŸ“ Description

GET a Business User Event

You can retrieve any business user event you created using the POST Business User Events call.

πŸ”Œ Usage

from flagright import Flagright

client = Flagright(
    api_key="YOUR_API_KEY",
)
client.business_user_events.get(
    event_id="eventId",
)

βš™οΈ Parameters

event_id: str β€” Unique Business User Event Identifier

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.