Approvals API (/approvals)

Use the approvals API to create, update, or query the approval of a document. This includes specific endpoints to take action (reject/hold/approve) as well as requisition details like requestor, line items, and shipping details.

The URL to access the approvals API is:

https://<instance>/api/approvals/<approval id>

See Integration Best Practices for more info. To learn more about implementing remote approvals, see Remote Approvals via API.


Verb Path Action Description
PUT /api/approvals/:id/approve approve Perform Approve action on an approval
PUT /api/approvals/:id/hold hold Perform Hold action on an approval
GET /api/approvals index Query approvals
PUT /api/approvals/:id/reject reject Perform Reject action on an approval
GET /api/approvals/:id show Show approval
PUT /api/approvals/:id update Update approval


These are the elements available for the Approvals API

Field Name Field Description Req'd Unique? Allowable Values In Out Type
approvable-id The document ID that was approved yes integer
approvable-type The document type that was approved (requisition, purchase order, etc) yes string(255)
approval-chain-id ID of the approval chain this approval is located in yes integer
approval-date The date the approval occurred yes datetime
approved-by The user name that made the approval yes User
approver approver yes User, Approval Group
approver-id The user ID that made the approval yes integer
approver-type The role of the approver yes string(255)
created-at Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ yes datetime
created-by User who created yes User
delegate delegate yes User, Approval Group
delegate-id The delegate ID that made the approval (if applicable) yes integer
delegates Delegates yes Delegate Approval
holdable Hold the approval or not yes boolean
id Coupa unique identifier yes integer
note Reason for approval or reject yes text
position The position in the approval chain this approval occurred yes integer
reasons Reasons yes Approval Reason
status The status of the approval (approved, escalated, rejected, etc) yes string(50)
type How the approval occured (override approval, approval chain approval, etc) yes string(255)
updated-at Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ yes datetime
updated-by User who updated yes User


In this example, we queried for a single approval with an ID of 12622. We did a GET to the URL:

https://<instance url>/api/approvals/12622 

Approvals GET Response

<?xml version="1.0" encoding="UTF-8"?>
	 <id type="integer">12622</id>
	 <created-at type="datetime">2012-02-15T14:56:22-08:00</created-at>
	 <updated-at type="datetime">2012-04-23T11:49:25-07:00</updated-at>
	 <position type="integer">1</position>
	 <approval-chain-id nil="true" />
	 <approval-date type="datetime">2012-02-15T14:56:59-08:00</approval-date>
	 <note />
	 <approvable-id type="integer">2696</approvable-id>
			<id type="integer">3</id>
			<employee-number />
			<firstname>Victor (CFO)</firstname>
			<salesforce-id nil="true" />
			<id type="integer">9</id>
			<employee-number />
			<firstname>Bob (VP Procurement)</firstname>
			<salesforce-id nil="true" />
			<id type="integer">17</id>
			<employee-number nil="true" />
			<salesforce-id nil="true" />

Approving or Rejecting

The following describes how you can use the Coupa API to perform actions on Approvals.





Adding Reason

In both cases, an approval must be Pending (and not already approved or rejected) for the action to be valid. It is also possible to provide a "Reason" for the rejection through the XML request directly. For example, to reject an approval by id of 12612 and provide a reason of "Rejected by Integration", you would use the following request:

PUT https://{instance url}/api/approvals/12612/reject?reason=Rejected%20by%20Integration

Successful requests will return HTTP 200 Response. The body of the response will include the created requisition. Unsuccessful requests will return

HTTP 400 Bad Request
. The body of the response will include validation errors formatted as XML.