Core API
Compensation
Compensation request
1 min
code examples curl location globoff 'https //api forter secure com/v2/unified compensation request/{id}' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'api version 10 1' \\ \ header 'x forter siteid 8b47c6d423ba' \\ \ header 'authorization basic \<base64 encoded api key >' \\ \ data '{ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "connectioninformation" { "checkouttoolssessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "customerip" "10 0 0 127", "fortermobileuid" "6429751237891", "fortertokencookie" "249453te8tbf9355186fet0ken547b95 2786972955236 ude52 n5 8dg", "merchantdeviceidentifier" "hgj7512345h3", "merchantprovidedsessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "useragent" "mozilla/5 0 (windows nt 6 1; wow64) applewebkit/537 36 (khtml, like gecko) chrome/47 0 2526 73 safari/537 36" }, "eventid" "r48987fgdse0r", "eventtime" 1415287568000, "hasproofofpurchase" true, "isguestaccount" false, "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "merchantidentifiers" { "merchantdomain" "handbagsexpressdiscounts com", "merchantname" "handbags express discounts" }, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "replacementorderid" "2356fdse0rr489", "shippingrefundedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("api version", "10 1"); myheaders append("x forter siteid", "8b47c6d423ba"); myheaders append("authorization", "basic \<base64 encoded api key >"); var raw = json stringify({ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "connectioninformation" { "checkouttoolssessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "customerip" "10 0 0 127", "fortermobileuid" "6429751237891", "fortertokencookie" "249453te8tbf9355186fet0ken547b95 2786972955236 ude52 n5 8dg", "merchantdeviceidentifier" "hgj7512345h3", "merchantprovidedsessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "useragent" "mozilla/5 0 (windows nt 6 1; wow64) applewebkit/537 36 (khtml, like gecko) chrome/47 0 2526 73 safari/537 36" }, "eventid" "r48987fgdse0r", "eventtime" 1415287568000, "hasproofofpurchase" true, "isguestaccount" false, "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "merchantidentifiers" { "merchantdomain" "handbagsexpressdiscounts com", "merchantname" "handbags express discounts" }, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "replacementorderid" "2356fdse0rr489", "shippingrefundedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api forter secure com/v2/unified compensation request/{id}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api forter secure com/v2/unified compensation request/{id}") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["api version"] = "10 1" request\["x forter siteid"] = "8b47c6d423ba" request\["authorization"] = "basic \<base64 encoded api key >" request body = json dump({ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "connectioninformation" { "checkouttoolssessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "customerip" "10 0 0 127", "fortermobileuid" "6429751237891", "fortertokencookie" "249453te8tbf9355186fet0ken547b95 2786972955236 ude52 n5 8dg", "merchantdeviceidentifier" "hgj7512345h3", "merchantprovidedsessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "useragent" "mozilla/5 0 (windows nt 6 1; wow64) applewebkit/537 36 (khtml, like gecko) chrome/47 0 2526 73 safari/537 36" }, "eventid" "r48987fgdse0r", "eventtime" 1415287568000, "hasproofofpurchase" true, "isguestaccount" false, "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "merchantidentifiers" { "merchantdomain" "handbagsexpressdiscounts com", "merchantname" "handbags express discounts" }, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "replacementorderid" "2356fdse0rr489", "shippingrefundedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } } }) response = https request(request) puts response read body import requests import json url = "https //api forter secure com/v2/unified compensation request/{id}" payload = json dumps({ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "compensationtyperequested" "refund", "initiationtime" 1415287568000, "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "connectioninformation" { "checkouttoolssessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "customerip" "10 0 0 127", "fortermobileuid" "6429751237891", "fortertokencookie" "249453te8tbf9355186fet0ken547b95 2786972955236 ude52 n5 8dg", "merchantdeviceidentifier" "hgj7512345h3", "merchantprovidedsessionid" "htgdvc232fdfdfdfkdjk87382938mcndjc2f4gbbgd", "useragent" "mozilla/5 0 (windows nt 6 1; wow64) applewebkit/537 36 (khtml, like gecko) chrome/47 0 2526 73 safari/537 36" }, "eventid" "r48987fgdse0r", "eventtime" 1415287568000, "hasproofofpurchase" true, "isguestaccount" false, "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "merchantidentifiers" { "merchantdomain" "handbagsexpressdiscounts com", "merchantname" "handbags express discounts" }, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "category" "apparel and accessories", "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } }, "name" "white genericbrand handbag", "price" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "productid" "ag54352r7768kko", "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" { "merchantagentid" "hg36885tz", "merchantagentname" "john smith" }, "replacementorderid" "2356fdse0rr489", "shippingrefundedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" }, "statusdata" { "compensationtypegranted" "refund", "internalreasoncategory" "defective item", "reasoncategory" "changed my mind", "returncondition" "damaged", "returnmethodgranted" "ship to warehouse", "statuslog" { "arrivedtowarehousetime" 1420070400000, "initiationtime" 1415287568000, "initiationtype" "call center", "shippedbycustomertime" 1420070400000 }, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" { "amountlocalcurrency" "105 55", "amountusd" "99 95", "currency" "cad" } } }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'api version' '10 1', 'x forter siteid' '8b47c6d423ba', 'authorization' 'basic \<base64 encoded api key >' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // example unifiedcompensationrequestresponse { "correlationid" "", "decisionreason" "", "forterdecision" "", "merchantpolicyid" "", "recommendations" \[ "" ], "status" "" }// bad request (often missing a required parameter) // unauthorized (no valid api key provided) // not found (the requested item doesn't exist) // server error (something went wrong on forter's end)