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

# Screen Supplier Payments

> Screen supplier payment batches prepared to be sent by the ERP. Fetch a list of warnings connected to the payments. Hold the risky ones, and release the rest.

* **Trigger –** Supplier Payment run created in ERP
* **Cadence –** Per run or daily.
* **Mode –** Asynchronus / Poll
* **Product –** Inyett Payment Control

# Process

```mermaid theme={null}
flowchart LR
    ERP["ERP payment run<br/>N transactions"] --> POST["POST /batches"]
    POST --> OK["200 OK<br/>accepted, not analysed"]

    OK --> Poll["Poll loop<br/>every 2-3 seconds"]
    OK --> Queue["Analysis queue"]

    Queue --> Engine["Engine<br/>31 rules per transaction"]
    Engine -.-> Status{"AnalyzeStatus"}

    Status -->|Enqueued or Analyzing| Poll
    Status -->|Error| StopPoll["Stop polling<br/>resubmit new id"]
    Status -->|Pending| Dupes["95 percent duplicates<br/>likely a resend"]
    Status -->|Done| Warnings["warnings array"]

    Warnings --> AnyWarn{"Any warnings<br/>for this row?"}
    AnyWarn -->|Yes| Hold["Hold the payment<br/>route to reviewer"]
    AnyWarn -->|No| Release["Release to bank"]

    Hold --> Resolve["Reviewer resolves in portal<br/>Completed or CompletedWithAction"]
```

# Step by step

1. Export the pending payment run from your ERP
2. Submit the whole batch with your own external IDs.<br />`POST /2/{pc}/payment-control/batches`
3. Receive 200 — Accepted, not analysed
4. Poll every 2 – 3 seconds until the status settles.<br />`GET /2/{pc}/payment-control/batches/{externalBatchId}/warnings`
5. On Done, map warnings back by `TransactionExternalId`
6. Hold flagged rows, release the rest to the bank.
7. If the run is cancelled upstream, revoke the batch.<br />`DELETE /2/{pc}/payment-control/batches/{externalBatchId}`

<Note>
  The single most common integration bug is treating the POST response as the result. A 200 means *accepted for analysis*. Read warnings immediately and you will get an empty list and wrongly release a fraudulent payment.
</Note>
