> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reap.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start KYB for a company and handle the outcome via webhooks.

## Goal

This guide walks you through the KYB flow end-to-end. By the end, you will have an `ACTIVE` company that is ready for account creation and card issuance.

<Steps>
  <Step title="Create a company">
    Call [Create a company](/api-reference/companies/create-company) with a display name. The response includes a company `id` you will use for all subsequent calls. The company starts with `status: CREATED`.
  </Step>

  <Step title="Create a company application">
    Call [Create company application](/api-reference/companies/create-company-application) with the company `id`. The response includes a `sessionUrl`. Direct the company representative to this URL to complete the corporate verification form.

    The company status advances to `PENDING` once the application is created.
  </Step>

  <Step title="Handle related persons">
    During the verification flow, Reap identifies the company's officers and beneficial owners. Poll [List related persons](/api-reference/companies/list-related-persons) to detect when new related persons appear.

    For each related person, retrieve their active application via [List related person applications](/api-reference/companies/list-related-person-applications) to get the `sessionUrl`. Send this URL to the individual so they can complete their KYC.

    Repeat this for every related person. The company cannot advance to `IN_REVIEW` until all related persons reach `APPROVED`.
  </Step>

  <Step title="Handle the company status webhook">
    When all verification inputs are received and Reap's compliance review completes, Reap fires a `COMPANY_STATUS_UPDATED` event. See the [COMPANY\_STATUS\_UPDATED](/api-reference/company-status-updated) for the full payload schema.

    Handle the `status` in the event:

    * `IN_REVIEW`: inputs are received and the review is in progress.
    * `ACTIVE`: company is verified. Proceed to account creation and card issuance.
    * `REJECTED`: verification failed. Contact your account manager.
    * `RESTRICTED`: company has been restricted. Contact your account manager.
  </Step>
</Steps>

***

## Testing in sandbox

In the sandbox environment, use the simulation endpoint to move a company to any target status without running real verification. The update is processed asynchronously. Wait for the `COMPANY_STATUS_UPDATED` webhook rather than polling.

See [Simulate company status](/api-reference/simulation/simulate-company-status) in the API reference for the full request schema, including the required `applicationDetails` fields when simulating `ACTIVE`.

### Scenario 1: Happy path (approved)

1. [Create a company](/api-reference/companies/create-company)
2. [Create company application](/api-reference/companies/create-company-application)
3. [Simulate company status](/api-reference/simulation/simulate-company-status) with `{ "status": "ACTIVE", "applicationDetails": { ... } }`
4. Confirm webhook received with `status: "ACTIVE"`
5. [Create an account](/api-reference/accounts/create-account) scoped to the company

### Scenario 2: In review, then approved

1. [Create a company](/api-reference/companies/create-company)
2. [Create company application](/api-reference/companies/create-company-application)
3. [Simulate company status](/api-reference/simulation/simulate-company-status) with `{ "status": "IN_REVIEW" }`
4. Confirm webhook received with `status: "IN_REVIEW"`
5. [Simulate company status](/api-reference/simulation/simulate-company-status) with `{ "status": "ACTIVE", "applicationDetails": { ... } }`
6. Confirm webhook received with `status: "ACTIVE"`

### Scenario 3: Rejected

1. [Create a company](/api-reference/companies/create-company)
2. [Create company application](/api-reference/companies/create-company-application)
3. [Simulate company status](/api-reference/simulation/simulate-company-status) with `{ "status": "REJECTED" }`
4. Confirm webhook received with `status: "REJECTED"`
