# Automate dispute management (https://docs.chargeflow.io/docs/merchants/automation/automate-dispute-management)



You have connected your PSPs and want disputes fought automatically. Chargeflow runs the whole pipeline on its own - this guide shows the two places your integration actually does work, and how to wire them.

The full ingest → enrich → generate → submit → monitor model is taught canonically in [Dispute Automation Engine](https://docs.chargeflow.io/docs/reference/concepts/dispute-automation). Your integration touches it in exactly two places, both optional but high-impact:

| Pipeline stage                                      | Who acts                                                             |
| --------------------------------------------------- | -------------------------------------------------------------------- |
| Ingest · first enrichment · generation · submission | Chargeflow, automatically                                            |
| **Second enrichment**                               | **You** - send targeted signals the engine can't retrieve on its own |
| **Monitor**                                         | **You** - read status, or subscribe to lifecycle webhooks            |

<Steps>
  <Step>
    ## Connect your PSPs [#connect-your-psps]

    Connect your payment processors in Chargeflow Settings. From then on, every new dispute from those processors is ingested and enriched automatically - you do not poll any PSP API or import disputes by hand.
  </Step>

  <Step>
    ## Subscribe to `dispute.created` [#subscribe-to-disputecreated]

    Register a webhook endpoint so your enrichment flow triggers the moment a dispute is ingested. See [Subscribe to webhook events](./subscribe-to-events) for registration, and [dispute.created](../webhook-events#dispute-created) for the payload.
  </Step>

  <Step>
    ## Send a second enrichment (the high-impact step) [#send-a-second-enrichment-the-high-impact-step]

    This is where your integration adds the most win-rate. After `dispute.created`, inspect what Chargeflow already matched (transaction, order, subscription) and fill the gaps by calling the enrich endpoint with the data only you have - order details, subscription history, customer activity, communications.

    See [Enrich a dispute](./enrich-a-dispute) for the PATCH endpoint, upsert semantics, and array-merge behavior.

    <Callout type="idea" title="Tip">
      Enrich as early as possible after `dispute.created`. Chargeflow folds your signals into the evidence package before submission - the sooner they arrive, the more the engine can build around them.
    </Callout>
  </Step>

  <Step>
    ## Track the outcome [#track-the-outcome]

    Chargeflow generates, submits, and monitors the case for you - you never call a submit endpoint or touch the processor's dispute API. To follow progress, read the dispute (`status` moves `needs_response` → `under_review` → `won`/`lost`) or subscribe to lifecycle webhooks and feed your own dashboards.
  </Step>
</Steps>

## Next step [#next-step]

<Card title="Enrich a dispute" href="./enrich-a-dispute">
  Send the signals that move win rate - the PATCH endpoint and merge behavior.
</Card>

Building the whole thing end-to-end? Follow the [Automate a chargeback dispute](./automate-a-chargeback-dispute) recipe.
