EU Travel Path
1 min
code examples curl request post \\ \ url https //api accertify net//rtd01 eu accertify net/icnowimport/{importerid} \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "transactionid" "abc123456", "transactiontype" "preauthorization", "transactiondatetime" "2022 03 11t17 07 24 07 00", "paymentamount" 1082 91, "currencycode" "usd", "success" "", "purchasetype" "", "eventsource" "", "paymentmethods" \[ { "paymenttype" "" } ], "flightinformation" { "pnr" "abc123", "flighttype" "multi city", "segments" \[ {} ], "passengers" \[ {} ] }, "event" { "eventid" "234kl5jkl523jkl423jkl", "eventtype" "", "eventname" "fleetwood mac", "eventdatetime" "2022 03 11t17 07 24 07 00" } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "transactionid" "abc123456", "transactiontype" "preauthorization", "transactiondatetime" "2022 03 11t17 07 24 07 00", "paymentamount" 1082 91, "currencycode" "usd", "success" "", "purchasetype" "", "eventsource" "", "paymentmethods" \[ { "paymenttype" "" } ], "flightinformation" { "pnr" "abc123", "flighttype" "multi city", "segments" \[ {} ], "passengers" \[ {} ] }, "event" { "eventid" "234kl5jkl523jkl423jkl", "eventtype" "", "eventname" "fleetwood mac", "eventdatetime" "2022 03 11t17 07 24 07 00" } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api accertify net//rtd01 eu accertify net/icnowimport/{importerid}", 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 accertify net//rtd01 eu accertify net/icnowimport/{importerid}") 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({ "transactionid" "abc123456", "transactiontype" "preauthorization", "transactiondatetime" "2022 03 11t17 07 24 07 00", "paymentamount" 1082 91, "currencycode" "usd", "success" "", "purchasetype" "", "eventsource" "", "paymentmethods" \[ { "paymenttype" "" } ], "flightinformation" { "pnr" "abc123", "flighttype" "multi city", "segments" \[ {} ], "passengers" \[ {} ] }, "event" { "eventid" "234kl5jkl523jkl423jkl", "eventtype" "", "eventname" "fleetwood mac", "eventdatetime" "2022 03 11t17 07 24 07 00" } }) response = https request(request) puts response read body import requests import json url = "https //api accertify net//rtd01 eu accertify net/icnowimport/{importerid}" payload = json dumps({ "transactionid" "abc123456", "transactiontype" "preauthorization", "transactiondatetime" "2022 03 11t17 07 24 07 00", "paymentamount" 1082 91, "currencycode" "usd", "success" "", "purchasetype" "", "eventsource" "", "paymentmethods" \[ { "paymenttype" "" } ], "flightinformation" { "pnr" "abc123", "flighttype" "multi city", "segments" \[ {} ], "passengers" \[ {} ] }, "event" { "eventid" "234kl5jkl523jkl423jkl", "eventtype" "", "eventname" "fleetwood mac", "eventdatetime" "2022 03 11t17 07 24 07 00" } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // success response { "transaction results" { "transaction id" "", "cross reference" "", "rules tripped" "", "total score" 0, "recommendation code" "", "remarks" "" }, "validation response" { "warnings" "", "originalvalues" "", "status" "" } }// error response { "validation response" { "errors" "", "warnings" "", "originalvalues" "", "status" "" } }