# Customer Onboarding



Before users can make transactions, they must be registered and verified. You can either direct users to the Paytrie signup page or use the API to register them through your own interface.

## API integration [#api-integration]

For a seamless user experience, use the API to register users through your own interface.

### Quick start [#quick-start]

```bash
curl -X POST "https://api.paytrie.com/v2/users" \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "dob": "1990-01-15",
    "phone": "4165551234",
    "addressLine1": "123 Main Street",
    "addressLine2": "Suite 100",
    "city": "Toronto",
    "province": "on",
    "postalCode": "M5V1A1",
    "occupation": "Software Engineer",
    "pep": false,
    "tpd": false
  }'
```

The response will include the `id` of the newly created user record. You can
subsequently use that to generate the kyc link.

```json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "john.doe@example.com",
    ...
  }
}
```

<Card title="API Reference: Create a new user" href="/v2/api-reference/users/createUser" icon="arrow-right-left">
  View complete request parameters and response schema
</Card>

```bash
curl -X GET "https://api.paytrie.com/v2/users/550e8400-e29b-41d4-a716-446655440000/kyc-url" \
  -H "x-api-key: your-api-key"
```

Using the `id` from the previous response, you can call the generate KYC link endpoint to complete the onboarding flow.

```json
{
  "success": true,
  "data": {
    "url": "https://sumsub.com/verify/...",
    "expiresAt": "2024-01-01T00:30:00.000Z"
  }
}
```

<Card title="API Reference: Generate a KYC verification URL" href="/v2/api-reference/users/getUserKycUrl" icon="arrow-right-left">
  View complete request parameters and response schema
</Card>

## KYC verification flow [#kyc-verification-flow]

After registration, users must complete identity verification:

Paytrie uses [Sumsub](https://sumsub.com), a third-party identity verification provider, to handle KYC. The `kyc-url` opens Sumsub's hosted flow, where users upload identity documents and complete a liveness check.

<Card title="Sumsub user verification guide" href="https://docs.sumsub.com/docs/user-verification" icon="shield-check">
  See what your users will encounter during the Sumsub verification flow
</Card>

<Steps>
  <Step>
    ### Redirect to verification [#redirect-to-verification]

    Use the `url` from the `GET /v2/users/{userId}/kyc-url` response to redirect the user to our KYC partner.
  </Step>

  <Step>
    ### User completes verification [#user-completes-verification]

    The user submits identity documents and completes the verification process.
  </Step>

  <Step>
    ### Verification complete [#verification-complete]

    Once verified, the user's status changes and you receive a webhook notification (if configured).
  </Step>

  <Step>
    ### Ready to transact [#ready-to-transact]

    The user can now authenticate and make transactions.
  </Step>
</Steps>

<Callout type="info">
  Set up [Webhooks](/v2/webhooks) to receive notifications when users complete
  verification.
</Callout>

## Alternative: Sumsub reusable KYC [#alternative-sumsub-reusable-kyc]

If your users have already completed KYC through Sumsub on your platform, you can import their verification data to skip the KYC step. See [Sumsub Reusable KYC](/v2/integrations/sumsub-kyc) for details.
