Introduction

SAP Commissions provides different ways to fetch data from its Database. One of them is through the use of REST APIs. The Commissions REST APIs can be used for developing reports, setting up integrations between Commission and other applications or interact with Commissions like submitting pipeline job.

In this article, I will summarize few commands which can be used to fetch data from different REST resources with the help of Postman. The password used to login to Commissions can be used to access the APIs as well.

There are different resources (Commissions Database tables) from which data can be fetched as per one’s own requirements. Commissions supports fetching 100 rows in one call. So one needs to iterate/loop the data fetch as per the total number of rows in that resource. All the resources and other details present at URL

https://xxxx-yyy.callidusondemand.com/APIDocument/

where xxxx is the tenant id and yyy is the instance (prd or dev or uat)

  • List data from a resource

https://xxxx-yyy.callidusondemand.com/api/v2/<resource>

Eg: https://xxxx-yyy.callidusondemand.com/api/v2/periods

Using the above get URL, data can be fetched from any resource which is provided by SAP Commissions.

List%20data%20from%20a%20resource

List data from a resource

 

  • List total number of records in a resources

By using the option “?inlineCount=true” one can fetch the total number of rows present in a resource and can iterate over it in batches of 100 (maximum no of rows which can be fetched in a pull) to get all the data from the resource.

https://xxxx-yyy.callidusondemand.com/api/v2/<resource>?inlineCount=true

https://xxxx-yyy.callidusondemand.com/api/v2/periods?inlineCount=true

List%20total%20number%20of%20rows

List total number of rows

while iterating one should use skip and top to fetch rows after the number of rows already fetched. So in case one wants to fetch first 100 rows, one can use:

https://xxxx-yyy.callidusondemand.com/api/v2/periods?skip=0&top=100

To fetch the next 100 rows, one can use url as:

https://xxxx-yyy.callidusondemand.com/api/v2/periods?skip=100&top=100

skip%20and%20top%20rows

skip and top rows

  • List details using filter conditions

Using parameter ‘$filter’ once can pull data from a resource using filter conditions. The filter condition supports not, and, or. One can also use comparison in the filter conditions using operators like eq(equal), ge (greater than or equal to), gt (greater than), le (less than or equal to), lt (less than), ne (not equal to)

https://xxxx-yyy.callidusondemand.com/api/v2/periods?$filter=name eq Jan-21

https://xxxx-yyy.callidusondemand.com/api/v2/periods?$filter=name eq Jan-21 or name eq Feb-21

https://xxxx-yyy.callidusondemand.com/api/v2/periods?$filter==periodSeq eq 2533274790396669

List%20data%20using%20filter

List data using filter

  • List only selected columns

When there is a need to pull only few columns then one can use the ‘select’ parameter.

https://xxxx-yyy.callidusondemand.com/api/v2/periods?select=name,shortName

List%20selected%20columns

List selected columns

  • List related data

While fetching data from Commissions resource, only the IDs of the related objects are fetched. For eg: while fetching data from salesTransactions only the ids of related fields like shipToAddress or transactionAssignments are displayed. In case one wants to display the full assignment row one should use the ‘expand’ parameter.

Data fetch without expand:

https://xxxx-yyy.callidusondemand.com/api/v2/salesTransactions(14636698828411333)

List%20data%20without%20expand%20parameter

List data without expand parameter

Data fetch with expand:

https://xxxx-yyy.callidusondemand.com/api/v2/salesTransactions(14636698828411333)?expand=transactionAssignments

List%20data%20with%20expand

List data with expand parameter

 

Conclusion

SAP Commissions REST APIs provides a good option to pull data from tenant DB and build add-ons over it. One can automate the data fetch using different languages (cURL, python, java etc) and consume the data through different platforms to achieve reporting and data visualization for the organization. One can also submit import, pipeline, reset and purge jobs through APIs. All the ODATA related APIs can be found at below URL:

https://xxxx-yyy.callidusondemand.com/APIDocument/odata/index.html

where xxxx is the tenant id and yyy is the instance (prd or dev or uat)


Thank you for reading this article. I hope you find it helpful. Please let me know your thoughts on this in the comments section. 

Randa Khaled

Randa Khaled

Author Since: November 19, 2020

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x