# How it works (https://docs.chargeflow.io/docs/platforms/eaas/how-it-works)



This page walks through the end-to-end setup for integrating Evidence-as-a-Service into your platform.

<Steps>
  <Step>
    ## Obtain a Chargeflow Connect account [#obtain-a-chargeflow-connect-account]

    Chargeflow invites your team to a dedicated Connect account. From there you can generate API keys, register webhooks, and make your first EaaS calls. A dedicated [sandbox](https://docs.chargeflow.io/docs/platforms/sandbox) is coming soon; until then, API keys act on your live account.

    <Callout title="Info">
      Your account manager must enable EaaS on your Connect account before EaaS API calls will succeed. Without this entitlement, calls return `403_eaas_not_enabled`.
    </Callout>
  </Step>

  <Step>
    ## Generate API keys and subscribe to webhooks [#generate-api-keys-and-subscribe-to-webhooks]

    After accepting your invitation, navigate to the **Developer Hub** inside the Connect UI and generate your API keys. Keys act on your live account - see [Test credentials](https://docs.chargeflow.io/docs/reference/api-fundamentals/test-credentials).

    Then subscribe to the two EaaS lifecycle webhooks:

    | Event            | Trigger                              | Behavior                                                                                      |
    | ---------------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
    | `evidence.ready` | Evidence generation completed.       | A versioned PDF is ready for review and submission to your PSP.                               |
    | `evidence.error` | An error occurred during generation. | Chargeflow retries automatically; on final failure, sends detailed error info in the payload. |

    <Callout type="idea" title="Tip">
      Verify the signature on incoming webhook deliveries to confirm they originate from Chargeflow -
      see [Webhooks](https://docs.chargeflow.io/docs/reference/concepts/webhooks) for the verification flow.
    </Callout>

    For the full payload shapes and field references, see [`evidence.ready`](../webhook-events#evidence-ready) and [`evidence.error`](../webhook-events#evidence-error).
  </Step>

  <Step>
    ## Create a merchant entity [#create-a-merchant-entity]

    For each merchant on your platform, create a corresponding Chargeflow account entity using the Accounts API. This tells Chargeflow who the merchant is so it can enrich their profile and tailor evidence strategies to their business.

    Required fields: `business_name`, `business_url`, `email`, `owner_name`.

    See [Onboard a Merchant](./onboard-a-merchant) for the full request example.
  </Step>
</Steps>

## Integration patterns [#integration-patterns]

Once your merchants are set up, you can choose how to trigger evidence generation:

### Platform-managed automation [#platform-managed-automation]

Disputes are detected by your platform (via PSP webhooks or polling). When a dispute arrives in `needs_response` state, your platform calls the Generate Evidence API automatically, with no merchant action required.

This pattern provides the fastest response time and requires the least merchant involvement.

### Merchant self-serve [#merchant-self-serve]

Your platform creates a dispute record in Chargeflow and surfaces an "Generate Evidence" action in your merchant portal. Merchants can review and enrich the dispute with additional context via the [Enrich a Dispute](https://docs.chargeflow.io/docs/merchants/automation/enrich-a-dispute) flow before triggering generation.

The platform always calls the Generate Evidence API; merchants never call it directly.

## Next steps [#next-steps]

<Cards>
  <Card title="Generate & regenerate evidence" href="./generate-and-regenerate">
    API details, request/response examples, and error codes.
  </Card>

  <Card title="Privacy & security" href="./compliance">
    How Chargeflow handles your data.
  </Card>
</Cards>
