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' \\ \ data '{ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "10 0 0 127", "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, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" {}, "shippingrefundedamount" {}, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" {} } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "10 0 0 127", "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, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" {}, "shippingrefundedamount" {}, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" {} } }); 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 body = json dump({ "accountid" "e520 ba9a 367 60b", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "call center", "items" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "10 0 0 127", "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, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" {}, "shippingrefundedamount" {}, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" {} } }) 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" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "itemcompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" } } ], "ordercompensationdata" { "initiationtime" 1415287568000, "requestedreturntype" "ship to warehouse" }, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "10 0 0 127", "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, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "2356fdse0rr489", "status" { "itemstatus" \[ { "basicitemdata" { "discount" { "couponcodeused" "fathersday2015", "coupondiscountamount" {} }, "name" "white genericbrand handbag", "price" {}, "quantity" 1, "type" "tangible" }, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" } } ], "merchantagentdata" {}, "shippingrefundedamount" {}, "statusdata" { "compensationtypegranted" "refund", "reasoncategory" "changed my mind", "returnmethodgranted" "ship to warehouse", "statuslog" {}, "updatedstatus" "accepted by merchant" }, "totalgrantedamount" {} } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // example unifiedcompensationrequestresponse { "correlationid" "hgj7512345h3de", "decisionreason" "", "forterdecision" "approve", "merchantpolicyid" "0ee8ba28a8654c659addbae9253b707c", "recommendations" \[ "" ], "status" "success" }// 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)