> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/guides/coupa-purchase-to-pay.md).

# Coupa purchase to pay: see where each purchase order waits

Connect Coupa to Duaer. It reads the requisitions, receipts, invoices and payments of each purchase order through the Coupa Core API, so you see where orders wait and for how long.
## What does Duaer read from Coupa?

Each purchase order is a case, with the supplier, currency and order amount (the sum of its line totals). Without an order number, the order ID is used. The steps, each on the date as Coupa writes it, are:

- Requisition created: when the order's requisition was created.
- Order created: when the purchase order was created.
- Goods received: the transaction date of each receipt of the order; voided receipts are left out.
- Invoice posted: the invoice date of invoices with a line on the order; draft, voided, abandoned and withdrawn invoices are left out.
- Paid: the payment date of each payment recorded on those invoices.
- Canceled orders are not read. The steps match the purchase to pay template, so the purchase to pay board in My processes on the employee portal works as it is; refer to [process findings](/build/process-findings.md#purchase-to-pay).

## How do you connect Coupa to Duaer?

1. As a Coupa admin, open Setup › Oauth2/OpenID Connect Clients and create a client with the client credentials grant and these read scopes: core.purchase_order.read, core.requisition.read, core.invoice.read and core.inventory.receiving.read. After saving, note the Identifier (client ID) and the Secret.
2. In Duaer, create a Coupa API credential with the instance host (like acme.coupahost.com, without https://), the client ID and the client secret. The scopes default to the four above; change them only if your client has others.
3. As an owner or admin, open Data sources in the sidebar, select Add source, choose Coupa under Purchase to pay, choose the credential and select Check instance. Any resource the client cannot read is listed with its status code.
4. The mapping is fixed. Preview, set the schedule and who sees the cases, and confirm.

## How often does it read, and how much?

Each run reads two streams, one page each at most (Coupa returns up to 50 records a page): purchase orders by change (with their requisitions, receipts, invoices and payments) and invoices by change (with their payments and their order's receipts). A payment changes its invoice, so new payments arrive with the invoice. Each stream reads a time window to its end, then goes on from there; a first read covers all past orders and invoices and finishes over several runs. A step is never written twice. Read only: Duaer never writes to Coupa.

## What are the limits?

- The field names follow Coupa's published Core API reference and are not yet checked against a real instance; the first real read may need adjustments.
- Receipts are found by the order of their order line, and invoices by the order number on their lines. If an instance ignores these filters, Duaer still checks the order, so another order's receipts or invoices are never counted.
- Approvals, change orders, returns and credit memos, expense reports and Coupa Pay virtual cards are not read yet.
## Questions

### Does Duaer change data in Coupa?

No. Duaer only reads from the Coupa Core API, with read scopes.

### Can I connect a test instance?

Yes. Enter the test instance host (for example acme-test.coupahost.com) and a client created in that instance.

## Related

- [Add a process source in Duaer](https://doc.duaer.com/build/process-sources.md)
- [See the process in your data and generate workflows in Duaer](https://doc.duaer.com/build/process.md)
- [Process findings and SOP conformance in Duaer](https://doc.duaer.com/build/process-findings.md)
- [SAP S/4HANA purchase to pay: see where each order waits](https://doc.duaer.com/guides/sap-s4hana-purchase-to-pay.md)
- [Workday purchase to pay: see where each purchase order waits](https://doc.duaer.com/guides/workday-purchase-to-pay.md)

