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

# Coupa agent

> Let Upflow's agent create your invoice drafts in Coupa: connect Coupa, choose which customers go through it, then review and submit each draft.

The Coupa agent creates your invoice drafts in Coupa for you. Your team no longer types each invoice into the Coupa Supplier Portal: you review the draft the agent saved, and submit it.

With the Coupa agent, you can:

* Route the customers who require Coupa to it, one by one, in bulk or with a smart rule
* Get a draft in Coupa for each new invoice, with the buyer, PO, lines, tax and PDF already filled in
* Follow each Coupa invoice from Upflow, from draft to approval and payment

> [!NOTE]
>
> The Coupa agent is enabled on request. To get it set up, talk to your CSM or [contact our Support team](https://docs.upflow.io/en-us/essentials/get-started/contact-our-support-team.md).

## Before you start

Each invoice for your Coupa customers needs a **PO number**, synced from your accounting or billing system.

![The AP portal agent settings card listing Coupa as Active and Ariba as Coming soon](https://mintcdn.com/upflow-04dc27cd/JP07dogDyUVJ8iCt/images/image-46.png?fit=max\&auto=format\&n=JP07dogDyUVJ8iCt\&q=85\&s=e5ab328de1fa3dcf61951af5fa858578)

## Connect Coupa

1. Go to [**Settings → AP Portal**](https://app.upflow.io/organization/-/settings/ap-portal) and open **Coupa**.
2. Under **Copy this email**, copy the agent's email address.
3. Click **Open Coupa** and invite that email address as a user in your Coupa account.
4. Back in Upflow, the card shows **We are setting up your Coupa account**. The agent accepts the invite and completes the sign-up on its own, which takes a few minutes. You don't have anything else to do.

Once Coupa is connected, choose how the draft actions are handled in **Settings**:

* **Assignee(s)**: who works on the Coupa actions
* **Trigger**: when the action is due, in days after the invoice issue date
* **Automate this action**: when on, the agent creates each draft on its own. When off, the draft is a manual task to start yourself.

> [!NOTE]
>
> If you run several Upflow organizations on the same Coupa account, connect Coupa in each organization. Each one gets its own agent email, and you invite every one of them into the same Coupa account.

![The Coupa settings in Upflow, showing the agent email to copy, the Trigger in days after issue date, the Assignee(s) set to Owners and the Automate this action toggle turned on](https://mintcdn.com/upflow-04dc27cd/JP07dogDyUVJ8iCt/images/image-45.png?fit=max\&auto=format\&n=JP07dogDyUVJ8iCt\&q=85\&s=3fcd22757e0ee249c96816ca92624116)

## Choose which customers go through Coupa

Set **Invoice delivery** to **Coupa** on each customer you invoice through Coupa:

* **One customer**: open the customer page and set **Invoice delivery** in the main information block.
* **Several customers**: from the customer list, select them, then click **Actions → Change invoice delivery**.
* **Automatically**: use the **Set invoice delivery** action in a [customer smart rule](https://docs.upflow.io/en-us/collection-and-collaboration/smart-rules/customer-smart-rules.md).

If a customer has a different name in Coupa, fill in **Coupa customer name** on the customer page. Otherwise, the agent looks the customer up by its Upflow name.

> [!WARNING]
>
> Customers set to Coupa no longer receive the Upflow invoice email. Their invoices go through Coupa only.

![A customer page with Invoice delivery set to Coupa and the Coupa customer name filled in as Acme Inc.](https://mintcdn.com/upflow-04dc27cd/JP07dogDyUVJ8iCt/images/image-47.png?fit=max\&auto=format\&n=JP07dogDyUVJ8iCt\&q=85\&s=62291c4378e86b37f605023454deb402)

## Review and submit each draft

Each new invoice for a Coupa customer gets two actions, one after the other.

1. **AP Portal - Draft creation**: the agent logs in to Coupa, finds the buyer and the PO, fills in the invoice lines and tax, and attaches the PDF. It checks that Coupa's total matches your invoice total before saving the draft. If the action is manual, open it and click **Create draft**.
2. **AP Portal - Draft submission**: click **Open draft** to review the draft in Coupa, submit it there, then click **Mark as submitted** in Upflow.

The invoice stays **Unsent** until you mark it as submitted. It then moves on to its due date, and collection carries on as usual.

> [!TIP]
>
> Already submitted an invoice directly in Coupa? Ignore the draft action. Ignoring it also marks the invoice as submitted.

## Follow each invoice in Coupa

Once an invoice is submitted, Upflow keeps its status up to date as your customer processes it in Coupa. You don't need to log in to Coupa to check where an invoice stands.

The **AP portal status** shows on the invoice page. You can also add it as a column to your invoice list, or filter on it:

<table>
  <colgroup>
    <col width="200" />

    <col width="523" />
  </colgroup>

  <thead>
    <tr>
      <th>Status</th>
      <th>What it means</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Pending submission**</td>
      <td>The draft hasn't been submitted yet.</td>
    </tr>

    <tr>
      <td>**Submitted**</td>
      <td>The invoice is submitted and waiting for your customer's approval.</td>
    </tr>

    <tr>
      <td>**Approved**</td>
      <td>Your customer approved the invoice for payment.</td>
    </tr>

    <tr>
      <td>**Disputed**</td>
      <td>Your customer disputed the invoice in Coupa. Once the dispute is resolved, it goes back to **Submitted**.</td>
    </tr>

    <tr>
      <td>**Abandoned**</td>
      <td>The invoice was abandoned in Coupa.</td>
    </tr>

    <tr>
      <td>**Paid**</td>
      <td>Your customer marked the invoice as paid in Coupa.</td>
    </tr>
  </tbody>
</table>

If your customer approves, disputes or pays an invoice before you've marked it as submitted, Upflow marks it as submitted for you.

> [!NOTE]
>
> Status updates rely on Coupa's notifications in English, and on the invoice number in Coupa matching the one in Upflow.

## When a draft can't be created

If the agent can't create a draft, the action shows why. Fix the cause, then retry.

| Message | What to do |
| - | - |
| Invoice is missing a PO number | Add the PO number to the invoice in your accounting or billing system and let it sync. |
| This customer isn't available in Coupa | Fill in **Coupa customer name** on the customer page with the name used in Coupa. |
| We couldn't find this PO number in Coupa | Check that the PO number matches an open purchase order in Coupa. It may be closed or already fully invoiced. |
| The purchase order total doesn't match the invoice | Coupa pre-filled a different amount or currency from the PO, so no draft was saved. Reconcile the PO with the invoice in Coupa first. |
| This invoice has no PDF to attach | Make sure the invoice has a PDF, then try again. |
| The draft didn't appear in Coupa | Check Coupa before retrying, so you don't end up with a duplicate draft. |
| We couldn't sign in to Coupa | The agent's Coupa account was removed or locked. Disconnect Coupa and connect it again (see below). |

For any other error, try again once. If it keeps failing, [contact our Support team](https://docs.upflow.io/en-us/essentials/get-started/contact-our-support-team.md).

## Disconnect Coupa

Go to [**Settings → AP Portal**](https://app.upflow.io/organization/-/settings/ap-portal), open **Coupa** and click **Disconnect Coupa**. The agent stops creating drafts.

To reconnect later, follow the steps in [Connect Coupa](#connect-coupa) again. You get a new agent email, which you need to invite in Coupa.

## Related articles

* [Send invoices from Upflow](https://docs.upflow.io/en-us/collection-and-collaboration/send-invoices-from-upflow/overview.md)
* [Customer smart rules](https://docs.upflow.io/en-us/collection-and-collaboration/smart-rules/customer-smart-rules.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.