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

# Coupa

Let's learn how to connect Engini to Coupa.

This integration connects Engini workflows with Coupa procurement and spend management, allowing you to start workflows when suppliers or other records are created or updated, read, create, update and delete records, submit requisitions and expense reports for approval, approve or reject pending approvals, manage purchase orders, add attachments, and send custom requests to the Coupa API directly from your workflows.

To get started, visit [Coupa](https://www.coupa.com) to get access to a Coupa instance.

## Add a Connection to Coupa in Engini

### Prerequisites

* A Coupa instance and its URL, for example `https://your-instance.coupahost.com`.
* An OAuth2 client (Client ID and Client Secret) created in Coupa, with the scopes your workflows need.

  **Note:** To approve or reject approvals, the client needs the `core.approval.read` and `core.approval.write` scopes. The supplier triggers need `core.supplier.read`.

### Retrieve your Coupa Client ID and Client Secret

1. Log in to your Coupa instance as an administrator.
2. Go to Setup > Oauth2/OpenID Connect Clients and click Create.
3. Set the Grant type to Client Credentials.
4. Enter a name and a unique login for the client, and fill in the contact details Coupa asks for.
5. Select the scopes you need: `core.approval.read` and `core.approval.write` for approvals, and `core.supplier.read` for the supplier triggers.
6. Save the client. Coupa shows the client's Identifier (your Client ID) and its Secret (your Client Secret).

### Connecting Engini to Coupa

1. Enter your Engini account at [https://app.engini.io](https://app.engini.io/).

2. Navigate to the Connections page by clicking on Connections in the left sidebar or by clicking [here](https://app.engini.io/connections).

   ![Engini - Connections page](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/connections-page.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=05699067ed4302807bc0b5a5f4925a76)

3. Click on the "New Integration" option located at the top bar.

   ![Engini - New Integration button](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/new-integration-button.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=952888561c5a1b686804103180eee31b)

4. Choose the Coupa option from the available applications.

   ![Coupa - Choose Application](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-choose-application.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=1045957c6a71faa29a3cf58c516b184d)

5. Enter the following details in the "New Integration" form and press Save:

   ![Coupa - New Integration form](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-new-integration.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=f03294ff0be78dfd9b65d7644541d3c3)

   <ol>
     <li>*Connection Name -* Enter a name that helps identify the Coupa connection.</li>
     <li>*Coupa Instance URL -* Enter the address of your Coupa instance, in the format `https://your-instance.coupahost.com`.</li>
     <li>*Client ID -* Enter the Identifier of the OAuth2 client you created in Coupa.</li>
     <li>*Client Secret -* Enter the Secret of the OAuth2 client.</li>
     <li>*Scopes -* Optional. Enter the scopes the connection may use, separated by spaces. The field comes filled with `core.approval.read core.approval.write core.supplier.read`, which covers Grant an Approval, Reject an Approval and both supplier triggers. Add any other scopes your Send API Request calls need.</li>
     <li>*Save -* Click Save to create the connection.</li>
   </ol>

There is no sign-in screen. Engini uses the Client ID and Client Secret to get an access token from your Coupa instance, so you don't need to add credentials to any action.

## Triggers

### Check for New Suppliers

Starts the workflow when new suppliers have been created in Coupa since the last check.

![Coupa - Check for New Suppliers trigger](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-check-for-new-suppliers.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=200e61631e8c0f34c061f8b78a92582a)

1. *Starting (UTC) -* Select the start date and time for the scheduled trigger.
2. *Recur every -* Choose the time interval for triggering and checking suppliers. The minimum time interval is 15 minutes.
3. *Add time frame -* You can specify a time frame during which the trigger will operate.
4. *Add Conditions -* Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-conditions).

   **Note:** Conditions return only the suppliers that match, for example Status equals active. The condition fields include ready-made ones such as Name Contains, Status Is Not and Created On Or After.

**Output:** Each run returns the suppliers created since the previous run, one record per supplier. Every record holds these fields:

* ID
* Name
* Display Name
* Supplier Number
* Status
* On Hold
* DUNS Number
* Tax ID
* Website
* Primary Contact
* Payment Method
* PO Method
* PO Email
* Invoice Matching Level
* Created At
* Updated At

### Check for Updated Suppliers

Starts the workflow when suppliers have been updated in Coupa since the last check.

![Coupa - Check for Updated Suppliers trigger](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-check-for-updated-suppliers.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=d264f82518b885b1737182d639a2f1f6)

1. *Starting (UTC) -* Select the start date and time for the scheduled trigger.
2. *Recur every -* Choose the time interval for triggering and checking suppliers. The minimum time interval is 15 minutes.
3. *Add time frame -* You can specify a time frame during which the trigger will operate.
4. *Add Conditions -* Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-conditions).

   **Note:** Conditions return only the suppliers that match, for example Status equals active. The condition fields include ready-made ones such as Name Contains, Status Is Not and Created On Or After.

**Output:** Each run returns the suppliers updated since the previous run, one record per supplier. Every record holds these fields:

* ID
* Name
* Display Name
* Supplier Number
* Status
* On Hold
* DUNS Number
* Tax ID
* Website
* Primary Contact
* Payment Method
* PO Method
* PO Email
* Invoice Matching Level
* Created At
* Updated At

### Check for New Records

Starts the workflow when records of the selected type have been created in Coupa since the last check.

![Coupa - Check for New Records trigger](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-check-for-new-records.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=e6f20734089df0c1713d773ba06b0645)

<ol>
  <li>*Object Type -* Select the type of record to watch: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Starting (UTC) -* Select the start date and time for the scheduled trigger.</li>
  <li>*Recur every -* Choose the time interval for triggering and checking records. The minimum time interval is 15 minutes.</li>
  <li>*Add time frame -* You can specify a time frame during which the trigger will operate.</li>
  <li>*Add Conditions -* Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-conditions).</li>
</ol>

**Output:** Each run returns the records created since the previous run, one item per record. The fields depend on the Object Type you selected.

### Check for Updated Records

Starts the workflow when records of the selected type have been updated in Coupa since the last check.

![Coupa - Check for Updated Records trigger](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-check-for-updated-records.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=5bf38ac23b5541b2979fa4ef6683459f)

<ol>
  <li>*Object Type -* Select the type of record to watch: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Starting (UTC) -* Select the start date and time for the scheduled trigger.</li>
  <li>*Recur every -* Choose the time interval for triggering and checking records. The minimum time interval is 15 minutes.</li>
  <li>*Add time frame -* You can specify a time frame during which the trigger will operate.</li>
  <li>*Add Conditions -* Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-conditions).</li>
</ol>

**Output:** Each run returns the records updated since the previous run, one item per record. The fields depend on the Object Type you selected.

## Actions

### Grant an Approval

Approves a pending approval in Coupa.

![Coupa - Grant an Approval action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-grant-an-approval.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=60bcd5f0bff65be49ebe667ea0d18c2b)

1. *Approval ID -* Select the pending approval from the list, or map its ID from a previous step in your workflow.
2. *Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).

All of the following are optional and are added through Add Field:

* *Approver User ID -* The ID of the Coupa user to act as. That user must be the approver of this approval.

**Note:** Only approvals that are still pending can be approved.

### Reject an Approval

Rejects a pending approval in Coupa.

![Coupa - Reject an Approval action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-reject-an-approval.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=b0c618d0fd9a727fbaa95a645f8a0f1e)

1. *Approval ID -* Select the pending approval from the list, or map its ID from a previous step in your workflow.
2. *Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).

All of the following are optional and are added through Add Field:

* *Reason -* The reason for the rejection, sent to Coupa with it.
* *Approver User ID -* The ID of the Coupa user to act as. That user must be the approver of this approval.

**Note:** Only approvals that are still pending can be rejected.

### Get Record

Retrieves a single Coupa record of the selected type.

![Coupa - Get Record action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-get-record.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=33ed9b56a4eff925998fada77f5d10fe)

<ol>
  <li>*Object Type -* Select the type of record to retrieve: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Record ID -* Select the record from the list, or map its ID from a previous step in your workflow.</li>
</ol>

### Get Records

Retrieves multiple Coupa records of the selected type, optionally limiting the number of results and applying filters or sorting.

![Coupa - Get Records action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-get-records.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=4e2ab728895feeeac47661b5aebf3e08)

<ol>
  <li>*Object Type -* Select the type of record to retrieve: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Top N -* You can set the maximum number of records Engini will return (default = 50, minimum = 1).</li>
  <li>*Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-filters).</li>
  <li>*Add Sort -* Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-sorts).</li>
</ol>

### Create Record

Creates a new record of the selected type in Coupa.

![Coupa - Create Record action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-create-record.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=bb88d2be48948e1161d2db660d3bdd6e)

<ol>
  <li>*Object Type -* Select the type of record to create: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).</li>
</ol>

**Note:** The fields you can add depend on the Object Type you selected.

### Update Record

Updates an existing record of the selected type in Coupa.

![Coupa - Update Record action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-update-record.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=0d2ac9d7eb820ff0f6a3927ecd4a61d3)

<ol>
  <li>*Object Type -* Select the type of record to update: Invoices, Purchase Orders, Requisitions, Suppliers, Users, Items, Accounts, Contracts, Expense Reports, Receipts, Commodities or Departments.</li>
  <li>*Record ID -* Select the record from the list, or map its ID from a previous step in your workflow.</li>
  <li>*Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).</li>
</ol>

**Note:** The fields you can add depend on the Object Type you selected.

### Delete Record

Deletes a record in Coupa. Only Requisitions and Receipts can be deleted.

![Coupa - Delete Record action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-delete-record.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=b48c2aa2d591766efadabbc99080abb0)

<ol>
  <li>*Object Type -* Select Requisitions or Receipts.</li>
  <li>*Record ID -* Select the record from the list, or map its ID from a previous step in your workflow.</li>
</ol>

### Submit Requisition for Approval

Submits a requisition to start its approval in Coupa.

![Coupa - Submit Requisition for Approval action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-submit-requisition-for-approval.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=2783c29af8a4765de64024bf3fd51c84)

*Requisition ID -* Select the requisition from the list, or map its ID from a previous step in your workflow.

### Get Approvals

Retrieves multiple approvals from Coupa, optionally limiting the number of results and applying filters or sorting.

![Coupa - Get Approvals action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-get-approvals.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=a39636ff87096b1ae43b5c7c99c04e1f)

<ol>
  <li>*Top N -* You can set the maximum number of approvals Engini will return (default = 50, minimum = 1).</li>
  <li>*Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-filters).</li>
  <li>*Add Sort -* Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-sorts).</li>
</ol>

### Get Approval

Retrieves a single approval from Coupa.

![Coupa - Get Approval action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-get-approval.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=440f686882cc73c7b931522e8f720d67)

*Approval ID -* Select the approval from the list, or map its ID from a previous step in your workflow.

### Cancel Purchase Order

Cancels a purchase order in Coupa.

![Coupa - Cancel Purchase Order action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-cancel-purchase-order.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=25c1e121b9a9a431bd35863f893f4e54)

*Purchase Order ID -* Select the purchase order from the list, or map its ID from a previous step in your workflow.

### Close Purchase Order

Closes a purchase order in Coupa.

![Coupa - Close Purchase Order action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-close-purchase-order.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=bf76c2662bfc5fb652580e6add03c574)

*Purchase Order ID -* Select the purchase order from the list, or map its ID from a previous step in your workflow.

### Request Purchase Order Change

Requests a change to an existing purchase order in Coupa.

![Coupa - Request Purchase Order Change action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-request-purchase-order-change.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=989b802ef71eafccee05bec8c5670af3)

*Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).

Add the fields of the change request through Add Field. *Order Header Id -* The purchase order the change applies to; select it from the list, or map its ID from a previous step in your workflow.

### Submit Expense Report for Approval

Submits an expense report to start its approval in Coupa.

![Coupa - Submit Expense Report for Approval action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-submit-expense-report-for-approval.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=7f204b9296e4ccc3ec5531341d69ebf8)

*Expense Report ID -* Select the expense report from the list, or map its ID from a previous step in your workflow.

### Set Integration Run Status

Sets the status of an integration run in Coupa.

![Coupa - Set Integration Run Status action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-set-integration-run-status.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=58b5a277ed465b247695d25d2d3281db)

<ol>
  <li>*Integration Run ID -* Select the integration run from the list, or map its ID from a previous step in your workflow.</li>
  <li>*Status -* Select the status to set: Running, Successful, Failed, Paused or Pending.</li>
</ol>

### Add Attachment

Attaches a file, a link or a text note to a record in Coupa.

![Coupa - Add Attachment action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-add-attachment.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=662d94f2e7d3b2c617231617e51f8c1e)

<ol>
  <li>*Object -* Select the type of record to attach to: Contracts, Invoices, Expense Reports, Purchase Orders, Users or Requisitions.</li>
  <li>*Record Id -* Enter the ID of the record to attach to, or map it from a previous step in your workflow.</li>
  <li>*Type -* Select what you are attaching. The default is File. The fields below the Type depend on it, and only the matching ones are shown.</li>
  <li>*File name -* Shown when Type is File. Enter the name of the file, including its extension, for example `invoice.pdf`.</li>
  <li>*File content -* Shown when Type is File. Enter the content of the file as a base64 string, or map it from a previous step in your workflow.</li>
  <li>*Add Field -* Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](https://docs.engini.ai/help/workflows/workflow-editor.md#add-fields).</li>
</ol>

With Type set to URL, a URL field replaces the file fields. Enter the address of the link to attach.

![Coupa - Add Attachment action with Type URL](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-add-attachment-url.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=3c7b0a1d007a4e3eaedb682ebc923032)

With Type set to Text, a Text field replaces the file fields. Enter the text of the note to attach.

![Coupa - Add Attachment action with Type Text](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-add-attachment-text.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=f1e535e27af6a182e2e236b60cab2e8e)

**Note:** The optional Intent field is available through Add Field.

### Send API Request

This activity allows you to send a custom API request directly to Coupa's API.

![Coupa - Send API Request action](https://mintcdn.com/engini/euG-AVX9whqsYMy5/help/assets/apps/coupa/coupa-send-api-request.png?fit=max\&auto=format\&n=euG-AVX9whqsYMy5\&q=85\&s=5879590a0a686473947f72f77b106c94)

1. *Base Url -* The root URL of the Coupa API. It is filled in from your Coupa connection and can't be edited here.
2. *Relative url -* You can specify additional path segments or parameters that need to be added to the end of the Base Url. This allows you to customize the specific request you want to perform.
3. *Method -* Select the HTTP method (e.g., Get, Post, Put, Delete, Patch). The default is POST.
4. *Body Type -* Defines the format of the data in the body of your request. The default, application/json, means the body contains a JSON-formatted payload.
5. *Body -* Contains any data that is being sent to the server.
6. *Add Headers -* Additional metadata about the request, such as the type of data Engini can accept, the length of the request body, and authentication information.
7. *Add Queries -* The query refers to the parameters or data that are included in the URL of an HTTP request to provide additional information or instructions to the server.

For the full list of endpoints, see the [Coupa Core API documentation](https://compass.coupa.com/en-us/products/product-documentation/integration-technical-documentation/the-coupa-core-api).


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