Coupa

Learn how to use Coupa with Composio

Overview

SLUG: COUPA

Description

Coupa provides a comprehensive business spend management platform with procurement, invoicing, and expense capabilities.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to openid,profile,email,login,offline_access,core.common.read,core.object_translations.read,core.user.read,core.user_group.read,core.integration.read,core.integration.write,core.approval.read,core.approval.write,core.requisition.read,core.requisition.write,core.purchase_order.read,core.purchase_order.write,core.order_header_confirmations.read,core.order_header_confirmations.write,core.item.read,core.catalog.read,core.uom.read,core.supplier.read,core.supplier_sites.read,core.invoice.read,core.invoice.write,core.invoice.create,core.payables.invoice.read,core.payables.invoice.write,core.pay.payments.read,core.expense.read,core.expense.write,core.business_entity.read,core.legal_entity.read,core.project.read,core.notifications_summary.read
full
stringDefaults to https://your-instance.coupacloud.comRequired

Connecting to Coupa

Create an auth config

Use the dashboard to create an auth config for the Coupa toolkit. This allows you to connect multiple Coupa accounts to Composio for agents to use.

1

Select App

Navigate to Coupa.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Coupa Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4coupa_auth_config_id = "ac_YOUR_COUPA_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Coupa: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, coupa_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Coupa toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["COUPA"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create Account

Description

Tool to create a Coupa account. Use when you need to provision a new general ledger account with a specific chart-of-accounts type and code segments.

Action Parameters

account-type
object
account-type-id
integer
active
booleanDefaults to True
name
string
segment-1
string
segment-10
string
segment-11
string
segment-12
string
segment-13
string
segment-14
string
segment-15
string
segment-16
string
segment-17
string
segment-18
string
segment-19
string
segment-2
string
segment-20
string
segment-3
string
segment-4
string
segment-5
string
segment-6
string
segment-7
string
segment-8
string
segment-9
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Accounts

Description

Tool to list accounts from Coupa. Use when you need to retrieve account IDs and codes with optional filters and pagination.

Action Parameters

account-type-id
integer
account-type[name]
string
active
boolean
code
string
fields
string
id
integer
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Account Types

Description

Tool to list account types in Coupa. Use when you need account type IDs and names for account creation.

Action Parameters

active
boolean
dynamic_flag
boolean
fields
string
id
integer
name[contains]
string
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Addresses

Description

Tool to list addresses from Coupa. Use when you need paginated address records for processing.

Action Parameters

fields
string
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Approve Approval

Description

Tool to approve a pending approval record. Use when you need to programmatically approve a pending approval by ID.

Action Parameters

api-user-id
integer
id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Hold Approval

Description

Tool to place an approval on hold. Use when you need to pause approval workflow temporarily.

Action Parameters

api-user-id
integer
id
integerRequired
note
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Approvals

Description

Tool to list approvals with optional pagination and filters. Use when you need to retrieve multiple approval records.

Action Parameters

fields
string
filters
object
limit
integer
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Reject Approval

Description

Tool to reject an approval. Use when you need to programmatically reject a pending approval by ID.

Action Parameters

id
integerRequired
note
string
reason
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Approval

Description

Tool to retrieve a single approval record. Use when you need detailed approval information by ID.

Action Parameters

id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Business Groups

Description

Tool to list business groups (content groups) in Coupa. Use when you need IDs, names, and metadata of content groups for assignments.

Action Parameters

created-at[gt]
string
id
integer
name[contains]
string
offset
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Cancel Purchase Order

Description

Tool to cancel a purchase order. Use when you need to void an active PO before issuance. Example: Cancel PO with ID 123.

Action Parameters

fields
array
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Contracts

Description

Tool to list contracts. Use when you need contract IDs and metadata for subsequent actions, e.g., adding an approver.

Action Parameters

fields
string
filters
object
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create External Purchase Order

Description

Tool to create an external purchase order. Use when integrating external POs via Coupa API.

Action Parameters

classification
string
currency
object
order-lines
arrayRequired
payment-method
string
payment-term
object
po-number
stringRequired
ship-to-address
object
ship-to-attention
string
ship-to-user
object
shipping-term
object
supplier
objectRequired
supplier-site
object
transmission-emails
string
transmission-method-override
string
type
stringDefaults to ExternalOrderHeader

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Integration Run

Description

Tool to create an integration run. Use when you need to initialize a new run for an integration before processing records.

Action Parameters

integration_code
string
integration_id
integer
records-processed
integer
start-time
string
total-records
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Currencies

Description

Tool to list currencies from Coupa. Use when you need to retrieve or filter configured currencies before processing.

Action Parameters

code
string
decimals
integer
enabled_flag
boolean
fields
string
id
integer
name
string
offset
integer
return_object
string
symbol
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Expense Reports

Description

Tool to list expense reports. Use when you need a paginated list of reports with optional filters.

Action Parameters

exported
boolean
fields
array
offset
integer
return_object
boolean
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Purchase Order

Description

Tool to retrieve a specific purchase order. Use when you need PO details by its ID.

Action Parameters

fields
array
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Ignore Window And Issue

Description

Ignore Window And Issue

Action Parameters

fields
string
id
integerRequired
return_object
string
x-coupa-api-user-login
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Inspection Codes

Description

Tool to list inspection codes. Use when you need to retrieve id and code of inspection codes for inventory transactions.

Action Parameters

active
boolean
fields
string
lookup[name]
string
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Integration Errors

Description

Tool to list and query integration errors in Coupa. Use when you need to retrieve error IDs and details for troubleshooting or resolving failed transactions.

Action Parameters

fields
string
filters
object
limit
integer
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Integration Runs

Description

Tool to list integration runs. Use after identifying an integration to retrieve run IDs and statuses.

Action Parameters

fields
string
filters
object
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Integrations

Description

Tool to list integrations from Coupa. Use when you need to retrieve integration definitions and IDs for filtering integration runs.

Action Parameters

business_object
string
code
string
created_at
string
direction
string
end_system
string
end_system_type
string
fields
string
id
integer
integration_type
string
name
string
offset
integer
return_object
string
standard
boolean
updated_at
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Invoice Attachment

Description

Tool to create an attachment on an invoice. Use when attaching files, text, or URLs to invoices.

Action Parameters

attachment[file]
object
attachment[intent]
string
attachment[text]
string
attachment[type]
stringRequired
attachment[url]
string
invoice_id
integerRequired
x-coupa-api-user-login
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Invoices

Description

Tool to list invoices with optional pagination and filters. Use when you need to obtain invoice IDs or details for testing void invoice extensively.

Action Parameters

fields
string
filters
object
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Revalidate Invoice Tolerances

Description

Tool to revalidate tolerances on an invoice. Use when tolerance checks need rerunning after invoice submission issues.

Action Parameters

id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Submit Invoice

Description

Tool to submit a draft invoice for approval. Use when you need to kick off the approval workflow on a draft invoice.

Action Parameters

id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Invoice

Description

Tool to update an invoice via PUT /api/invoices/:id.

Action Parameters

bill-to-address
object
business_role
string
comments
string
currency
object
fields
string
id
integerRequired
internal-note
string
invoice-date
string
invoice-lines
array
invoice-number
string
line-level-taxation
boolean
lock-version-key
integer
on_behalf_of
string
payload
object
payment-term
object
remit-to-address
object
return_object
string
ship-to-address
object
status
string
supplier
object
taggings
array
tags
array
tax-lines
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Item

Description

Tool to create a catalog item. Use when provisioning items with minimal details in Coupa.

Action Parameters

description
stringRequired
item-number
string
name
stringRequired
price
number
uom
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Items

Description

Tool to list catalog items. Use when you need item IDs and item numbers for inventory adjustment.

Action Parameters

offset
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Suppliers

Description

Tool to list suppliers with filters. Use when you need suppliers matching certain criteria.

Action Parameters

allow-cxml-invoicing
boolean
created-at[gt]
string
cxml-domain[contains]
string
cxml-supplier-domain[contains]
string
id
integer
name
string
name[contains]
string
name[ends_with]
string
name[starts_with]
string
offset
integer
payment-term[code]
string
payment-term[days-for-discount-payment]
integer
po-method
string
primary-address[city]
string
primary-contact[email][contains]
string
reviews-count[gt]
integer
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Payment Terms

Description

Tool to list payment terms with filters.

Action Parameters

active
boolean
code
string
code_contains
string
code_ends_with
string
code_starts_with
string
created_at_gt
string
created_at_lt
string
days_for_discount_payment
integer
days_for_net_payment
integer
discount_cutoff_day
integer
discount_due_day
integer
discount_due_month
integer
discount_rate
number
fields
string
limit
integer
net_cutoff_day
integer
net_due_day
integer
net_due_month
integer
offset
integer
return_object
string
type
string
updated_at_gt
string
updated_at_lt
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Purchase Order Attachment

Description

Tool to create an attachment on a purchase order. Use when attaching files, text, or URLs to purchase orders.

Action Parameters

attachment[file]
object
attachment[intent]
string
attachment[text]
string
attachment[type]
stringRequired
attachment[url]
string
purchase_order_id
integerRequired
x-coupa-api-user-login
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Close Purchase Order

Description

Tool to close a purchase order. Use when you need to finalize a PO after confirming receipt.

Action Parameters

id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Purchase Orders

Description

Tool to list purchase order headers. Use when you need to fetch filtered and paginated purchase order records from Coupa.

Action Parameters

created-at[gt]
string
created-at[lt]
string
exported
boolean
fields
string
filter
string
id
integer
offset
integer
return_object
string
show_deleted_lines
boolean
status
string
status[in]
string
supplier[name]
string
updated-at[gt]
string
updated-at[lt]
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Issue Purchase Order

Description

Tool to issue and send a purchase order to the supplier. Use after preparing a PO to dispatch it.

Action Parameters

fields
array
id
integerRequired
return_object
string
x-coupa-api-user-login
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Reason Insights

Description

Tool to list Reason Insights. Use when you need to retrieve reason insights with optional filters and pagination.

Action Parameters

active
boolean
code
string
fields
array
id
integer
name
string
offset
integer
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Add To Cart

Description

Tool to add items from a requisition to the shopping cart. Use after constructing the add_to_cart payload.

Action Parameters

requisition-lines
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Requisition

Description

Tool to create a new requisition. Endpoint: POST /api/requisitions

Action Parameters

attachments
array
buyer-note
string
justification
string
requested-by
objectRequired
requisition-lines
arrayRequired
ship-to-address
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Current Cart

Description

Tool to get the current user's requisition cart. Use when you need to fetch or initialize the current cart for the authenticated user.

Action Parameters

fields
string
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Requisition

Description

Tool to delete a requisition. Use when you need to permanently remove a requisition by ID.

Action Parameters

id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Requisitions

Description

Tool to list requisitions with filters.

Action Parameters

fields
string
limit
integer
offset
integer
requested-by[login]
string
return_object
string
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List My Requisitions

Description

Tool to list the authenticated user's requisitions. Use when you need to retrieve paginated user requisitions with optional filters.

Action Parameters

created-at
string
fields
string
limit
integer
offset
integer
requested-by[login]
string
return_object
string
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove Approver from Requisition

Description

Tool to remove an approver from a requisition. Use when you need to remove a manually added approver from a requisition. Endpoint: PUT /api/requisitions/:id/remove_approval

Action Parameters

api_user_email
string
api_user_id
integer
api_user_login
string
approval_id
integer
approver_id
integer
id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Save Requisition for Later

Description

Tool to save a requisition for later. Use when you need to stash a draft requisition without submitting it.

Action Parameters

fields
string
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Requisition

Description

Tool to retrieve a single requisition by its ID. Use when you need detailed requisition data.

Action Parameters

fields
string
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Submit Requisition for Approval

Description

Tool to submit a requisition for approval. Use when you need to create a requisition and immediately submit it for approval.

Action Parameters

attachments
array
buyer-note
string
justification
string
requested-by
objectRequired
requisition-lines
arrayRequired
ship-to-address
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update and Submit for Approval

Description

Tool to update a requisition and submit it for approval. Endpoint: PUT /api/requisitions/:id/update_and_submit_for_approval

Action Parameters

id
integerRequired
requisition-header
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Coupa S3 File Upload or Get

Description

Coupa S3 File Upload or Get

Action Parameters

attachment_id
integer
content_b64
string
file
object
filename
string
intent
string
mimetype
string
operation
stringRequired
resource_id
integer
resource_type
string
text
string
type
string
url
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Submit Contract for Approval

Description

Tool to submit a contract for approval. Use when you need to start the approval process for a contract.

Action Parameters

api_user_email
string
api_user_id
integer
api_user_login
string
business_role
string
fields
array
id
integerRequired
on_behalf_of
string
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Supplier

Description

Tool to retrieve a single supplier. Use when you need detailed supplier information by ID.

Action Parameters

fields
string
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Supplier

Description

Tool to update a supplier. Use when revising supplier details after verifying the supplier exists; only changed fields need to be included.

Action Parameters

account-number
string
allow-cxml-invoicing
boolean
allow-inv-from-connect
boolean
business_role
string
cxml-domain
string
cxml-identity
string
cxml-protocol
string
cxml-secret
string
cxml-supplier-domain
string
cxml-supplier-identity
string
cxml-url
string
duns
string
fields
string
id
integerRequired
invoice-matching-level
string
name
string
number
string
on-hold
boolean
on_behalf_of
string
payload
object
payment-term
object
po-email
string
po-method
string
primary-address
object
primary-contact
object
return_object
string
shipping-term
object
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Units of Measure

Description

Tool to list units of measure. Use when retrieving or filtering UOM catalog for inventory or purchasing flows.

Action Parameters

active
boolean
allowable-precision
integer
code
string
created-at[gt]
string
created-at[lt]
string
fields
string
id
integer
name
string
offset
integer
return_object
string
updated-at[gt]
string
updated-at[lt]
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create User

Description

Tool to create a Coupa user. Use when you need to programmatically add a new user to your Coupa instance.

Action Parameters

active
boolean
email
stringRequired
firstname
stringRequired
lastname
stringRequired
login
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Users

Description

Tool to list users. Use when you need to retrieve multiple user records with optional pagination and filtering.

Action Parameters

fields
string
limit
integer
offset
integer
return_object
string
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get User

Description

Tool to retrieve a single user by ID. Use when you need detailed user information after knowing the user ID.

Action Parameters

fields
string
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update User

Description

Tool to update an existing Coupa user. Use when you need to modify user attributes via Coupa API after confirming user ID.

Action Parameters

account-groups
array
account-security-type
integer
active
boolean
aic-user
boolean
allow-employee-payment-account-creation
boolean
allow-user-to-upload-invoice-from-mobile
boolean
analytics-user
boolean
api-user
boolean
approval-limit
object
authentication-method
string
business-group-security-type
integer
business_role
string
category-planner-user
boolean
ccw-user
boolean
content-groups
array
contract-approval-limit
object
contract-self-approval-limit
object
contracts-user
boolean
country-of-residence
object
default-account
object
default-account-type
object
default-address
object
default-currency
object
default-locale
string
department
object
email
string
employee-number
string
employee-payment-channel
string
escalation-threshold
object
expense-approval-limit
object
expense-self-approval-limit
object
expense-user
boolean
fields
string
firstname
string
generate-password-and-notify
string
id
integerRequired
inventory-organizations
array
inventory-user
boolean
invoice-approval-limit
object
invoice-self-approval-limit
object
invoicing-user
boolean
lastname
string
legal-entity
object
login
string
manager
object
mention-name
string
on_behalf_of
string
password
string
payload
object
phone-mobile
object
phone-work
object
purchasing-user
boolean
requisition-approval-limit
object
requisition-self-approval-limit
object
return_object
string
risk-assess-user
boolean
roles
array
salesforce-enabled
boolean
salesforce-id
string
self-approval-limit
object
seniority-level
string
sourcing-user
boolean
spend-guard-user
boolean
sso-identifier
string
supply-chain-user
boolean
travel-user
boolean
treasury-user
boolean
user-groups
array
work-confirmation-approval-limit
object
working-warehouses
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Void Invoice

Description

Tool to void an invoice. Use when an approved or pending invoice needs to be voided. Example: Void invoice with ID 12345.

Action Parameters

fields
array
id
integerRequired
return_object
string

Action Response

data
objectRequired
error
string
successful
booleanRequired