FueTax Developers

Motor Fuel Tax Development

Identification and computation of excise taxes in real-time for financial transactions involving fuel products.

FueTax Determination integrates with existing financial, billing, e-commerce, or point of sale system to automate the process of identifying and computing indirect taxes on fuel transactions. It automates the process of completing and electronically filing fuel returns and schedules. It’s an easy to use, off-the-shelf tax solution for fuel suppliers, distributors, and traders, with extensive support for both volume-based and valuation taxes, including: excise, environmental, and sales & use taxes.

API Description

API Description

Test Excise Tax Fuel Request
Company : Company name
User Id : Company user id or company code
Transaction Date : Transaction date
Transaction number : Transaction number
Product Category : Predefined Category Code to classify the product type such as "Dyed Diesel"
Product Code : Industry standard Fuel Product Code "228"
Net Quantity : Net Gallons
Gross Quantity : Gross Gallons
Billed Quantity : Billed Gallons
Exchange Quantity : Gallons delivered/received per exchange agreement
Carrier name : Specific banner name of the carrier
Carrier FEIN : Carrier FEIN
Origin name : Specific banner name of the supplire sending shipment
Origin FEIN : Supplier FEIN
Origin address : Supplier Address
Origin city : Supplier city
Origin county : Supplier County
Origin state : Supplier sate
Origin zip code : Supplier zip code
Origin country : Supplier Country
Origin Terminal : Origin terminal
Origin class of trade : Company class of trade Retailer, Distributor, Supplier , Importer, Consignor
Destination name : Specific banner name of the customer receiving shipment
Destination FEIN : Customer FEIN
Destination address : Ship to address of the customer receiving shipment
Destination city : City of the customer receiving shipment
Destination county : County of the customer receiving shipment
Destination state : State of the customer receiving shipment
Destination zip code : Zip code of the customer receiving shipment
Destination country : Country of the customer receiving shipment "US", "CA"
Destination Terminal : Destination terminal
Destination class of trade : Company class of trade Retailer, Distributor, Supplier, Importer, Consignor
Movement Start Date : Start date of movement
Movement End Date : End date of movement
UOM : Unit of Measure "GL"
Currency : USD


Test Excise Tax Fuel Response
Result code : Success
Jurisdiction : Jurisdiction type "state", "county", "city"
Jurisdiction name : Jurisdiction name "TX"
Jurisdiction tax rate : Jurisdiction tax rate "3.05"
Jurisdiction tax amount : Jurisdiction tax amount "225.42"


Test Excise Tax Tobacco Response Error
Result code : "Error, Warning, Exception"
Summary : "State unavailable or incorrect format"
Details : "State must be two character state abbreviation"
Refer to field : "destination_state"
Severity : "Error, Warning, Exception"

REST JSON API

JSON API V1.5

Test Excise Tax Fuel Request
{ // transactions
"company":"TX Oil"
"invoice_number":"141826",
"invoice_date":"20150525",
"line_items":[
  {
    "transaction_number":"123",
    "bol_date":"20150523",
    "bol_number":"141826",
    "product":"jet fuel",
    "product_code":"130",
    "billed_quantity":"7391",
    "gross_quantity":"7500",
    "net_quantity":"7391",
    "exchange_quantity":"731",
    "carrier_fein":"860634977",
    "carrier_name":"DESERT REFINED",
    "origin_class_of_trade":"SUPPLIER",
    "origin_fein":"581091383",
    "origin_name":"MANS OIL CO.",
    "origin_street":"",
    "origin_city":"TUCSON",
    "origin_county":"",
    "origin_state":"AZ",
    "origin_terminal":"",
    "origin_zip":"",
    "origin_country":"US",
    "destination_city":"GREEN VALLEY",
    "destination_class_of_trade":"DISTRIBUTOR",
    "destination_county":"PIMA",
    "destination_fein":"370602744",
    "destination_name":"Caterpillar",
    "destination_state":"AZ",
    "destination_street":"123 Palm Grove Ln",
     "destination_terminal":"",
    "destination_zip":"",
    "destination_country":"US",
    "movement_start_date":"20150523",
    "movement_end_date":"20150523",
    "unit_of_measure":"GL",
    "currency":"USD",
  }
]
}


Test Excise Tax Fuel Response
{ // transactions
"company":"TX Oil"
"invoice_number":"141826",
"invoice_date":"20150525",
"line_items":[
  {
    "transaction_number":"123",
    "bol_date":"20150523",
    "bol_number":"141826",
    "product":"jet fuel",
    "product_code":"130",
    "billed_quantity":"7391",
    "gross_quantity":"7500",
    "net_quantity":"7391",
    "exchange_quantity":"731",
    "carrier_fein":"860634977",
    "carrier_name":"DESERT REFINED",
    "origin_class_of_trade":"SUPPLIER",
    "origin_fein":"581091383",
    "origin_name":"MANS OIL CO.",
    "origin_street":"",
    "origin_city":"Fort Worth",
    "origin_county":"",
    "origin_state":"TX",
    "origin_terminal":"",
    "origin_zip":"",
    "origin_country":"USA",
    "destination_city":"GREEN VALLEY",
    "destination_class_of_trade":"DISTRIBUTOR",
    "destination_county":"PIMA",
    "destination_fein":"370602744",
    "destination_name":"Caterpillar Co.",
    "destination_state":"AZ",
    "destination_street":"123 South Grove Ln",
     "destination_terminal":"",
    "destination_zip":"",
    "destination_country":"USA",
    "movement_start_date":"20150523",
    "movement_end_date":"20150523",
    "unit_of_measure":"GL",
    "currency":"USD",

    "tax_results":[
            {
              "jurisdiction":"state",
              "jur_name":"AZ"
              "jur_tax_rate":"3.05",
              "jur_tax_amount":'225.42"
            }
    ]
  }
]
}

End Point

End Point

URL AND METHOD

Development: POST https://www.developer.aviordata.net/1.0/tax/fue/get
Production: POST https://www.tax.aviordata.net/1.0/tax/fue/get

LOGIN

Post https://www.developer.aviordata.net/1.0/tax/user/login.json
Headers: Accept:application/json Content-type: application/json
Body: {"username":"avior", "password":"1234"}
RESPONSE: {'session_name': 'SSESS15015b0cac82dbe973e0c259d028a34h', 'sessid':
u'INa40aCVAbcBKvF1ODyPJXulhrvPa4-sqqKZOAdTnzq', 'token':
u'u3FNNRkQRV_prmo5Cc3w3agfOyOhgWa0wyozltzwngg'}

REQUEST

Post https://www.developer.aviordata.net/1.0/tax/fue/get
Headers: Accept:application/json Content-type: application/json application/json
cookie: SSESS15015b0cac82dbe973e0c259d028a34h=u'INa40aCVAbcBKvF1ODyPJXulhrvPa4-
sqqKZOAdTnzq token: u3FNNRkQRV_prmo5Cc3w3agfOyOhgWa0wyozltzwngg
Body: {"Transaction":{ //transactions ...}}
RESPONSE: {"Transaction":{ //transactions ,"result_code":"Success", "tax_results":
[ {...} ] }} or {"Transaction":{ //transactions ,"result_code":"Error", "messages":[ {...} ] }}

LOGOUT

post https://www.developer.aviordata.net/1.0/tax/user/logout.json
headers: Accept:application/json Content-type: application/json application/json
cookie: SSESS15015b0cac82dbe973e0c259d028a34h=u'INa40aCVAbcBKvF1ODyPJXulhrvPa4-
sqqKZOAdTnzq token: u3FNNRkQRV_prmo5Cc3w3agfOyOhgWa0wyozltzwngg
response body: [true]

PHP Client

Client Sample

PHP
<?php
$ArrayOfLineItem
= array(
   
"transaction_number" => "123",
   
"bol_date" => "20150523",
   
"bol_number" => "141826",
   
"product" => "jet fuel",
   
"product_code" => "130",
   
"billed_quantity" => "7391",
   
"gross_quantity" => "7500",
   
"net_quantity" => "7391",
   
"exchange_quantity" => "731",
   
"carrier_fein" => "860634977",
   
"carrier_name" => "DESERT REFINED",
   
"origin_class_of_trade" => "SUPPLIER",
   
"origin_fein" => "581091383",
   
"origin_name" => "MANS OIL CO.",
   
"origin_street" => "",   
   
"origin_city" => "TUCSON",
   
"origin_county" => "",   
   
"origin_state" => "AZ",
   
"origin_terminal" => "",   
   
"origin_zip" => "",   
   
"origin_country" => "US",   
   
"destination_city" => "GREEN VALLEY",
   
"destination_class_of_trade" => "DISTRIBUTOR",
   
"destination_county" => "PIMA",
   
"destination_fein" => "370602744",
   
"destination_name" => "Caterpillar",
   
"destination_state" => "AZ",
   
"destination_street" => "123 Palm Grove Ln",   
    
"destination_terminal" => "",   
   
"destination_zip" => "",   
   
"destination_country" => "US",   
   
"movement_start_date" => "20150523",
   
"movement_end_date" => "20150523",
   
"unit_of_measure" => "GL",
   
"currency" => "USD",
);

$ArrayOfLineItems = array($ArrayOfLineItem);

$Transaction = array(
  
"company" => "Fuel Dist Inc.",
  
"invoice_number" => "141826",
  
"invoice_date" => "20150525",
  
"line_items" => $ArrayOfLineItems
);

$data = array("transaction" => $Transaction);

$url = 'https://www.developer.aviordata.net/1.0/tax/';

//Initiate cURL.
$ch = curl_init($url.'user/login.json');
curl_setopt($ch, CURLOPT_VERBOSE, true);

// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$jsonData = array(
   
'username' => 'avior',
   
'password' => '1234'
);

//Encode the array into JSON.
$jsonDataEncoded = json_encode($jsonData);
 
//Tell cURL that we want to send a POST request.
curl_setopt($ch, CURLOPT_POST, 1);
 
//Attach our encoded JSON string to the POST fields.
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
 
//Set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','accept:application/json','Connection: keep-alive'));
 
//Execute the request
$result = curl_exec($ch);
$resp = json_decode($result, true);

curl_setopt($ch, CURLOPT_URL, $url.'fue/get');
$DataEncoded = json_encode($data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $DataEncoded);
$session_name = $resp['session_name'];
$sessid = $resp['sessid'];
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','accept:application/json','Connection: keep-alive','X-CSRFToken: '.$resp['token'],'Cookie: '.$session_name.'='.$sessid));

$result = curl_exec($ch);
print_r($result);

?>

C# Client

Client Sample

C#
var ArrayOfLineItem = new
{
    transaction_number = "123",
    bol_date = "20150523",
    bol_number = "141826",
    product = "jet fuel",
    product_code = "130",
    billed_quantity = "7391",
    gross_quantity = 7500",
    net_quantity = "7391",
    exchange_quantity = "731",
    carrier_fein = "860634977",
    carrier_name = "DESERT REFINED",
    origin_class_of_trade = "SUPPLIER",
    origin_fein = "581091383",
    origin_name = "MANS OIL CO.",
    origin_street = "",
    origin_city = "TUCSON",
    origin_county = "",
    origin_state = "AZ",
    origin_terminal = "",
    origin_zip = "",
    origin_country = "US",
    destination_city = "GREEN VALLEY",
    destination_class_of_trade = "DISTRIBUTOR",
    destination_county = "PIMA",
    destination_fein = "370602744",
    destination_name = "Caterpillar",
    destination_state = "AZ",
    destination_street = "123 Palm Grove Ln",
    destination_terminal = "",
    destination_zip = "",
    destination_country = "US",
    movement_start_date = "20150523",
    movement_end_date = "20150523",
    unit_of_measure = "GL",
    currency = "USD",
};

ArrayOfLineItems = new[]
{
    ArrayOfLineItem
};

Transaction = new
{
   company = "Fuel Dist Inc.",
   invoice_number = "141826",
   invoice_date = "20150525",
   line_items = ArrayOfLineItems
};

data = new
{
    transaction = Transaction
};

// login request
var login = new
{
    username = "avior",
    password = "1234"
};
var api_url = "https://www.developer.aviordata.net/1.0/tax/"

var request = (HttpWebRequest)WebRequest.Create(api_url + "user/login.json");
request.ContentType = "application/json";
request.Accept = "application/json";
request.Method = "POST";

using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
    string json = new JavaScriptSerializer().Serialize(login);
    streamWriter.Write(json);
}

// login response
var response = (HttpWebResponse)request.GetResponse();
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
    var result = streamReader.ReadToEnd();
    var jss = new JavaScriptSerializer();
    var resp = jss.Deserialize<Dictionary<string, dynamic>>(result);
}

var token = resp["token"].ToString();
var session_name = resp["session_name"].ToString();
var sessid = resp["sessid"].ToString();

// tax request
var request = (HttpWebRequest)WebRequest.Create(api_url + "fue/get");
request.ContentType = "application/json";
request.Method = "POST";
request.Headers["x-csrf-token"] = token;
request.Headers["cookie"] = session_name + "=" + session_id;

using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
    string json = new JavaScriptSerializer().Serialize(data);
    streamWriter.Write(json);
}

// tax response
var response = (HttpWebResponse)request.GetResponse();
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
    var result = streamReader.ReadToEnd();
    var jss = new JavaScriptSerializer();
    var resp = jss.Deserialize<Dictionary<string, dynamic>>(result);
}
var result_code = resp["transaction"]["line_items"][0]["result_code"].ToString();
if (result_code == "Success")
{
    Console.WriteLine(result_code);
}

// logout
var logout = new
{
};

var request = (HttpWebRequest)WebRequest.Create(api_url + "user/logout.json");
request.ContentType = "application/json";
request.Method = "POST";
request.Headers["x-csrf-token"] = token;
request.Headers["cookie"] = session_name + "=" + session_id;

using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
    string json = new JavaScriptSerializer().Serialize(data);
    streamWriter.Write(json);
}

Ruby Client

Client Sample

Ruby
require 'net/http'
require 'json'
require 'uri'

data = {
    "transaction" => {
        "company" => "Fuel Dist Inc.",
        "invoice_number" => "141826",
        "invoice_date" => "20150525",
        "line_items" => [
            {
                "transaction_number" => "123",
                "bol_date" => "20150523",
                "bol_number" => "141826",
                "product" => "jet fuel",
                "product_code" => "130",
                "billed_quantity" => "7391",
                "gross_quantity" => 7500",
                "net_quantity" => "7391",
                "exchange_quantity" => "731",
                "carrier_fein" => "860634977",
                "carrier_name" => "DESERT REFINED",
                "origin_class_of_trade" => "SUPPLIER",
                "origin_fein" => "581091383",
                "origin_name" => "MANS OIL CO.",
                "origin_street" => "",
                "origin_city" => "TUCSON",
                "origin_county" => "",
                "origin_state" => "AZ",
                "origin_terminal" => "",
                "origin_zip" => "",
                "origin_country" => "US",
                "destination_city" => "GREEN VALLEY",
                "destination_class_of_trade" => "DISTRIBUTOR",
                "destination_county" => "PIMA",
                "destination_fein" => "370602744",
                "destination_name" => "Caterpillar",
                "destination_state" => "AZ",
                "destination_street" => "123 Palm Grove Ln",
                "destination_terminal" => "",
                "destination_zip" => "",
                "destination_country" => "US",
                "movement_start_date" => "20150523",
                "movement_end_date" => "20150523",
                "unit_of_measure" => "GL",
                "currency" => "USD",
            }
        ]
    }
}.to_json

login = {
    "username" => "avior",
    "password" => "1234"
}.to_json

logout = {
}.to_json

api_url = "https://www.developer.aviordata.net/1.0/tax/"

# login request
uri = URI.parse(api_url + "user/login.json")
http = Net::HTTP.new(uri.host, uri.port)
header = {
    'Content-Type' => 'application/json',
    'Accept' => 'application/json'
};
request = Net::HTTP::Post.new(
                              uri.request_uri,
                              header
)
request.body = json
response = http.request(request)

# login response
resp = response.body
puts(resp)
rdata = JSON.parse(resp)
token = rdata['token']
session_name = rdata['session_name']
sessid = rdata['sessid']

# tax request
uri = URI.parse(api_url + "fue/get")
http = Net::HTTP.new(uri.host, uri.port)
header['x-csrf-token'] = token;
header['cookie'] = cookie;
request = Net::HTTP::Post.new(
                              uri.request_uri,
                              header
)
request.body = json
response = http.request(request)

# tax response
resp = response.body
puts(resp)
rdata = JSON.parse(resp)
result_code = rdata["transaction"]["line_items"][0]["result_code"]
if result_code == 'Success'
    puts 'result: '+result_code
end

# logout request
uri = URI.parse(api_url + "user/logout.json")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(
                              uri.request_uri,
                              header
)
request.body = json
response = http.request(request)