You can always retrieve commission-related data using the OData API (programmatically - or using BI tools such as Excel, Tableau, Microsoft Power BI). This lets you retrieve transactions, rewards, users, teams, plans, calculations, etc.
However, sometimes you need a trigger indicating that rewards have been released. One way to be notified of reward release is to use Zapier, which implements a "rewards released" trigger. Zapier can then push payment data to your cloud platform.
Another option is to configure a Payroll Gateway, which will invoke a web resource controlled by you when rewards are released. We will pass detailed payment information to your web resource (typically a web page or web service). In turn, you can process received data and effect payment of commissions.
To configure a payment gateway:
- Login to your workspace
- Browse to Settings > Connections
- Add a payment gateway
- Enter your target URL
- Enter your secret
- Click on Save
Optionally, you can also be notified when credits are released.
The secret you supply will be used by your web resource to verify that passed-in information indeed comes from your Sales Cookie tenant (not an unauthorized third-party). Once configured, your provided secret can never be read back from the Sales Cookie Web UI. Your provided secret will only be passed when making callbacks to your web resource (using header X-Secret).
In your implementation, you should check that the secret is indeed the expected one. Processed POST-ed data, which will be the same CSV content as when you export reward details from your calculation - including headers, such as:
Plan,Calculation,Calculation Start,Calculation End,Calculation Status,Beneficiary,Beneficiary Tags,Beneficiary Enrollment,Manager Approval,Reward Type,Reward Details,Reward Value,Reward Value Currency,Beneficiary Value,Beneficiary Value Currency,Assignment %,Attainment Label,Attainment Difficulty,Attainment Value,Attainment Threshold,Attainment Metric,Attainment Measure,Attainment User,Attainment Team,Attainment %,Recoverable,Non-Deductible,Estimated,Manual,Pay Once,Edited,Created,Updated,Created By,Updated By,Release Date,Explanation
My Plan,My Calculation,2021-12-02,2021-12-02,Rewards Released,John Doe (user@example.com),,Ok,Ok,% of Revenue,100.0% of revenue (this level),6.50,USD,6.50,USD,100,L1,Easy,6.50,0,revenue,total,John Doe (user@example.com),,N/A,No,No,No,No,No,No,2021-12-02 18:30:48,2021-12-02 00:00:00,John Doe (user@example.com),John Doe (user@example.com),2021-12-02,
The following HTTP headers are passed in when calling your URL:
- X-Secret - the secret to verify
- X-RequestId - a unique request ID
- X-CalculationId - the released calculation's ID
- X-CalculationName - the released calculation's name
- X-ReleaseType - the associated release action
- Set to "Rewards" for rewards released
- Set to "Credits" for credits released
We recommend the following best practices:
- Always check that header X-Secret matches your supplied secret. Otherwise, unauthorized callers may discover your URL and POST invalid payment data to your URL.
- Do NOT issue actual payment for records whose estimated value is "Yes" or "True". Those records represent estimated commission amounts - not actual ones.
- Implement duplicate payment handling, in case your admin releases rewards multiple times for the same calculation.
- Promptly respond to HTTP requests and process received data offline. We retry up to 10 times, so your URL may be called several time (ex: you are processing the call but we received an HTTP timeout on the response).
- Consider grouping payments by beneficiary. There may be multiple entries per payee (ex: a payee received a base commission, plus an accelerated amount for the same calculation).
- Use the correct property for payments, and pay attention to currencies:
- The "Reward Value" (and associated "Reward Value Currency") is based on your workspace's default currency.
- The "Beneficiary Value" (and associated "Beneficiary Value Currency") is based on each payee's currency.
- You are responsible for making actual API calls to your payroll provider (ex: ADP). Using the payment gateway, you have an opportunity to connect to Intranet-protected resources which may be inaccessible to us.
- Do not assume a fixed number of CSV headers. A plan may be configured to include additional fields, which will appear in headers and provided data.
- Rewards are released on a per-calculation basis, so you may need to aggregate payouts across multiple calculations.
- If commission adjustments are made after release, no post event will be issued (unless you re-release again).