Open API - Update Tracking

API Endpoint:

URL: https://api.routeit.cloud/konnektive/v2/post/json/update_tracking
Protocol: HTTPS
Method: POST
Authentication: API Key and Secret via header
Content Type: application/json

All API calls must include this header to authorize the request.
Replace YOUR-KEY-HERE with your API key and YOUR-SECRET-HERE with your secret.
Header Key Header Value
api_key YOUR-KEY-HERE
secret YOUR-SECRET-HERE
Content-Type application/json

Body:

The body must be sent in JSON format. The keys include company_name, first, last, email, phone, and transactions.
{
    "route_quote_id": "5",
    "tracking_number": "a1234567890",
    "shipped_date": "08-15-2099",
    "shipping_total": "7.49",
    "handling_total": "0"
}
                    
Body Key Body Value Required Description
route_quote_id string MAYBE Valid quote id from the Request Quote API. Required, unless route_order_id is provided.
route_order_id string MAYBE Valid insure order id from the Insure Order API. Required, unless route_quote_id is provided.
tracking_number string YES Valid carrier generated tracking number.
shipped_date string YES Date order was shipped. Prefer ISO 8601 format.
shipping_total integer, double or float greater than or equal to zero YES Total shipping cost charged to customer for this order.
handling_total integer, double or float greater than or equal to zero YES Total handling cost charged to customer for this order.
shipping_carrier_code supported shipping carrier code as a string no Carrier order was shipped through. Supported shipping carrier codes can be pulled from our Shipping Carrier Codes API.
shipping_method string no Method used for shipping.
custom_c1 string no Custom field that accepts any text string. Max 255 characters.
custom_c2 string no Custom field that accepts any text string. Max 255 characters.
custom_c3 string no Custom field that accepts any text string. Max 255 characters.
custom_c4 string no Custom field that accepts any text string. Max 255 characters.

Postman:

Code Examples:

The following are examples for reference and may require library dependencies not described here. An understanding of REST services, JSON, and web security is required to develop service clients.
Javascript - Jquery AJAX
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.routeit.cloud/open_api/v1/post/json/update_tracking",
  "method": "POST",
  "headers": {
    "api_key": "YOUR-KEY-HERE",
    "secret": "YOUR-SECRET-HERE",
    "content-type": "application/json",
    "cache-control": "no-cache"
  },
  "processData": false,
  "data": "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
                            
Javascript - XHR
var data = JSON.stringify({
  "route_quote_id": "5",
  "tracking_number": "a1234567890",
  "shipped_date": "08-15-2099",
  "shipping_total": "7.49",
  "handling_total": "0"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.routeit.cloud/open_api/v1/post/json/update_tracking");
xhr.setRequestHeader("api_key", "YOUR-KEY-HERE");
xhr.setRequestHeader("secret", "YOUR-SECRET-HERE");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
                            
Node JS - Native
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.routeit.cloud",
  "port": null,
  "path": "/open_api/v1/post/json/update_tracking",
  "headers": {
    "api_key": "YOUR-KEY-HERE",
    "secret": "YOUR-SECRET-HERE",
    "content-type": "application/json",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ route_quote_id: '5',
  tracking_number: 'a1234567890',
  shipped_date: '08-15-2099',
  shipping_total: '7.49',
  handling_total: '0' }));
req.end();
                            
Node JS - Request
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.routeit.cloud/open_api/v1/post/json/update_tracking',
  headers:
   { 'cache-control': 'no-cache',
     'content-type': 'application/json',
     secret: 'YOUR-SECRET-HERE',
     api_key: 'YOUR-KEY-HERE' },
  body:
   { route_quote_id: '5',
     tracking_number: 'a1234567890',
     shipped_date: '08-15-2099',
     shipping_total: '7.49',
     handling_total: '0' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
                            
Node JS - Unirest
var unirest = require("unirest");

var req = unirest("POST", "https://api.routeit.cloud/open_api/v1/post/json/update_tracking");

req.headers({
  "cache-control": "no-cache",
  "content-type": "application/json",
  "secret": "YOUR-SECRET-HERE",
  "api_key": "YOUR-KEY-HERE"
});

req.type("json");
req.send({
  "route_quote_id": "5",
  "tracking_number": "a1234567890",
  "shipped_date": "08-15-2099",
  "shipping_total": "7.49",
  "handling_total": "0"
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
                            
Java - OK HTTP
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}");
Request request = new Request.Builder()
  .url("https://api.routeit.cloud/open_api/v1/post/json/update_tracking")
  .post(body)
  .addHeader("api_key", "YOUR-KEY-HERE")
  .addHeader("secret", "YOUR-SECRET-HERE")
  .addHeader("content-type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
                            
Java - Unirest
HttpResponse<String> response = Unirest.post("https://api.routeit.cloud/open_api/v1/post/json/update_tracking")
  .header("api_key", "YOUR-KEY-HERE")
  .header("secret", "YOUR-SECRET-HERE")
  .header("content-type", "application/json")
  .header("cache-control", "no-cache")
  .body("{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}")
  .asString();
                            
C# (ReSharp)
var client = new RestClient("https://api.routeit.cloud/open_api/v1/post/json/update_tracking");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddHeader("secret", "YOUR-SECRET-HERE");
request.AddHeader("api_key", "YOUR-KEY-HERE");
request.AddParameter("application/json", "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                            
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.routeit.cloud/open_api/v1/post/json/update_tracking"

	payload := strings.NewReader("{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api_key", "YOUR-KEY-HERE")
	req.Header.Add("secret", "YOUR-SECRET-HERE")
	req.Header.Add("content-type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                            
Python - http.client (Python 3)
import http.client

conn = http.client.HTTPSConnection("api.routeit.cloud")

payload = "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}"

headers = {
    'api_key': "YOUR-KEY-HERE",
    'secret': "YOUR-SECRET-HERE",
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("POST", "/open_api/v1/post/json/update_tracking", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                            
Python - Requests
import requests

url = "https://api.routeit.cloud/open_api/v1/post/json/update_tracking"

payload = "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}"
headers = {
    'api_key': "YOUR-KEY-HERE",
    'secret': "YOUR-SECRET-HERE",
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
                            
Ruby (NET::Http)
require 'uri'
require 'net/http'

url = URI("https://api.routeit.cloud/open_api/v1/post/json/update_tracking")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["api_key"] = 'YOUR-KEY-HERE'
request["secret"] = 'YOUR-SECRET-HERE'
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request.body = "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}"

response = http.request(request)
puts response.read_body
                            
PHP - HttpRequest
<?php

$request = new HttpRequest();
$request->setUrl('https://api.routeit.cloud/open_api/v1/post/json/update_tracking');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'secret' => 'YOUR-SECRET-HERE',
  'api_key' => 'YOUR-KEY-HERE'
));

$request->setBody('{
	"route_quote_id": "5",
	"tracking_number": "a1234567890",
	"shipped_date": "08-15-2099",
	"shipping_total": "7.49",
	"handling_total": "0"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
                            
PHP - peci_http
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
	"route_quote_id": "5",
	"tracking_number": "a1234567890",
	"shipped_date": "08-15-2099",
	"shipping_total": "7.49",
	"handling_total": "0"
}');

$request->setRequestUrl('https://api.routeit.cloud/open_api/v1/post/json/update_tracking');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'secret' => 'YOUR-SECRET-HERE',
  'api_key' => 'YOUR-KEY-HERE'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
                            
PHP - cURL
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.routeit.cloud/open_api/v1/post/json/update_tracking",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}",
  CURLOPT_HTTPHEADER => array(
    "api_key: YOUR-KEY-HERE",
    "cache-control: no-cache",
    "content-type: application/json",
    "secret: YOUR-SECRET-HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                            
HTTP
POST /open_api/v1/post/json/update_tracking HTTP/1.1
Host: api.routeit.cloud
api_key: YOUR-KEY-HERE
secret: YOUR-SECRET-HERE
Content-Type: application/json
Cache-Control: no-cache

{
	"route_quote_id": "5",
	"tracking_number": "a1234567890",
	"shipped_date": "08-15-2099",
	"shipping_total": "7.49",
	"handling_total": "0"
}
                            
Shell - wget
wget --quiet \
  --method POST \
  --header 'api_key: YOUR-KEY-HERE' \
  --header 'secret: YOUR-SECRET-HERE' \
  --header 'content-type: application/json' \
  --header 'cache-control: no-cache' \
  --body-data '{\n	"route_quote_id": "5",\n	"tracking_number": "a1234567890",\n	"shipped_date": "08-15-2099",\n	"shipping_total": "7.49",\n	"handling_total": "0"\n}' \
  --output-document \
  - https://api.routeit.cloud/open_api/v1/post/json/update_tracking
                            
Shell - Httpie
echo '{
	"route_quote_id": "5",
	"tracking_number": "a1234567890",
	"shipped_date": "08-15-2099",
	"shipping_total": "7.49",
	"handling_total": "0"
}' |  \
  http POST https://api.routeit.cloud/open_api/v1/post/json/update_tracking \
  api_key:YOUR-KEY-HERE \
  cache-control:no-cache \
  content-type:application/json \
  secret:YOUR-SECRET-HERE
                            
Shell - cURL
curl --request POST \
  --url https://api.routeit.cloud/open_api/v1/post/json/update_tracking \
  --header 'api_key: YOUR-KEY-HERE' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --header 'secret: YOUR-SECRET-HERE' \
  --data '{\n	"route_quote_id": "5",\n	"tracking_number": "a1234567890",\n	"shipped_date": "08-15-2099",\n	"shipping_total": "7.49",\n	"handling_total": "0"\n}'
                            
cURL
curl -X POST -H "api_key: YOUR-KEY-HERE" -H "secret: YOUR-SECRET-HERE" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H '{
	"route_quote_id": "5",
	"tracking_number": "a1234567890",
	"shipped_date": "08-15-2099",
	"shipping_total": "7.49",
	"handling_total": "0"
}' "https://api.routeit.cloud/open_api/v1/post/json/update_tracking"
                            
C (LibCurl)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.routeit.cloud/open_api/v1/post/json/update_tracking");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "secret: YOUR-SECRET-HERE");
headers = curl_slist_append(headers, "api_key: YOUR-KEY-HERE");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}");

CURLcode ret = curl_easy_perform(hnd);
                            
Objective-C (NSURL)
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"api_key": @"YOUR-KEY-HERE",
                           @"secret": @"YOUR-SECRET-HERE",
                           @"content-type": @"application/json",
                           @"cache-control": @"no-cache" };
NSDictionary *parameters = @{ @"route_quote_id": @"5",
                              @"tracking_number": @"a1234567890",
                              @"shipped_date": @"08-15-2099",
                              @"shipping_total": @"7.49",
                              @"handling_total": @"0" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.routeit.cloud/open_api/v1/post/json/update_tracking"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
                            
Swift (NSURL)
import Foundation

let headers = [
  "api_key": "YOUR-KEY-HERE",
  "secret": "YOUR-SECRET-HERE",
  "content-type": "application/json",
  "cache-control": "no-cache"
]
let parameters = [
  "route_quote_id": "5",
  "tracking_number": "a1234567890",
  "shipped_date": "08-15-2099",
  "shipping_total": "7.49",
  "handling_total": "0"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.routeit.cloud/open_api/v1/post/json/update_tracking")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
                            
OCaml (Cohttp)
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "https://api.routeit.cloud/open_api/v1/post/json/update_tracking" in
let headers = Header.init ()
  |> fun h -> Header.add h "api_key" "YOUR-KEY-HERE"
  |> fun h -> Header.add h "secret" "YOUR-SECRET-HERE"
  |> fun h -> Header.add h "content-type" "application/json"
  |> fun h -> Header.add h "cache-control" "no-cache"
in
let body = Cohttp_lwt_body.of_string "{\n\t\"route_quote_id\": \"5\",\n\t\"tracking_number\": \"a1234567890\",\n\t\"shipped_date\": \"08-15-2099\",\n\t\"shipping_total\": \"7.49\",\n\t\"handling_total\": \"0\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
                            

Response:

The response returns JSON and consists of the result, error_messages, and data.
{
    "result": "SUCCESS",
    "error_messages": null,
    "data": {
        "route_order_id": 2,
        "route_quote_id": 5,
        "shipping_total": 7.49,
        "handling_total": 0,
        "shipping_carrier_code": null,
        "shipping_method": null,
        "shipped_date": "08-15-2099",
        "tracking_number": "a1234567890",
        "custom_c1": null,
        "custom_c2": null,
        "custom_c3": null,
        "custom_c4": null,
        "ip_address": "192.182.192.205",
        "created": 1481859730033
    }
}
                
Response Body Key Response Body Value Description
result SUCCESS or ERROR Only returns SUCCESS or ERROR.
error_messages null or error messages Returns null if result is SUCCESS or an array of error strings if result is ERROR.
data data envelope or null Returns data envelope if result is SUCCESS or null if result is ERROR.
route_quote_id integer The Route Quote ID associated with this order.
route_order_id integer The Route Insure Order ID associated with this order.
shipping_total float Reiterates the value sent in to confirm acceptance.
handling_total float Reiterates the value sent in to confirm acceptance.
shipping_carrier_code string Reiterates the value sent in to confirm acceptance.
shipping_method string Reiterates the value sent in to confirm acceptance.
shipped_date string Reiterates the value sent in to confirm acceptance.
tracking_number string Reiterates the value sent in to confirm acceptance.
custom_c1 string Reiterates the value sent in to confirm acceptance.
custom_c2 string Reiterates the value sent in to confirm acceptance.
custom_c3 string Reiterates the value sent in to confirm acceptance.
custom_c4 string Reiterates the value sent in to confirm acceptance.
ip_address string IP address of the server making the request.
created timestamp Timestamp of the request.

Errors:

This API can return the following errors as strings:
This API requires request method POST.
This API call must include a valid partner_key in the header to authenticate.
Invalid api_key or secret.
No billing setup for these keys. Live API requests require valid billing. If this is a test, use the Test API keys.
Request must include a valid route_order_id or route_quote_id to update tracking.
Unable to find route_order_id ##### or route_quote_id ##### associated to api_key #####.
Missing ALL required parameters.
Missing required parameter tracking_number.
Missing required parameter shipped_date.
Parameter shipping_total must be zero or greater.
Parameter handling_total must be zero or greater.
Value for shipping_carrier_code: "+tracking.getShipping_carrier_code()+" is invalid.
Invalid value for shipping_carrier_code.