Coupa Connector for Mulesoft
Introduction
This connector facilitates the integration with the Coupa’s API providing a mean to access Coupa web services. You can use Coupa connector within mule flows to send and receive data using the Coupa API with support of latest oAuth2/OIDC authentication.
It provides access to Addresses | Advanced Ship Notice | Approvals | Contracts | Receipts aka Inventory Transactions | Items | Lookup Values | Purchase Orders | Requisitions | Suppliers | Users | Charges | CoupaPay Payments | Expense Reports | Invoice | Supplier Items | Remit-to Addresses | Statements | Dynamic Discount | Projects | Tasks | BudgetLine | BudgetLine Adjustments | Easy Form Responses | Supplier Information.
Read through this user guide to understand how to set up and configure a basic flow using the connector. Track feature additions, compatibility, limitations and API version updates with each release of the connector using the Connector Release notes attached below. Review the connector operations and functionality using the demo application attached below.
Additional details on Coupa connector: Mule Exchange Site.
MuleSoft maintains this connector under the Certified support policy.
Prerequisites
This document assumes that you are familiar with Mule, Anypoint Studio, Anypoint Core Components and Mule Flow Design Center.
Hardware and Software Requirements
For hardware and software requirements, please visit the Hardware and Software Requirements page.
Compatibility
Software | Version |
---|---|
Mule Runtime |
4.1.x and higher |
Installing the Connector
You can install the connector in Anypoint Studio using the instructions in Installing a Connector from Anypoint Exchange.
Configuring the Connector Global Element
To use the Coupa connector in your Mule application, you must configure a global Coupa element that can be used by the Coupa connector. The Coupa connector offers the following global configuration(s), requiring the following credentials: Coupa API Key and Instance:
To use the Coupa connector in your Mule application, you must configure a global Coupa element that can be used by the Coupa connector. The Coupa connector offers the following global configuration(s), requiring the following credentials: Coupa API Key (Deprecating from R35), OIDC Client Credentials and Instance:
You can generate client credentials on Coupa instance at following path: https://{instance_name}/oauth2/clients
Reference documentation for OIDC/Oauth2: Get Started With the Coupa API
Field | Description |
---|---|
Coupa API key |
Enter the API Key retrieved from your Coupa admin or Integration Architect for API authentication (This option will deprecate from R35. Use OIDC client credentials as an alternative to traditional API key). |
Instance |
Populate Coupa instance URL here. |
OIDC Client ID |
Enter the client ID retrieved by your Coupa admin or Integration Architect required for OIDC authentication. |
OIDC Secret |
Enter the client secret retrieved by your Coupa admin or Integration Architect required for OIDC authentication. |
OIDC Scope |
Enter the list of scopes applied on client credentials for OIDC authentication. |
Configuration tips
- API Key parameter in above config can be kept blank while opting for OIDC authentication.
- In case API Key is populated along with OIDC client credentials (client id, secret, scope), priority will be given to OIDC authentication.
Configuration notes
core.user.read
is mandatory scope required to complete test connection successfully with OIDC authentication.- Multiple OIDC scopes can be separated with one of the following delimiters - Comma, Space, %20.
Examples
- core.invoice.read,core.purchase_order.read,core.user.read
- core.invoice.read, core.purchase_order.read, core.user.read
- core.invoice.read core.purchase_order.read core.user.read
- core.invoice.read%20core.purchase_order.read%20core.user.read
Using the Connector
Connector Namespace and Schema
When designing your application in Studio, the act of dragging the connector from the palette onto the Anypoint Studio canvas should automatically populate the XML code with the connector namespace and schema location.
If you are manually coding the Mule application in Studio’s XML editor or other text editor, define the namespace and schema location in the header of your Configuration XML, inside the <mule>
tag.
<mule xmlns:coupa="http://www.mulesoft.org/schema/mule/coupa" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/coupa http://www.mulesoft.org/schema/mule/coupa/current/mule-coupa.xsd">
<!-- put your global 0configuration elements and flows here -->
</mule>
TIP |
Inside the |
Demo Mule Applications Using Connector
Existing demo demonstrate how to use the connector for:
Example Use Case
The following example shows how to get an invoice using the connector:
Get an invoice
- In Anypoint Studio, click File > New > Mule Project, name the project, and click OK.
- In the Mule Palette, click on the "HTTP" group and select the Listener component. Now drag and drop it into the flow designer.
- First, we need to create a configuration for the HTTP listener before using it. Click on the HTTP listener and add new configuration by pressing the green plus icon.
- Leave the defaults and click OK.
- Set the value to "show-invoice".
- In the Mule Palette, click on the "Coupa" group and drag and drop Get into the flow designer, then create a new configuration and set your API Key and the instance URL.
- In the Coupa General section, for Object type pick Invoice (invoice) and put 1 (or any valid invoice id) in the ID field.
- Finally, you can try the demo making a request to http://localhost:8081/show-invoice
After an object type is selected, the output metadata view is getting generated based on the pick
Error handling
The connector might generate a different type of errors while using it in flows. It is good to configure separate strategy for every error type using the Error Handling components.
Coupa Errors:
- COUPA:CONNECTIVITY
- COUPA:EXECUTION
- COUPA:INVALID_AUTH
- COUPA:INVALID_PARAMS
Configuring custom fields
Custom fields can be added on top of the basic datasense fields. Available data types for custom fields are String, Date, Date_Time, Integer, Double, Float, Long, Decimal, Boolean and Reference.
Example configuration:
some-custom-field,String; other-custom-field,Date_Time; custom-reference-field,Reference:user
Custom fields can be add in the Custom Metadata tab of the Coupa Global Configuration.
API Resources
- Access the Coupa API References
- Access the Coupa API operators
- Access the Coupa API Arguments
- Access the Coupa API special actions
Mule Module Documentation
Mulesoft Connector Documentation
Coupa Connector Release Notes
- Coupa Mulesoft Connector Release Notes v4.1.0.0.pdf
- Coupa Mulesoft Connector Release Notes v4.0.0.0.pdf
- Coupa Mulesoft Connector Release Notes v3.0.0.pdf
Support Resources
- Learn how connectors have changed in Mule 4.1 Introduction to Mule 4: Connectors.
- Access the MuleSoft Forum to post questions and get help from Mule’s broad community of users.
- To access MuleSoft’s expert support team, subscribe and log in to MuleSoft’s Customer Portal.
- To reach Coupa Support team, reach out to your Coupa Administrator.