Connectors / Service / Coupa

Coupa

Coupa

The Coupa platform analyzes large quantities of corporate transactional expense data, looking for spending patterns and areas of inefficiency.

Overview

The Coupa software provides customers with actionable insights that can lead to improved inventory management, smarter purchasing decisions and lower costs.

API INFO: The Base URL used for the coupa connector is https://tray-test.coupahost.com/api. More information can be found on their main API documentation (v1.0) site.

Authentication

Within the workflow builder, highlight the Coupa connector.

In the Coupa connector properties panel to the right of the builder, click on the Authenticate tab and the 'Add new authentication' button.

This will result in a Tray.io authentication pop-up modal. The first page will ask you to name your authentication and select the type of authentication you wish to create ('Personal' or 'Organisational').

The next page asks you for your 'Instance URL' and 'API key' credentials.

In order to get these fields, head to the Coupa dashboard. Please note that in order to create an API KEY you will need admin account.

To create an API key, go to Setup > Integrations > API Keys and click the Create button. Provide the details below. When you're done, be sure to copy or write down (safer) the API key. Once you save the key, you won't have access to it again, and if you lose it, you'll have to generate a new one by editing the existing key details.

PLEASE NOTE: The API key expires at midnight UTC on the expiry date. Coupa will send an email with a notification to when the API key is going to expire at the email address you provide when the API key was created.

The Instance URL can be taken from your Coupa account. Your Instance URL can also be found within your Coupa URL.

So if your URL is https://test-test.coupahost.com/user/home, your Instance URL will be https://test-test.coupahost.com.

Once you have added these fields to your Tray.io authentication popup window, click the 'Create authentication' button.

Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Using the Raw HTTP Request ('Universal Operation')

As of version 1.0, you can effectively create your own operations.

This is a very powerful feature which you can put to use when there is an endpoint in Coupa which is not used by any of our operations.

To use this you will first of all need to research the endpoint in the Coupa API documentation v1.0, to find the exact format that Coupa will be expecting the endpoint to be passed in.

Note that you will only need to add the suffix to the endpoint, as the base URL will be automatically set (the base URL is picked up from the value you entered when you created your authentication).

The base URL for Coupa will be something similar to this, but with a different subdomain: https://test-test.coupahost.com/api

For example, say that the 'List users' operation did not exist in our Coupa connector, and you wanted to use this endpoint. You would use the Coupa API docs to find the relevant endpoint - which in this case is a GET request called: users.

More details about this endpoint can be found here.

As you can see there is also the option to include a query parameter, should you wish to do so. So if you know what your method, endpoint and details of your query parameters are, you can get the Users information with the following settings:

Method: GET

Endpoint: List users

Query Parameter: Key: email Value: test@test.com

Headers: Key: Accept Value: application/json

Final outcome being: https://test-test.coupahost.com/api/users?email=test@test.com

Example Usage

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the coupa connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

Below is an example of a way in which you could potentially use the Vibes connector, to list all broadcasts and retrieve the information for each broadcast.

EXTRA AUTHS: In order to complete this workflow, you will also need to be authenticated with the coupa connector.

The steps will be as follows:

  1. Setup using a manual trigger and List all user group membership
  2. Add a Loop connector to iterate through all user group membership
  3. Get each user group membership

Your completed workflow should look similar to this:

1 - Setup Trigger & List broadcasts

Select the Manual trigger from the trigger options available.

From the connectors panel on the left, add a Coupa connector to your workflow. Set the operation to 'List user group memberships'.

Feel free to re-name your steps as you go along to make things clearer for yourself and other users. The operation names themselves often suffice.

2 - Add a Loop connector

Next, search for the Loop collection connector within your connector panel, and drag it into your workflow as your next step. Set your operations to 'Loop list'.

The Loop Collection connector allows you to iterate through a list of results. In this example, we will use it to iterate through the data found within the previous Coupa connector step.

In order to specify the list your want to loop through, start by using the list mapping icon (found next to the list input field, within the properties panel) to generate the connector-snake.

While hovering over the 'List user group memberships' step (with the tail end of the connector-snake), select the results from the list of output properties displayed. This will auto-populate a jsonpath within your list input field, and update the type selector to jsonpath.

For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.
CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

When run, this workflow will iterate through the list of user group memberships provided by the earlier step.

3 - Get user group membership

The last step is to drag a Coupa connector inside of the Loop Collection step itself. Set the operation to 'Get user group membership'. As you can see, the 'User group membership ID' field is required.

INTERPOLATION: When you wish to include JSON generated data within another input/ output/ result, use our Interpolation method as described here.

When run, the workflow will now iterate through the list of user group memberships, and get information of each membership.

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our Managing data best practices guide.

All Operations

Latest version:

1.1