# Sumsub Reusable KYC



If your users have already completed KYC verification through Sumsub with your platform, you can import their verification data to Paytrie. This eliminates the need for users to complete identity verification again.

## Overview

Sumsub's Reusable KYC feature allows identity verification data to be shared between platforms. As a "Donor" platform, you generate a share token for a user's verification data, which Paytrie then imports as the "Recipient" platform.

## Prerequisites

* Your platform must be integrated with [Sumsub](https://sumsub.com/)
* The user must have completed KYC verification on your platform
* You must have API access to generate Sumsub share tokens
* The user must already exist in Paytrie (create them first using `generateApiLink`)
* The Sumsub applicant must be enrolled and verified in the `id-and-liveness` verification level

## Integration flow

<Steps>
  <Step>
    ### Create API user in Paytrie

    Register the user in Paytrie first using `generateApiLink` so the import can
    map the Sumsub applicant to an existing Paytrie user.
  </Step>

  <Step>
    ### Generate share token

    Use the Sumsub API to generate a share token for the user's verification
    data from an applicant verified in the `id-and-liveness` level.
  </Step>

  <Step>
    ### Submit to Paytrie

    Send the share token to the Paytrie import endpoint.
  </Step>

  <Step>
    ### User verified

    If successful, the user is automatically verified on Paytrie without
    additional KYC.
  </Step>
</Steps>

## Quick start

### 1. Create the user in Paytrie

Create the Paytrie user first:

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

<Card title="API Reference: Generate API Link" href="/docs/api-reference/registration/postGenerateApiLink" icon="arrow-right-left">
  View complete request parameters and response schema
</Card>

### 2. Generate a share token (Sumsub API)

Use the Sumsub API to generate a share token for a specific applicant that is
verified in your Sumsub `id-and-liveness` level:

```bash
curl -X POST "https://api.sumsub.com/resources/applicants/{applicantId}/shareToken" \
  -H "X-App-Token: your-sumsub-token" \
  -H "X-App-Access-Sig: your-signature" \
  -H "X-App-Access-Ts: timestamp"
```

See the [Sumsub documentation](https://docs.sumsub.com/reference/generate-share-token) for complete details.

### 3. Import to Paytrie

Submit the share token to import the user's verification:

```bash
curl -X POST "https://api.paytrie.com/sumsubImportUser" \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "share_token": "_act-sb-jwt-eyJHGCi........tN0."
  }'
```

<Card title="API Reference: Import Sumsub User" href="/docs/api-reference/sumsub/postSumsubImportUser" icon="arrow-right-left">
  View complete request parameters and response schema
</Card>

## Common errors

| Error                              | Description                                         | Solution                                                                     |
| ---------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------- |
| Token expired                      | The share token has expired                         | Generate a new share token                                                   |
| Token invalid                      | The share token is malformed                        | Verify the token format                                                      |
| Applicant not found                | The applicant doesn't exist in Sumsub               | Verify the applicant ID                                                      |
| Verification incomplete            | The user hasn't completed verification              | Ensure KYC is complete before generating token                               |
| Share token not suitable for level | The share token comes from a different Sumsub level | Enroll and verify applicants in `id-and-liveness`, then generate a new token |

## Additional resources

<Cards>
  <Card title="Sumsub Reusable KYC" href="https://docs.sumsub.com/docs/reusable-kyc" icon="external-link">
    Sumsub's official documentation on Reusable KYC
  </Card>

  <Card title="Generate Share Token" href="https://docs.sumsub.com/reference/generate-share-token" icon="external-link">
    API reference for generating share tokens
  </Card>

  <Card title="Error Codes" href="https://docs.sumsub.com/reference/reuse-applicant-for-reusable-kyc#error-codes-with-descriptions" icon="external-link">
    Complete list of Sumsub error codes
  </Card>
</Cards>
