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

# Coupa

> Client-mode REST API connector for the Coupa Core API: OAuth token plus purchase orders and requisitions and invoices and suppliers and receipts

Technical Preview

## Overview

Client-mode REST API connector for the Coupa Core API: OAuth token plus purchase orders and requisitions and invoices and suppliers and receipts. `BASE_ADDRESS` defaults to `https://YOUR_INSTANCE.coupahost.com`. Topics use `erp/coupa/<object>/<verb>`.

| Event | Request | Source topic |
| - | - | - |
| `OAuthToken` | `POST /oauth2/token` | `erp/coupa/oauth/token/create` |
| `PurchaseOrdersList` | `GET /api/purchase_orders?{value.json.query}` | `erp/coupa/purchase-orders/list` |
| `PurchaseOrderGet` | `GET /api/purchase_orders/{value.json.id}` | `erp/coupa/purchase-orders/get` |
| `RequisitionsList` | `GET /api/requisitions?{value.json.query}` | `erp/coupa/requisitions/list` |
| `RequisitionCreate` | `POST /api/requisitions` | `erp/coupa/requisitions/create` |
| `InvoicesList` | `GET /api/invoices?{value.json.query}` | `erp/coupa/invoices/list` |
| `SuppliersList` | `GET /api/suppliers?{value.json.query}` | `erp/coupa/suppliers/list` |
| `ReceivingTransactionsList` | `GET /api/receiving_transactions?{value.json.query}` | `erp/coupa/receipts/list` |
| `ReceivingTransactionCreate` | `POST /api/receiving_transactions` | `erp/coupa/receipts/create` |

## Authentication

OAuth 2.0 / OIDC client credentials. OAuthToken posts the form grant\_type=client\_credentials\&client\_id=...\&client\_secret=...\&scope=core.purchase\_order.read ... to /oauth2/token; the access token (about 24 h) goes in Authorization: Bearer \{value.json.access\_token}. Scopes per resource (core.purchase\_order.read, core.invoice.read, core.supplier.read, core.requisition.write ...). Legacy X-COUPA-API-KEY is deprecated.

> [!WARNING]
>
> Keep credentials in broker secrets and never retain topics that carry tokens or client secrets.

## Notes

* The OIDC client is created by a Coupa admin in the customer instance (Setup > Integrations > OAuth2/OpenID Connect Clients); no partner program is needed.
* OAuthToken is the only event whose body carries a credential (the token form), the same pattern as the Box OAuthToken event. Never retain erp/coupa/oauth/#.
* Use query filters such as updated-at\[gt]=2026-10-01\&limit=50 and return\_object=shallow to keep responses small.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE CoupaRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_INSTANCE.coupahost.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT OAuthToken
        WITH SOURCE_TOPIC "erp/coupa/oauth/token/create"
        WITH DESTINATION_TOPIC "erp/coupa/oauth/token/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/oauth2/token"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/x-www-form-urlencoded"
        WITH BODY "{value.json.form}"
    ADD EVENT PurchaseOrdersList
        WITH SOURCE_TOPIC "erp/coupa/purchase-orders/list"
        WITH DESTINATION_TOPIC "erp/coupa/purchase-orders/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/purchase_orders?{value.json.query}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT PurchaseOrderGet
        WITH SOURCE_TOPIC "erp/coupa/purchase-orders/get"
        WITH DESTINATION_TOPIC "erp/coupa/purchase-orders/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/purchase_orders/{value.json.id}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT RequisitionsList
        WITH SOURCE_TOPIC "erp/coupa/requisitions/list"
        WITH DESTINATION_TOPIC "erp/coupa/requisitions/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/requisitions?{value.json.query}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT RequisitionCreate
        WITH SOURCE_TOPIC "erp/coupa/requisitions/create"
        WITH DESTINATION_TOPIC "erp/coupa/requisitions/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/api/requisitions"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT InvoicesList
        WITH SOURCE_TOPIC "erp/coupa/invoices/list"
        WITH DESTINATION_TOPIC "erp/coupa/invoices/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/invoices?{value.json.query}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT SuppliersList
        WITH SOURCE_TOPIC "erp/coupa/suppliers/list"
        WITH DESTINATION_TOPIC "erp/coupa/suppliers/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/suppliers?{value.json.query}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT ReceivingTransactionsList
        WITH SOURCE_TOPIC "erp/coupa/receipts/list"
        WITH DESTINATION_TOPIC "erp/coupa/receipts/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/receiving_transactions?{value.json.query}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT ReceivingTransactionCreate
        WITH SOURCE_TOPIC "erp/coupa/receipts/create"
        WITH DESTINATION_TOPIC "erp/coupa/receipts/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/api/receiving_transactions"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
```

## Sources

* [https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/oauth-2.0-and-oidc](https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/oauth-2.0-and-oidc)
* [https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/oauth-2.0-and-oidc/set-up-an-openid-connect-client](https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/oauth-2.0-and-oidc/set-up-an-openid-connect-client)
* [https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/resources/transactional-resources/purchase-orders-api-purchase\_orders](https://docs.coupa.com/en/developer-documentation/the-coupa-core-api/resources/transactional-resources/purchase-orders-api-purchase_orders)


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