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 '{"body" {"accountid" "string","additionaleventidentifiers" {},"additionalinformation" {},"compensationrequest" {"initiationtype" "string\<call center | in store | chat | online | self service>","items" \[{"discount" {},"name" "string","price" {},"quantity" 0,"type" "string\<tangible | non tangible>"},{"initiationtime" 0,"requestedreturntype" "string\<ship to warehouse | in store | no return>"}],"ordercompensationdata" {},"totalrequestedamount" {}},"connectioninformation" {"customerip" "string","useragent" "string"},"eventid" "string","eventtime" 0,"isguestaccount"\ false,"merchantagentdata" {},"merchantidentifiers" {},"originalorderid" "string","status" {}}}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "body" { "accountid" "string", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "string\<call center | in store | chat | online | self service>", "items" \[ { "discount" {}, "name" "string", "price" {}, "quantity" 0, "type" "string\<tangible | non tangible>" }, { "initiationtime" 0, "requestedreturntype" "string\<ship to warehouse | in store | no return>" } ], "ordercompensationdata" {}, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "string", "useragent" "string" }, "eventid" "string", "eventtime" 0, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "string", "status" {} } }); 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({ "body" { "accountid" "string", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "string\<call center | in store | chat | online | self service>", "items" \[ { "discount" {}, "name" "string", "price" {}, "quantity" 0, "type" "string\<tangible | non tangible>" }, { "initiationtime" 0, "requestedreturntype" "string\<ship to warehouse | in store | no return>" } ], "ordercompensationdata" {}, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "string", "useragent" "string" }, "eventid" "string", "eventtime" 0, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "string", "status" {} } }) 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({ "body" { "accountid" "string", "additionaleventidentifiers" {}, "additionalinformation" {}, "compensationrequest" { "initiationtype" "string\<call center | in store | chat | online | self service>", "items" \[ { "discount" {}, "name" "string", "price" {}, "quantity" 0, "type" "string\<tangible | non tangible>" }, { "initiationtime" 0, "requestedreturntype" "string\<ship to warehouse | in store | no return>" } ], "ordercompensationdata" {}, "totalrequestedamount" {} }, "connectioninformation" { "customerip" "string", "useragent" "string" }, "eventid" "string", "eventtime" 0, "isguestaccount" false, "merchantagentdata" {}, "merchantidentifiers" {}, "originalorderid" "string", "status" {} } }) 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)