API Integration for Onboarding Users

Onboard users via API

With the API integration, you have full control over the user onboarding experience. Implement your own frontend to collect the data and send Modern Treasury the data for verification. Alternatively, you can embed a pre-built flow to quickly add this capability to your application.

1. Retrieve your API Key

Go to your API Keys page. There you will find your Organization ID and API keys. Your default Sandbox or Production keys have the appropriate permissions. Otherwise, create or modify an API key to have manage permissions for Compliance, Counterparties, and External Accounts.

2. Create a User Onboarding

Create a User Onboarding. Provide information via the data field and set the status field to processing.

For KYC, the flow alias should be default-individual. For KYB, the flow alias should be default-business. You can also customize what checks are run- learn more on the Customize User Onboarding Checks page.

There are optional fields for verified email and verified phone, where you can enter an email address or phone number that you have verified previously with the user. Phone numbers should include the country code (e.g. +1 for US-based phone numbers) and be formatted without spaces (e.g. +11234567890). This data will be compared against what the user enters and is a signal for the KYC checks.

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"
        }
     }
  }'
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",
     "verified_email": "[email protected]",
     "verified_phone": "+12223334444",
     "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"
        }
     }
  }'
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-business",
     "data": {
        "company_name": "Hogwarts School of Witchcraft and Wizardry",
        "phone_number": "+11111111111",
        "address": {
          "line1": "1 Howarts Way",
          "line2": "",
          "locality": "San Francisco",
          "region": "CA",
          "postal_code": "94108",
          "country": "USA"
        },
        "website": "www.hogwarts.edu",
        "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"
        }
     }
  }'

This API request 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"
}
{
    "id": "4e72312c-71a3-4dad-8a28-a8f258dff8b9",
    "object": "user_onboarding",
    "live_mode": true,
    "metadata": {},
    "party_type": "business",
    "status": "processing",
    "counterparty_id": null,
    "external_account_id": null,
    "compliance_rule_metadata": null,
    "decision_id": null,
    "created_at": "2023-03-20T21:58:15Z",
    "updated_at": "2023-03-20T21:58:15Z"
}

The checks will be kicked off automatically.