> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sumsub Token Sharing

> Reuse a customer's existing Sumsub verification with a share token instead of re-collecting their KYC.

<Info>
  Sumsub token sharing is only available for Consumer Card Programs.
</Info>

Sumsub token sharing works in both sandbox and production. Run this flow twice, once for sandbox and once for production.

<Warning>
  Your Sumsub environment must match Rain's environment. Tokens generated from a **production** Sumsub instance will not work in Rain's **sandbox**, and vice versa. Ensure you are using the correct Sumsub environment for the Rain environment you are integrating with.
</Warning>

This flow has two phases: connect your Sumsub account to Rain once per environment (steps 1-4), then generate and send a share token for each applicant you verify (steps 5-6).

<Steps>
  <Step title="Request a donor key">
    Contact Rain to request a donor key for the desired environment (sandbox or production).
    Sandbox and production environments require separate donor keys. Request a sandbox key first to test the integration, then request a production key when you are ready to go live.
    The key will look something like `eyJ...`.
  </Step>

  <Step title="Switch your Sumsub instance to the right environment">
    In your Sumsub dashboard, toggle the environment from Production to Sandbox. A yellow banner indicating "You're in Sandbox mode" appears when sandbox is active. Remember the key needs to match the environment.

    <Frame caption="The yellow banner indicates you are in sandbox mode">
      <img src="https://mintcdn.com/rain-sandbox-trial/m2BHTd0fr_FUhXAv/images/docs/sumsub-sandbox-mode-banner.png?fit=max&auto=format&n=m2BHTd0fr_FUhXAv&q=85&s=30fffb5f5c514b757913159d63e02e48" alt="Sumsub sandbox mode banner" width="3022" height="200" data-path="images/docs/sumsub-sandbox-mode-banner.png" />
    </Frame>
  </Step>

  <Step title="Add Rain as a recipient">
    1. Navigate to **Reusable Identity > Partners > Recipients** in your Sumsub dashboard
    2. Click **Add recipient**
    3. Enter the donor key that Rain provided
    4. Click **Continue** to complete the setup

    <Frame caption="The Recipients page in Sumsub">
      <img src="https://mintcdn.com/rain-sandbox-trial/m2BHTd0fr_FUhXAv/images/docs/sumsub-recipients-page.png?fit=max&auto=format&n=m2BHTd0fr_FUhXAv&q=85&s=21319af5dca8e4bf4413538b20a99d24" alt="Sumsub Recipients page" width="3024" height="1712" data-path="images/docs/sumsub-recipients-page.png" />
    </Frame>

    <Frame caption="Enter the donor key in the Add recipient dialog">
      <img src="https://mintcdn.com/rain-sandbox-trial/m2BHTd0fr_FUhXAv/images/docs/sumsub-add-recipient-dialog.png?fit=max&auto=format&n=m2BHTd0fr_FUhXAv&q=85&s=f9e1c90521cf5a7feaf78ae3ee9eea6f" alt="Add recipient dialog" width="3024" height="1712" data-path="images/docs/sumsub-add-recipient-dialog.png" />
    </Frame>
  </Step>

  <Step title="Turn on the required fields">
    Your Sumsub instance must be configured to collect the following fields for Rain to process the consumer application.

    | Sumsub field          | Description                                                      |
    | --------------------- | ---------------------------------------------------------------- |
    | `firstName`           | The person's first name                                          |
    | `lastName`            | The person's last name                                           |
    | `birthDate`           | The person's birth date                                          |
    | `tin`                 | The person's national ID (9-digit SSN if country of issue is US) |
    | `countryOfIssue`      | The country that issued the national ID                          |
    | `email`               | The person's email address                                       |
    | `phoneNumber`         | The user's phone number (ITU-T E.164 format)                     |
    | `address.line1`       | Address line 1                                                   |
    | `address.city`        | City                                                             |
    | `address.region`      | State or region                                                  |
    | `address.postalCode`  | Postal code                                                      |
    | `address.countryCode` | Country code (ISO 3166-1 alpha-2 format)                         |

    <Info>
      Make sure all required fields are enabled in your Sumsub applicant data settings before generating share tokens. Missing fields will cause the application to fail.
    </Info>
  </Step>

  <Step title="Generate a share token">
    Generate a share token in your Sumsub for each applicant you want to verify with Rain. A share token is single-use and looks like `_act-sbx-j...`. You can generate one in two ways:

    * Use the Sumsub endpoint to [generate a share token](https://docs.sumsub.com/reference/generate-share-token). Pass in Rain's client ID `raincards.xyz_43942` in Sumsub's `forClientId` field.
    * Generate it directly from the Sumsub website

      1. Open a production or sandbox applicant in Sumsub
      2. Click the three-dot menu (⋮) in the top-right corner
      3. Select **Generate share token**
      4. Click **Generate** to create the token
      5. Copy the token.

          <Frame caption="Select Generate share token from the menu">
            <img src="https://mintcdn.com/rain-sandbox-trial/m2BHTd0fr_FUhXAv/images/docs/sumsub-generate-share-token-menu.png?fit=max&auto=format&n=m2BHTd0fr_FUhXAv&q=85&s=3c0cf3ec9120dfa08a38f16d68331bbc" alt="Generate share token menu option" width="3024" height="1506" data-path="images/docs/sumsub-generate-share-token-menu.png" />
          </Frame>

          <Frame caption="Copy the generated share token">
            <img src="https://mintcdn.com/rain-sandbox-trial/m2BHTd0fr_FUhXAv/images/docs/sumsub-generated-share-token.png?fit=max&auto=format&n=m2BHTd0fr_FUhXAv&q=85&s=b6b06cdd6db5c07771cada39d3f4514b" alt="Generated share token dialog" width="3024" height="1498" data-path="images/docs/sumsub-generated-share-token.png" />
          </Frame>
  </Step>

  <Step title="Use the share token in your application">
    When creating a [consumer application](/reference/applications/create-a-consumer-application-for-a-user), use the share token you generated in Step 5 and pass it in through Rain's `sumsubShareToken` field. You must still submit other required fields, such as the user's occupation, salary, and phone number, but most of the user fields can be omitted. The endpoint reference lists every required field.
  </Step>
</Steps>

## Troubleshooting

If you encounter the error **"Token is invalid, make sure you generate a new one each time, because the old ones are invalidated upon usage"**, check for these common causes:

| Issue                   | Solution                                                                                                                                                                                                          |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Token already used      | Share tokens can only be used once. Generate a new token for each application submission.                                                                                                                         |
| Wrong environment       | Make sure you are in the desired environment. If testing in sandbox, switch the toggle from Production to Sandbox in your Sumsub dashboard. You should see the yellow "You're in Sandbox mode" banner at the top. |
| Missing required fields | Ensure all required fields are filled in the Sumsub application before generating the token.                                                                                                                      |

## What's next

<Columns cols={3}>
  <Card title="Share a Persona token" icon="arrows-rotate" href="/docs/persona-token-sharing">
    Do the same with Persona instead of Sumsub.
  </Card>

  <Card title="Create a consumer application" icon="code" href="/reference/applications/create-a-consumer-application-for-a-user">
    Submit the application with your share token.
  </Card>

  <Card title="Reuse an existing verification" icon="arrows-rotate" href="/docs/reuse-existing-verification">
    Compare this against the other ways to avoid re-collecting identity.
  </Card>

  <Card title="Verification requirements" icon="shield-check" href="/docs/verification-requirements">
    Fields and screening Rain still applies.
  </Card>
</Columns>
