Skip to main content

 

 

Coupa Success Portal

Getting Started

Authentication

All data is stored as a business object or Resource, and each resource has a Resource URL, just like a webpage, where each resource is in the form /api/{resouce}. Make sure to access the url using https://instead of http:// when using the Coupa API. Each Coupa customer has their own url, of the form {instance_name}.coupahost.com. For example: https://companyname.coupahost.com/api/users.

Requests are authenticated by a unique API key, generated in Coupa. All API requests must pass an X-COUPA-API-KEY”header, an API key, and the ACCEPT header with value set to application/xml for XML responses, or application/json for JSON responses.  A key can be created from the API Keys section of the Administration tab by an admin user. The key is a 40 character long case-sensitive alphanumeric code and is associated with an API user who is the equivalent of an admin user on Coupa. Any changes to resources via the API will be attributed to the API user.

What Methods are Supported by the API?

GET (Read Data) - A HTTP GET Request will query Coupa and return information in JSON or XML format.  A request at the resource root will list the first 50 objects starting from ID 1. Use these arguments to fine tune the query.

PUT (Update Data) - A HTTP PUT Request to /api/{resource}/{id} will attempt update a resource. Only one resource can be updated per request and the payload should be a JSON or XML document with the elements to be updated. Not all fields are available through the API and any referenced data must already exist or the value will not be changed.

POST (Create Data) - A HTTP POST Request to the resource root with a JSON or XML payload will attempt to create a new resource. If successful, the resource is returned with the new id, which is generated by Coupa.

Deleting data is not supported for any resource via the API. Users can inactivate a subset of resources using a PUT request.

When Should I Use the API?

The Coupa API allows you to create, update, and query individual entries, and will mostly be used to manage objects within Coupa. With standard RESTful actions and definitive inputs and outputs, it makes it the easy day-to-day option for non-bulk actions. These methods can be accessed at any time, and built in are tools to allow you to simply check if a call will go through successfully, or to minimize the responses output. This is primarily used to make simple individual updates, or to query data.

XML vs JSON

Coupa supports both XML and JSON.  Below is some basic information about each:

Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. XML’s design goals emphasize simplicity, generality, and usability over the Internet.

JavaScript Object Notation (JSON) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for most programming languages.

JSON is less verbose than XML, because XML necessitates opening and closing tags (or in some cases less verbose self-closing tags), and JSON uses name/value pairs, concisely delineated by “{“ and “}” for objects, “[“ and “]” for arrays, “,” to separate pairs, and “:” to separate name from value.

Differences between XML and JSON in Coupa

Sample Requests/Responses - XML vs JSON

When Should I Use SFTP Flat Files?

Flat files allow you to load many records through a single transaction. Once an integration is set up, it will automatically run based on the parameters set. Integration runs and errors are managed within the app and provide insight on the number of entires added, error details, and who was automatically contacted about the error. This is primarily used to make mass updates or additions about key components of the product, like users or suppliers.

  • Was this article helpful?