Skip to content

Instantly share code, notes, and snippets.

@Kinzi
Last active August 11, 2017 16:18
Show Gist options
  • Save Kinzi/495d15a954d06e5a061d5a29e481a991 to your computer and use it in GitHub Desktop.
Save Kinzi/495d15a954d06e5a061d5a29e481a991 to your computer and use it in GitHub Desktop.
{
"commisions": [{
"id": 987654321, // OK
"network_id": "12345", // OK
"network_name": "ShareASale", // OK
"merchant_id": 843723, // OK, if supported by network API (almost all do)
"merchant_name": "DressLily", // OK, if supported by network API (almost all do)
"order_items": [{ // OK, if supported by network API.
"quantity": 1, // Most only have transactions info w/o "shopping cart" info.
"product_id": 123283, // Some have product names and id, some only have them sometimes (probably based on original tracking)
"product_name": "Black cat socks" // others don't have specific product info at all.
}, // Fallback probably need!
{
"quantity": 1,
"product_id": 123376,
"product_name": "Yellow tank"
}],
"subaffiliate_id": 3333, // OK, if supported by network API. Not all do pass a sub_id or custom value
"status": "settled", // OK for almost all networks in 3 states (open, cancelled, approved)
"status_history": [ // Most networks don't supply history here, only current state
"status": "new", // So I would have to build this in cache
"date": "2017-07-25 06:02:00.493" // postponable?
],
[
"status": "pending",
"date": "2017-07-26 02:10:33.938"
],
"sale_amount": "123.45", // OK, if supported by network API
"commission_amount": "20.25", // OK
"currency": "USD", // OK
"sale_date": "2017-07-25 03:02:00", // Depends on API some provide a click and a transaction date, some only one of those
"created_date": "2017-07-25 06:02:00.493", // OK
"last_modified_date": "2017-07-30 14:02:00.392" // OK
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment