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

# Coupa

> Connect Coupa so procurement records can start legal work in Chamelio, and legal's decisions, comments and signed contracts can go back to Coupa.

On request

Coupa is set up per organization with your Chamelio legal engineer. Configuration is validated for each customer's Coupa tenant.

This guide describes how Coupa and Chamelio can work together. Once it's configured and tested for your Coupa instance, eligible procurement records can start legal work in Chamelio, and selected legal decisions, comments and signed-contract information can go back to Coupa. Procurement stays in Coupa while legal works in Chamelio and Word.

What runs for your organization depends on the workflows you approve, the Coupa modules you have, the API permissions you grant and the integration functions enabled for your tenant.

## What your teams get

| Capability | For procurement and the business | For legal |
| - | - | - |
| Automatic legal intake | Eligible records can create a legal request once triggers and mappings are configured | Vendor paper can be reviewed. The AI first-pass review depends on the selected Chamelio flow |
| Smart routing and notifications | Configured assignment and notification rules route legal work | Routing depends on the available Coupa fields and the Chamelio flow settings |
| Legal step inside Coupa approvals | A configured legal approval can stay pending in Coupa | An approval action is sent to Coupa only for the matching pending approval |
| Two-way comments and @mentions | Selected shared comments can appear in Coupa when comment sync is enabled | Word comments aren't Coupa comments automatically. Mapping and visibility are validated during setup |
| Executed contract write-back | The signed agreement and selected dates and terms can be available in Coupa Contracts | Requires contract mapping, the right API permissions and lifecycle handling |

## How it works

![Coupa and Chamelio exchange work in both directions: document events and the approval-chain legal step go from Coupa to Chamelio, comments sync both ways, and legal's decision and the executed contract go back to Coupa](https://mintcdn.com/chamelio/3CGo5DV87eS7IEga/assets/integrations/coupa/how-it-works.svg?fit=max\&auto=format\&n=3CGo5DV87eS7IEga\&q=85\&s=e3918b6d44a85a973d3ee9a2109587ec)

Illustrative only: each arrow works once that option is implemented for your tenant.

Depending on the options you implement, Coupa records can start legal flows, remote approvals can return a decision, and selected comments and executed-contract data can sync.

The integration has two patterns. You can run them side by side:

> [card] [Option 1: End-of-flow sync](#option-1-end-of-flow-sync)
>
> A supported Coupa event, such as an approved requisition or an issued purchase order, starts a Chamelio legal flow.

> [card] [Option 2: Mid-flow legal step](#option-2-mid-flow-legal-step)
>
> Configured as a Coupa remote approval, a requisition waits for legal's decision, which is then sent back to Coupa.

The design uses Coupa Core APIs and configurable integration endpoints. You can revoke Chamelio's access to the Coupa API at any time.

**What we need from you:** a Coupa administrator and owners from procurement and legal, to confirm the modules you have, create a scoped OAuth client, configure the supported call outs and approval rules, agree the field mappings, and test the workflows in a non-production tenant.

## Option 1: End-of-flow sync

When a configured and supported Coupa event happens, a call out notifies the integration. The integration reads the source record and starts the selected Chamelio flow. Coupa doesn't wait for the legal flow to finish, so this suits contracts negotiated after procurement approval.

| Coupa event | Typical Chamelio flow |
| - | - |
| Requisition approved | Vendor MSA or order form review |
| Purchase order issued | SOW or order form against an existing MSA |
| Supplier onboarding (module-specific trigger or polling) | NDA, DPA or supplier agreement, depending on your supplier onboarding setup |

**1. Coupa notifies the integration**

A Coupa Process Automator rule calls the integration endpoint on a supported document event. **Requisition Approved** and **Purchase Order Issued** are documented triggers. Supplier creation isn't a generic document event, so supplier onboarding needs its own trigger design.

**2. The integration reads the context**

It reads the authorized Coupa record, its lines, the supplier and requester, and any accessible attachments the flow needs.

**3. The Chamelio flow starts**

Available Coupa fields fill the configured Chamelio flow, required inputs are checked, and vendor paper can be attached. The AI first-pass review runs only if the flow includes it and a supported document is attached.

**4. Legal works in Chamelio**

Legal reviews the documents and, where enabled, edits in Word, negotiates and signs. Updates to Coupa, such as status or shared comments, need their own field mapping and sync. See [Comments and @mentions](#comments-and-@mentions).

**5. Chamelio writes back on signature**

* Finds or creates the matching Coupa contract, depending on required fields, record matching and your permissions.
* Adds the signed document through Coupa's legal-agreement operation and follows the supported contract lifecycle, including completion where it applies.
* Writes the agreed references or status fields to supported source records. Purchase orders get comments only, unless PO field updates are implemented and validated.

Agreements that start in Chamelio can also be linked to Coupa. A known Coupa supplier ID works best. Matching by tax ID or name needs ambiguity checks and can need manual confirmation.

## Option 2: Mid-flow legal step

A Coupa remote approval can pause an eligible requisition while legal reviews it in Chamelio. With a configured remote approver and a pending approval ID, the integration uses Coupa's Approvals API to approve, reject or, where supported, hold the step. A call out on its own doesn't set up the approval chain.

**One-time Coupa configuration**

1. Configure Coupa's supported **Call Out** or remote-approver mechanism, with its authentication, payload and endpoint set for your Coupa version and the Chamelio integration.
2. Configure the remote approver and the approval-chain conditions. Validate which requisitions are selected, the callback payload and the approval ID in a Coupa test tenant.

**1. The requisition reaches the legal step**

The integration receives or looks up the pending Coupa approval ID and reads the requisition.

**2. The Chamelio flow starts**

The integration reads the permitted requisition fields and attachments and starts the mapped Chamelio flow. The AI review runs only if the flow includes it and a document is supplied.

**3. Legal reviews in Chamelio**

Legal completes the configured review. **Hold** is an explicit Coupa approval action. Use it only where Coupa supports it and procurement agrees.

**4. Procurement sees progress**

If configured, procurement sees a Chamelio link, selected milestone fields or shared comments. Otherwise, Coupa shows only the approval state.

**5. Chamelio releases the step**

* **Approved**: if Coupa still shows the approval as pending, the integration sends the approve action. Signed-contract write-back runs separately, once a signed file is available and contract sync is enabled.
* **Rejected**: if the approval is still pending, the integration sends a rejection with the reason. Sending a requisition back for clarification is a separate business process, not a rejection.

**6. Coupa continues**

Coupa handles the next steps under its approval chain and requisition rules. The integration doesn't create the PO.

## Comments and @mentions

Comment sync is optional. It's designed, enabled and tested for each customer, and the first rollout can run without it. In that case, Coupa gets only the configured status fields or a link to the Chamelio task.

Coupa supports comments on requisitions and purchase orders. That doesn't by itself give real-time sync with the Chamelio task thread, Word comment sync or user notifications.

| Direction | What syncs | How |
| - | - | - |
| Chamelio → Coupa | Only Chamelio task comments explicitly approved for sharing | Posted to the linked Coupa record, if comment sync is implemented. Check comment visibility |
| Chamelio → Coupa | Mentions of mapped Coupa users (optional) | Uses Coupa's mention syntax. Notifications depend on Coupa settings |
| Coupa → Chamelio | New Coupa comments on linked records (optional) | Read on a schedule or through a supported change signal, deduplicated by comment ID |
| Chamelio → Coupa | Status milestones (in review, redlines sent, signed, rejected) | Configured writable custom fields, with an optional comment |

> [!NOTE]
>
> Only comments deliberately marked for procurement are exported. Internal legal notes, privileged analysis and redline history stay in Chamelio unless explicitly authorized. A Coupa comment can be visible to suppliers, so its visibility is reviewed before posting.

> [accordion] Scope
>
> Agree whether you need one-way updates from legal to procurement, two-way discussion, or status changes only. Start with a defined set of linked requisitions and purchase orders. Supplier and contract comments aren't included unless separately validated and scoped.

> [accordion] Chamelio to Coupa
>
> When a user explicitly shares a Chamelio task comment with procurement, the integration can post it to the linked Coupa requisition or purchase order, if the API and permissions are enabled. The author's name and a source link are kept. Coupa can't post as the Chamelio author. Word document comments aren't included by default.

> [accordion] Coupa to Chamelio
>
> The integration can read new comments from linked Coupa records on a schedule, or through a supported change notification if your environment has one. Imported comments appear in the related Chamelio task with their Coupa origin and author shown.

> [accordion] Mentions and notifications
>
> Mentions are converted for known, mapped Coupa users with Coupa's mention syntax. Unmapped users stay as plain text. Notifications depend on Coupa's configuration and each recipient's preferences.

> [accordion] Sync safeguards
>
> Each Coupa record and comment ID is stored with its Chamelio task and comment. Imports are deduplicated, echo loops are prevented, retries and temporary API failures are handled, and the last processed comment is recorded. How edits, deletions, attachments and visibility are handled is agreed during setup.

> [accordion] Setup and acceptance
>
> Before turning comment sync on, confirm the object types, read and write scopes, visibility settings, user mapping and update frequency. Test one-way and two-way comments, sharing consent, mentions, duplicate deliveries, failed writes, internal-only notes and supplier-visible comments in your Coupa test environment.

## Data exchanged

The data scope is limited to records connected to configured legal flows. Actual access is set by the Coupa scopes you grant and the integration's filters. OAuth scopes alone can allow broader access.

| Coupa object | Chamelio reads | Chamelio writes | Pattern |
| - | - | - | - |
| Requisitions | Header, lines, amount, commodity, attachments | Custom fields (status, link), comments | 1, 2 |
| Purchase orders | Header, lines, supplier | Comments. Custom fields only if separately validated | 1 |
| Suppliers | Name, tax ID, contacts, status | Custom fields (for example, NDA or MSA status, link) | Optional |
| Users | Requester and approver identity | - | 1, 2 |
| Approvals | The pending legal approval | Approve, reject, hold | 2 |
| Comments | Replies on linked requisitions and POs | New comments (if comment sync is enabled) | 1, 2 |
| Contracts | Existing contract (if linked) | Create or update the contract, upload the executed PDF as the legal-agreement file, supported lifecycle transition | 1, 2 |

### Default field mapping

The mapping is adjusted for each customer during setup.

| Coupa field | Direction | Chamelio field |
| - | - | - |
| Requisition, PO or supplier ID | Coupa → Chamelio | Linked source record |
| Supplier name, tax ID, primary contact | Coupa → Chamelio | Counterparty data. The signer is verified, not assumed |
| Total, currency | Coupa → Chamelio | Procurement amount as context. Contract value only after validation |
| Commodity, line descriptions | Coupa → Chamelio | Possible contract type or scope, depending on mapping |
| Requested by | Coupa → Chamelio | Requester |
| Attachments (vendor paper) | Coupa → Chamelio | Third-party paper for review |
| Executed PDF | Chamelio → Coupa | Signed legal-agreement file, if enabled |
| Effective and expiry date | Chamelio → Coupa | Executed contract start and end dates, if available |
| Contract title, number | Chamelio → Coupa | Contract name and number |
| Renewal, notice period, payment terms | Chamelio → Coupa | Mapped, supported Coupa contract fields only |
| Legal status, Chamelio link | Chamelio → Coupa | Configured writable custom fields (on POs only if validated) |

Your Coupa administrator confirms that each target custom field exists and can be written through the API. Field discovery, validation and mapping are done during setup.

## Triggers

Supported Coupa document events can trigger call outs where Process Automator is available and configured. Comments and unsupported onboarding changes can need scheduled retrieval or a module-specific process. The schedule is agreed per customer.

| Trigger | Configured in Coupa | Used for |
| - | - | - |
| Process Automator document event call out: requisition approved, PO issued | **Setup** > **Platform** > **Process Automator**, and **Setup** > **Integrations** > **Call Outs** | Option 1 |
| Remote approver call out in an approval chain | Call Outs and Approval Chains | Option 2 |
| Scheduled retrieval of comments and eligible changed records (if needed) | A configured integration job, not a Coupa setting | Comment sync, fallback for Options 1 and 2 |
| A legal request created in Chamelio and linked to a confirmed Coupa ID | Nothing | Option 1 write-back |

The call out payload can carry only an object type, source ID and event ID. The details are read through authorized API calls. Coupa payloads and field changes still need schema validation and integration maintenance.

## Set up Coupa

A Coupa administrator creates an OAuth 2.0 client for server-to-server Core API access. Grant only the permissions the agreed features need. The available scopes are confirmed in your tenant.

### Step 1: Create the OAuth client in Coupa

**1. Sign in to Coupa**

Sign in as an administrator with integration access.

**2. Create a client**

Go to **Setup** > **Integrations** > **Oauth2/OpenID Connect Clients** and click **Create**.

**3. Set the grant type**

Set **Grant type** to **Client credentials** (system-to-system, no user sign-in).

**4. Name it**

Name the client `Chamelio`, or follow your internal naming convention. Redirect URIs generally aren't used for this grant.

**5. Select the scopes**

Select the scopes from [Step 2](#step-2-select-scopes).

**6. Save and copy the credentials**

Click **Save**, then copy the client **Identifier** (client ID) and **Secret**.

### Step 2: Select scopes

Coupa Core API scopes are resource-specific. Use this table as a planning checklist, not a fixed set of grants. Check the exact names and permissions on your tenant's **Scope management** page (`/oauth2/scopes`).

| Scope | Grants | Needed for |
| - | - | - |
| Tenant-specific foundational scopes (verify; not blanket OAuth/OIDC scopes) | Only the access the chosen Core API operations need | As validated |
| `core.requisition.read` | Read requisitions, lines, attachments, comments | Options 1 and 2 |
| `core.requisition.write` | Requisition updates. Comment permission is validated separately | Options 1 and 2 |
| `core.purchase_order.read` | Read POs | Option 1 (PO trigger) |
| `core.purchase_order.write` | PO updates, only if enabled and supported | Comment sync on POs |
| `core.supplier.read` | Read supplier details and contacts | Options 1 and 2 |
| `core.supplier.write` | Update supplier custom fields (agreement status, link) | Optional supplier field updates |
| `core.user.read` | Match Coupa requesters and @mentions to people | Options 1 and 2 |
| `core.contract.read` | Read existing contracts and their files | Contract write-back |
| `core.contract.write` | Create and update contracts, upload the executed agreement | Contract write-back |
| `core.approval.read` | Read the current approval and its status | Option 2 |
| `core.approval.write` | Approve, reject or hold, as supported | Option 2 |

Enable only the scopes the selected features need. If a scope name differs on your instance, don't pick the closest one: confirm the resource and operation with your Coupa administrator before granting access.

### Step 3: Connect Coupa to Chamelio

**1. Agree the setup with Chamelio**

Your Chamelio legal engineer confirms how Coupa is connected for your deployment.

**2. Share the credentials securely**

Provide the Coupa tenant URL and the OAuth client credentials only through the secure setup process the Chamelio team sets up with you.

**3. Validate the connection**

During setup, token issuance and a read-only API call are checked before writes or approval actions are turned on.

**4. Get the call out details**

If call out triggers are used, the Chamelio team gives you the destination URL, authentication and tested request format to configure in Coupa.

> [!WARNING]
>
> Don't send client secrets by email or chat. Use the secure credential exchange agreed with the Chamelio team.

### Step 4: Configure triggers with the Chamelio team

1. **Option 1:** configure a Process Automator document-event action for an agreed, supported trigger, for example **Requisition Approved** or **Purchase Order Issued**. Supplier onboarding needs separately validated form or polling logic.
2. **Option 2:** configure and test the remote-approver integration and approval-chain conditions. Check the approval ID, payload and decisions in your tenant.
3. Create custom fields for legal status and the Chamelio link on supported Coupa objects, only where field write-back is needed and permitted.

## Implementation

Every Coupa setup is a little different, so a Chamelio engineer builds and configures the integration for your Coupa tenant together with your team. The timeline and the features depend on your Coupa setup and what your teams need.

Your Chamelio team will go over the scope with you, including the configuration, how flows start and link to Coupa records, the approval step, comment sync, credential handling, contract write-back, monitoring and support.
