Compliance Quickstart
Get started with Compliance in just a few short steps.
In this Compliance Quickstart guide, you will run KYC checks on a customer and then monitor a transaction from them.
Customer Onboarding KYC
In this example, you will pass KYC data to Modern Treasury via API for verification. You would follow this pattern if you have your own form to collect KYC information.
Create a User Onboarding
To onboard a customer, create a User Onboarding. Modern Treasury will run a robust set of KYC checks:
- Verify their identity using information about their name, address, email, phone, and tax ID
- Run sanctions, politically exposed persons, and adverse media checks, and enroll them in continuous monitoring
- Validate their bank account for risk using bank consortium data
curl --request POST \
-u ORGANIZATION_ID:API_KEY \
--url https://app.moderntreasury.com/api/user_onboardings \
-H 'Content-Type: application/json' \
-d '{
"status":"processing",
"flow_alias": "default-individual",
"data": {
"first_name": "Harry",
"last_name": "Potter",
"date_of_birth": "1990-01-02",
"phone_number": "+11111111111",
"email": "[email protected]",
"address": {
"line1": "Hogsmeade Ave",
"line2": "",
"locality": "San Francisco",
"region": "CA",
"postal_code": "94108",
"country": "USA"
},
"taxpayer_identifier": "123456789",
"external_account": {
"account_details": [
{
"account_number": "1111111111",
"account_number_type": "other"
}
],
"routing_details": [
{
"routing_number": "021000021",
"routing_number_type": "aba"
}
],
"account_type": "checking"
}
}
}'
The API will return a User Onboarding object.
{
"id": "532753d9-369c-44a4-8b70-8f5899a642aa",
"object": "user_onboarding",
"live_mode": true,
"metadata": {},
"party_type": "individual",
"status": "processing",
"counterparty_id": null,
"external_account_id": null,
"compliance_rule_metadata": null,
"decision_id": null,
"created_at": "2023-03-20T22:02:03Z",
"updated_at": "2023-03-20T22:02:03Z"
}
Monitor the User Onboarding
Based on the compliance score, a User Onboarding will be automatically approved
, automatically denied
, or have a Case opened for manual review. Webhooks are used to provide status updates on User Onboardings.
If a User Onboarding is approved a Counterparty and External Account will be created. If a User Onboarding is denied a Counterparty will not be created. The id
of the Counterparty and External Accounts will be included in the webhooks and User Onboarding object.
In this example, the User Onboarding will be automatically approved. Below is an example of the webhook that you will receive.
{
"event": "approved",
"data": {
"id": "e640a26e-4289-4799-b991-e5a136b94428",
"object": "user_onboarding",
"live_mode": true,
"metadata": {},
"party_type": "individual",
"status": "approved",
"counterparty_id": "72d63b95-910f-41ae-a13c-5a9465c891a1",
"external_account_id": "4c95964e-c9d4-4102-9183-2c8ae39e2c1d",
"decision_id": "08d9b87d-67a2-4234-a6d0-e8fec11ebb4f",
"created_at": "2022-05-16T05:14:02Z",
"updated_at": "2022-05-16T05:14:02Z"
}
}
Check out our Customer Onboarding guides to learn more.
Transaction Monitoring
In this example, you will now initiate an ACH debit to receive money from the user, and be monitoring that transaction.
Create a Payment Order
Create a Payment Order. Use the external_account_id
from the previous step as the receiving_account_id
. Set the transaction_monitoring_enabled
boolean to true
. Use an Internal Account ID, which you can find on your Accounts page, as the originating_account_id
curl --request POST \
-u ORGANIZATION_ID:API_KEY \
--url https://app.moderntreasury.com/api/payment_orders \
-H 'Content-Type: application/json' \
-d '{
"type": "ach",
"amount": 1000,
"direction": "debit",
"currency": "USD",
"originating_account_id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
"receiving_account_id": "4c95964e-c9d4-4102-9183-2c8ae39e2c1d",
"transaction_monitoring_enabled": true
}'
When the Payment Order is created, transaction monitoring will be kicked off in the background. Below is an example response. It contains the id
of the Payment Order, as well as additional details about it.
{
"id": "c5f4009c-bdd6-4cc1-84b2-17974ac9e77a",
"object": "payment_order",
...
}
Monitor the Payment Order
Based on the compliance score, a Payment Order will be automatically approved
, automatically denied
, or have a Case opened for manual review. Webhooks are used to provide status updates on Payment Orders. The following are relevant states for transaction monitoring.
In this example, the Payment Order will be automatically approved.
Updated 7 months ago