Creating and Reviewing Contract Terms by Using the Contract Term Management API

This topic describes the procedure for adding new contract terms and retrieving information about contract terms by using the Contract Terms Management API.

Prerequisites

Context

The Contract Terms API enables you to create a contract terms document in the contract workspace and a corresponding contract request in Ariba compliance contracts. You can also use the API to query for contact terms details and compliance contract details.

Procedure

  1. Obtain the ID of the contract workspace where you want to create the contract terms.
  2. To create a contract terms document in the contract workspace and a corresponding contract request in SAP Ariba Procurement solutions, use the POST /contractWorkspaces​/{contractId}​/contractTerms endpoint as follows:
    POST {{runtime_url}}/contractWorkspaces/contractworkspaceID/contractTerms?user=user1&passwordAdapter=pwd1&realm=realm1
    RequestBody: 
    {
    "sspRealm" = "realm1"
    } 
    where
    contractworkspaceID
    is the ID of the contract workspace where you want to create the contract terms document.
    realm1
    is the name of the realm to which the sourcing and procurement applications belong. In case of a Federated Process Control (also known as multi ERP or mERP) setup, specify the child site (realm) ID for the sspRealm field in the request body.

    On successful creation of the contract terms document and the corresponding contract request, you receive a success message. The response body contains the contract terms document ID and contract request ID along with other details about the newly-created contract terms document and the contract request.

    If the POST operation encountered an error, you receive an error message that indicates the nature of the error.

  3. To view details about the contract terms document in a contract workspace and the corresponding contract request, use the GET /contractWorkspaces​/{contractId}​/contractTerms endpoint as follows:
    GET {{runtime_url}}/contractWorkspaces/contractworkspaceID/contractTerms?user=user1&passwordAdapter=pwd1&realm=realm1
                   
    where
    contractworkspaceID
    is the ID of the contract workspace from which you want to retrieve contract terms document details.
    When the GET request is successful, you receive the following details in the response:
    {
      "documentId": "Doc12345",
      "owner": "Robin",
      "status": "Draft",
      "title": "Untitled Contract Terms",
      "lastModifiedDate": "Sat May 23 18:02:12 GMT 2020",
      "creationDate": "Sat May 23 18:02:06 GMT 2020",
      "version": "1"
      "sspContractRequestId": "CR1",
      "sspContractId": "C1",
      "sspContractStatus": "Not Created",
      "sspContractRequestStatus": "Composing",
    }
    where
    documentId
    is the contract terms document ID in the contract workspace.
    sspContractRequestId
    is the contract request ID in the procurement solution.
    sspContractId
    is the contract ID in the procurement solution.

    If the GET request encountered an error, you receive a status message that indicates the nature of the error.

Results

For a list of response codes for the Contract Terms Management API, see Error Messages Returned by the Contract Workspace Management APIs.