Syncing Commission Data via API and Callbacks
Once your users start generating sales, you'll want your system to sync the associated data so that you can show these sales to your users, send push notifications, etc. There are two ways to get this commission data: pull them from our API or receive callbacks from our system. Our recommendation is to call our API, caching results between every 1-6 hours but no less than 24 hours. Callbacks are an additional option, however, we do not re-attempt failed callbacks.
Commission Data via the Wildfire API
To see the API docs for how to fetch commission data en masse see the API reference.
Features of commission API:
- Fetch up to 2000 records at a time
- Cursor-based requests to page through all results
- Request commissions between a date_modified range to capture all changes
Notes:
- Commission API should only be called up to 1 time per 5 seconds (more frequent requests will be rejected).
- Whereas callbacks provide low-latency commission data, the batch API provides a guarantee of not missing any records (as callbacks are not retried).
- Requests to the commission API can timeout for a number of reasons (network connectivity, unplanned maintenance windows, etc.). The HTTP response code and payload should be evaluated to ensure you received an expected response. If an unexpected response was received, consider retrying with an exponential backoff pattern.
Commission Data via Callbacks
Callbacks offer nearly realtime updates as commission records are created or changed in the Wildfire platform. However, Callbacks are not retried and no longer the recommended method for syncing commission records.
To set up your callback URL, in your partner admin tool, select the application you want to configure and then select the gear icon. Here you can enter a callback URL (please ensure it's an HTTPS endpoint) and a callback key.
The callback key can be any value. The purpose of the callback key is to ensure that the callback is valid (and that a rogue entity is not invoking your callback URL with false data).
Callback Body
The content of the body is different depending on what version of the APIs your application is configured to use.
By default, we subscribe an application when it is created to the most recent version of our APIs. Wildfire will not auto-update your application to a new version of the APIs but you may request to have your application(s) upgraded.
Please contact your Client Success Manager to determine your application's current API version and/or to request an upgrade.
A V3 callback request will have a body similar to this:
{
"ID":"96d0a222-c84c-4b6b-8722-8fb8447f9565",
"Type":"Commission",
"Action":"create",
"Payload":{
"CommissionID":12345,
"ApplicationID":0,
"MerchantID":123456,
"DeviceID":19283,
"SaleAmount":{
"Amount":"321",
"Currency":"USD"
},
"Amount":{
"Amount":"3.211",
"Currency":"USD"
},
"Status":"PENDING",
"TrackingCode":"012345-6780a-bcdef0-12345",
"EventDate":"2019-09-12T01:22:33Z",
"CreatedDate":"2019-09-13T02:22:33.987654Z",
"ModifiedDate":"2019-09-13T02:22:33.987654Z",
"MerchantOrderID":"397254095",
"MerchantSKU":"465056245"
},
"CreatedDate":"2019-09-15T00:11:33.987654Z"
}A V4 callback request will have a body similar to this:
{
"ID": "87f0a400-c84c-4b6b-8722-8fb8447f9565",
"Type": "Commission",
"Action": "create",
"Payload": {
"CommissionID": 775109,
"ApplicationID": 0,
"MerchantID": 98813,
"DeviceID": 12345,
"SaleAmount": {
"Amount": "384.65",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "2.88475",
"Currency": "USD",
"SplitPart": "APPLICATION"
},
{
"Amount": "5.7695",
"Currency": "USD",
"SplitPart": "DEVICE"
}
],
"Status": "PAID",
"TrackingCode": "012345-6780a-bcdef0-74932",
"EventDate": "2022-10-27T23:08:45Z",
"LockingDate": "2022-10-27T23:08:45Z",
"CreatedDate": "2022-10-27T23:08:45.898588Z",
"ModifiedDate": "2022-10-27T23:13:45.898588Z",
"MerchantOrderID": "1234582725",
"MerchantSKU": "sku123nd"
}
}V5 (Latest) Callback Response
- New fields: DeviceXID, CouponCodes, ShoppingTripCode on the payload; BaseCommissionAmount and BoostedCommissionAmount added to every entry in Amounts.
- Status enum values: PENDING, CONFIRMED, READY, PAID
Note: *Both of the above examples include whitespace/indentation for readability, but when generating the HMAC check to verify this callback came from Wildfire, the callback body must be evaluated without modification (i.e. it should contain no indentation/whitespace/formatting).
Example v3 body without whitespace:
{"ID":"96d0a222-c84c-4b6b-8722-8fb8447f9565","Type":"Commission","Action":"create","Payload":{"CommissionID":12345,"ApplicationID":0,"MerchantID":123456,"DeviceID":19283,"SaleAmount":{"Amount":"321","Currency":"USD"},"Amount":{"Amount":"3.211","Currency":"USD"},"Status":"PENDING","TrackingCode":"012345-6780a-bcdef0-12345","EventDate":"2019-09-12T01:22:33Z","CreatedDate":"2019-09-13T02:22:33.987654Z","ModifiedDate":"2019-09-13T02:22:33.987654Z","MerchantOrderID":"397254095","MerchantSKU":"465056245"},"CreatedDate":"2019-09-15T00:11:33.987654Z"}Example v4 body without whitespace:
{"ID":"87f0a400-c84c-4b6b-8722-8fb8447f9565","Type":"Commission","Action":"create","Payload":{"CommissionID":775109,"ApplicationID":0,"MerchantID":98813,"DeviceID":12345,"SaleAmount":{"Amount":"384.65","Currency":"USD"},"Amounts":[{"Amount":"2.88475","Currency":"USD","SplitPart":"APPLICATION"},{"Amount":"5.7695","Currency":"USD","SplitPart":"DEVICE"}],"Status":"PAID","TrackingCode":"012345-6780a-bcdef0-74932","EventDate":"2022-10-27T23:08:45Z","LockingDate":"2022-10-27T23:08:45Z","CreatedDate":"2022-10-27T23:08:45.898588Z","ModifiedDate":"2022-10-27T23:13:45.898588Z","MerchantOrderID":"1234582725","MerchantSKU":"sku123nd"}Callback Key Values
ID: The callback ID. Note that this is different from the commission ID. Every callback request will have a unique callback ID, but it may have the same commission ID (i.e. in the case of an update). There is a button in Partner Admin that allows a user to resend a callback to your callback receiver URL. Every time that resend callback button is selected, a new callback will fire with a unique callback ID but the same commission ID.
Type: "Commission"
Action: "create", "update"
Commission Payload Key Values
CommissionID: Unique ID for this commission, when updates are sent this ID will be the same.
ApplicationID: The ID of the application with which the purchase was made.
DeviceID: The ID for the user’s device that made the purchase.
MerchantID: The ID for a merchant. This value can be used to match to a merchant in the JSON feed.
SaleAmount
- Amount: Reported sale amount from merchant. Note: Some merchants don't report sale amount, this can be 0.
- Currency: The original currency in which the purchase was made. This value is not converted to the application default currency.
Amounts: This is an array with up to two maps with data for the user’s earnings and the application’s earnings. If you pay your end user you will only see a map for the application SplitPart. If Wildfire pays your end users you will see two maps, one containing the user’s earnings and the other containing the application’s earnings.
- Amount: The commission amount, this can be a negative number in the case of a canceled or returned order to offset the original commission (this will have a new ID).
- Currency: Commissions are always converted to your application's default currency (e.g. if your default currency is CAD, this value will be sent via API and callback in CAD).
- SplitPart: A split part is the amount of money allocated to one or two entities depending on the configuration of your application(s). In instances where you pay your end users directly, you will only ever see an Application split part. If Wildfire pays your end users on your behalf, this response will include both the Application SplitPart and the Device (end user) SplitPart. Note: SplitPart was added in v4 of commission records.
- Application: Represents your portion of a commission.
- Device: Represents the end user's portion of a commission. Only present in cases where Wildfire is paying your end user.
TrackingCode: This is the value referred to Tracking Code (TC) Parameter
EventDate: Timestamp for when the order was placed.
CreatedDate: Timestamp for when the commission was entered into our database.
ModifiedDate: Timestamp for the last time this commission was modified in our database.
LockingDate: The period of time that the merchants give themselves to reverse or adjust a commission.
MerchantOrderID: Order ID provided by the merchant for this commission. Note:This value may be blank, not every merchant reports an order ID.
MerchantSKU: SKU number for item purchased. Note: This value may be blank, not every merchant reports SKU values.
Callback Headers
The headers for a callback will look like this:
{
"User-Agent": "Wildlink_Callback_Bot/1.0",
"Content-Length": "412",
"Cache-Control": "no-cache",
"Content-Type": "application/json",
"X-Wf-Signature": "sha256=c8abc5baf0a109d3365f90b1f783a9f71eaecd1746fcf39b9b4b1b3417b84cca",
"Accept-Encoding": "gzip"
}Note the "X-WF-Signature" value is the HMAC encoded value of the POST body using a sha256 encoding type and using the Callback Key value that you set. A PHP example for how to generate this signature (to compare it to the one in the headers to verify that the request is authentic) looks like this:
$post_body = file_get_contents('php://input');
$signature = hash_hmac("sha256", $post_body, $callback_key);Note: Altering the body of the callback sent by Wildfire will result in a mismatched signature.
Retry logic and ensuring against missed records
At the time of the writing of this article, Wildfire does not support retrying failed callbacks. Because of this we recommend using the API calls (see get all commissions) on a regular basis (i.e. hourly) to compensate for the possibility of incomplete callbacks.
How to get started with commission callbacks
If you would like to set up commission callbacks, you may do so via the Partner Admin under a given application's settings screen:
- Navigate to https://platform.wildlink.me/
- Select the application you'd like to configure callbacks for.
- Select the three dots overflow menu in the top right. (See Fig 1)
- Select "Settings" from the menu.
- Input the callback URL (this needs to be a full URL available to the public) and callback key (this can be any value you choose) you'd like to use. (See Fig 2)
- Select the callback version you'd like to use (the newest version is usually preferred as it includes more details about each commission record).
- Save. Note: It can take a few minutes before the changes take effect.
Once you set up your callback settings, you'll be able to resend callbacks from the commission history to test your receiving script (See Fig 3).



Order-level vs. Order-item level Commission Records: Understanding the Differences
Understanding the relationship between orders and commissions is an important part of any partner integration process. It allows our partner to track earnings and determine the amount of commission that should be paid to users. There are two main types of commission reporting: order-level and order-item level.
Order-Level Commission Reporting
Some merchants provide order-level commission reporting, where entire orders are grouped together as a single record. In these cases, returns are updated as amounts to the existing commission ID. The commission ID remains the same between the initial and updated records, but the modified date and amounts change.
Here is an example of an order-level commission report for an original purchase:
{
"CommissionID": 31870476,
"ApplicationID": 104,
"MerchantID": 5479397,
"DeviceID": 15319832,
"SaleAmount": {
"Amount": "60.99",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "1.2500",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-02-02T17:26:55Z",
"LockingDate": "2023-05-01T05:00:00Z",
"CreatedDate": "2023-02-02T18:53:58.106991Z",
"ModifiedDate": "2023-02-02T18:53:58.106991Z",
"MerchantOrderID": "6327180345",
"MerchantSKU": ""
}And here is an example of an order-level commission report for a partial return:
{
"CommissionID": 31870476,
"ApplicationID": 104,
"MerchantID": 5479397,
"DeviceID": 15319832,
"SaleAmount": {
"Amount": "44.96",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "0.2925",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-02-02T17:26:55Z",
"LockingDate": "2023-05-01T05:00:00Z",
"CreatedDate": "2023-02-02T18:53:58.106991Z",
"ModifiedDate": "2023-03-25T10:44:56.526455Z",
"MerchantOrderID": "6327180345",
"MerchantSKU": ""
}Note that in this case the CommissionID and the MerchantOrderID (aka the Order ID) stays the same and only the SaleAmount and Amount (aka the Commission Amount) and ModifiedDate change to reflect the updated order.
Most merchants, on the other hand, provide order-item level commission reporting. In this method, every item in an order is posted as a separate commission record. Items and returns are recorded separately, each with their order-item amounts and a separate commission ID. This method is often referred to as "ledger-style."
Here is an example of an order-item level commission report for an original purchase:
{
"CommissionID": 32736944,
"ApplicationID": 156,
"MerchantID": 5479868,
"DeviceID": 18156054,
"SaleAmount": {
"Amount": "67.99",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "1.632",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-03-04T21:04:00Z",
"LockingDate": "0001-01-01T00:00:00Z",
"CreatedDate": "2023-03-06T15:24:36.611096Z",
"ModifiedDate": "2023-03-07T02:57:58.5251Z",
"MerchantOrderID": "M2673245040",
"MerchantSKU": "15406898"
},
{
"CommissionID": 32736945,
"ApplicationID": 156,
"MerchantID": 5479868,
"DeviceID": 18156054,
"SaleAmount": {
"Amount": "109",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "2.616",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-03-04T21:04:00Z",
"LockingDate": "0001-01-01T00:00:00Z",
"CreatedDate": "2023-03-06T15:24:37.236906Z",
"ModifiedDate": "2023-03-07T02:58:07.931103Z",
"MerchantOrderID": "M2673245040",
"MerchantSKU": "15453724"
}And here is an example of an order-item level commission report for a partial return:
{
"CommissionID": 33556694,
"ApplicationID": 156,
"MerchantID": 5479868,
"DeviceID": 18156054,
"SaleAmount": {
"Amount": "-109",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "-2.616",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-03-04T21:04:00Z",
"LockingDate": "0001-01-01T00:00:00Z",
"CreatedDate": "2023-04-01T23:40:45.361252Z",
"ModifiedDate": "2023-04-01T23:40:45.361252Z",
"MerchantOrderID": "M2673245040",
"MerchantSKU": "15453724"
}Order-level initial reporting with order-item level returns
Some merchants will describe the initial purchase as a single record but subsequent returns as separate records. See below how the initial positive amount (purchase) lists all the SKUs in a single record but each of two partial returns are reported as separate records.
{
"CommissionID": 32753768,
"ApplicationID": 104,
"MerchantID": 5507506,
"DeviceID": 15815011,
"SaleAmount": {
"Amount": "163.6",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "3.1902",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-03-06T23:24:12Z",
"LockingDate": "2023-05-05T00:00:00Z",
"CreatedDate": "2023-03-07T01:17:09.578311Z",
"ModifiedDate": "2023-03-07T01:17:09.578311Z",
"MerchantOrderID": "4042006870",
"MerchantSKU": "99104147967,99104150039,99106898030,99106898040,99106898090,99107014510"
}And here is an example of an order-item level commission report for a partial return:
{
"CommissionID": 32910383,
"ApplicationID": 104,
"MerchantID": 5507506,
"DeviceID": 15815011,
"SaleAmount": {
"Amount": "-31.6",
"Currency": "USD"
},
"Amounts": [
{
"Amount": "-0.6162",
"Currency": "USD",
"SplitPart": "APPLICATION"
}
],
"Status": "PENDING",
"EventDate": "2023-03-06T23:24:12Z",
"LockingDate": "2023-05-05T00:00:00Z",
"CreatedDate": "2023-03-14T12:19:50.66962Z",
"ModifiedDate": "2023-03-14T12:19:50.66962Z",
"MerchantOrderID": "4042006870",
"MerchantSKU": "99104150039"
}Conclusion
Wildfire Systems is trying hard to make merchant data more normalized and though we have tried to standardize around order-item level reporting, some merchants don't provide enough detail to allow us to do that. We are actively considering ways to make the data more normalized, including standardizing around order-level reporting. In the meantime, it's appropriate to design your systems in such a way that they can work with the aforementioned use cases and reach out to us if you have any questions.