Skip to Content
Technical Articles
Author's profile photo Yogananda Muthaiah

SAP Commissions – CRUD API for SalesOrder & SalesTransaction

Dear All,

This article describes how you can achieve real time Sales Order & Sales Transaction creation integrated with 3rd Party CRM/Billing System when order is confirmed successful..  so you can develop a script consuming commissions API’s which will create based on scheduled time.

What is CRUD API ?

CRUD is an acronym that stands for CREATE, READ, UPDATE, and DELETE. These four database commands are the foundation of CRUD. This acronym is well-known among programmers, but many software developers view it as more of guidance since CRUD was not made as a modern way to create API


Understanding of Sales flow

In this process Sales rep can see their commissions/Incentives amount after the Order is confirmed even before the delivery of product to customer. It really motivates Sales reps to make more of selling process, so it can hit their Sales Target/Quota quickly when their results comes out faster post the pipeline calculation job ran successful.

Also, you don’t need to push the data to Commissions everyday in a large volumes in batch and even it saves a data storage for not loading it to Stage tables in SAP Commissions.

your script needs to take care of all pre-processing activities before creating Sales Order and Sales Transaction.

Let’s see the API’s for Sales Order and Sales Transaction creation with sample payload.

Sales Order Payload

Example : How to create your Sales Order using below Payload

POST https://<tenantid>.callidusondemand.com/api/v2/salesOrders
Content-Type: application/json
Authorization: Basic @{{authtoken1}}

[
    {
        "orderId": "DE-00-00-00-00-01",
        "businessUnits": [
            {
                "name": "BMW"
            }
        ]
    },
    {
        "orderId": "DE-00-00-00-00-02",
        "businessUnits": [
            {
                "name": "BMW"
            }
        ]
    }
]


SalesTransaction Payload

Example : How to create your Sales Transaction using below Payload

POST https://<tenantid>.callidusondemand.com/api/v2/salesTransactions
Content-Type: application/json
Authorization: Basic @{{authtoken1}}

[
    {
        "salesOrder": {
            "orderId": "DE-00-00-00-00-01"
        },
        "lineNumber": {
            "value": 12,
            "unitType": {
                "unitTypeSeq": "1970324836974599",
                "name": "integer"
            }
        },
        "subLineNumber": {
            "value": 14,
            "unitType": {
                "unitTypeSeq": "1970324836974599",
                "name": "integer"
            }
        },
        "eventType": {
            "eventTypeId": "booking"
        },
        "compensationDate": "2020-10-10",
        "preadjustedValue": {
            "value": 1000,
            "unitType": {
                "unitTypeSeq": "1970324836975201",
                "name": "EUR"
            }
        },
        "value": {
            "value": 1000,
            "unitType": {
                "unitTypeSeq": "1970324836975201",
                "name": "EUR"
            }
        },
        "comments": "so txn 1",
        "isRunnable": true,
        "businessUnits": [
            {
                "businessUnitSeq": "22799473113563437",
                "name": "BMW"
            }
        ],
        "originTypeId": "manual",
        "transactionAssignments": [
            {
                "setNumber": 1,
                "payeeId": "D00000000000001"  
            }
        ]
    }
]    

Housekeeping Note :

  • 👉 PayeeId should be present before Sales Transaction creation
  • 👉 No Purge option when Order & Transaction is created.. since there is no records in Stage tables
  • 👉 To delete a transaction, you need to trigger through API’s. since Transaction as created as Manual in OriginType
  • 👉 Limit up-to Maximum 10 entries(transaction) in one Payload for every sec for creation and make further entries in next second.
  • 👉 you need to open GenericAttributes columns in order to populate the values and see in Sales Transaction UI.

Common Errors

{
    "salesTransactions": [
        {
            "_ERROR_": "Bean (payeeId=D00000000000001) Not Found."
        }
    ]
}

## That Means your sales Rep is not available in Participant Workspace 
or not loaded from HR file.

To find out the Seq’s to pass it in Payload, you can use below API calls but this will be just as Information for your script.

GET https://<TenantID>.callidusondemand.com/api/v2/unitTypes
GET https://<TenantID>.callidusondemand.com/api/v2/businessUnits
GET https://<TenantID>.callidusondemand.com/api/v2/eventTypes

References

SAP Commissions API Documentation

I hope this information was helpful and interesting, if you have any questions, just drop a comment below and I can respond to any questions you may have about from this blog!!

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.