LogoLogo
Web PortalContact Support
  • Fast-Weigh Knowledge Base
  • Tutorials
    • Tutorials Overview
    • Logging in for the First Time
    • Navigating the Web Portal
    • Using the Ticket Query
    • Generating Reports
    • Using the Ticketing App
  • How To Guides
    • How To Guides Overview
    • How to Create New Records
      • Creating New Web Portal Users
      • Creating Tax Codes
      • Creating Billing Terms and Modes
      • Creating a New Customer
      • Creating a New Product
      • Creating a New Pricing Template
      • Creating a New Truck
      • Creating a New Hauler
      • Creating New Orders
      • Creating Invoices
      • Creating Payments
      • Creating Statements
      • Creating Hauler Pay Statement
      • Creating a New Region
      • Creating a New Location
      • Creating a New Yard
    • How to Update Pricing
      • Changing Order Product Pricing
      • Bulk Updating Open Order Pricing
    • How to Import Tickets
    • How to Edit Tickets
      • Edit via Ticket Query
      • Edit via Ticket Bulk Edit
    • How to Edit an Invoice
      • Charge & Cash Pay Types
    • How to Track Inventory
  • References
    • New Pricing Tools
    • References Overview
    • Web Portal
      • Home
      • Load-Out
        • Dashboard
        • In-Yard
        • History
      • Tickets
        • Ticket Query
        • Delivery Query
        • Ticket Entry
        • Ticket Import
        • Ticket Bulk Edit
      • Quotes
        • Dashboard
        • Quotes
        • Projects
      • Orders
        • Orders
        • Status Update
        • Jobs & Phases
        • Haul Zones
      • Inventory
        • Inventory
        • Dashboard
      • Trucks
        • Assignment
        • Trucks
        • Haulers
        • Truck Bulk Edit
      • Dispatch
        • Requests
          • Dispatching Ticket Types
        • Drivers
        • Live Tracking
        • Tracking Query
        • Request Import
      • Billing/AR
        • Billing
        • Balance Dashboard
        • New Payment
        • Invoice / Payment Query
        • Payment Export
        • Customer Credit
      • Hauler Pay
        • Truck Adjustments
        • Statements
        • Setup
      • Reporting
        • Running Reports
          • Default Reports
        • Scheduled Reports
        • Analytics
        • Custom Reports
      • Resources
        • Customer
        • Products
        • Locations
        • Billing
          • Tax Codes
          • Pay Terms
          • Price Adjustments
          • Freight Matrix
          • Ship To
          • Invoice Adjustment Types
          • Customer Payment Information
          • Pay To User Assignment
        • Truck Types
        • Salespeople
        • Inspectors
      • Account and Administration
        • User Administration
        • Portal Settings
        • User Defined Fields
        • Devices
        • API Information
        • Import Format
        • Accounting Periods
        • Email Bounce Report
        • Related Accounts
      • Roles And Responsibilities
    • Ticketing App
      • Setup
      • Application
        • Ticketing
        • Trucks
        • Customers
        • Orders
        • Reports
        • History
        • Portal
        • Settings
    • New Ticketing App
      • Setup
        • Logging In and Device Setup
      • Application
        • Server Settings
          • Manage Devices
        • Lanes & Ticketing
        • Dashboard
        • Trucks
        • In-Yard
        • Customers
        • Orders
        • Requests
        • Payments
        • History
    • Mobile App
      • Setup
        • Mobile Ticketing App
        • Mobile Dispatching App
        • Mobile Printer Setup
      • Ticketing Mode
      • Haul Mode
      • POD Mode
      • Printing
        • Star Micronics
    • Management App
      • Setup
      • Application
    • API Documentation
    • GraphQL Documentation
      • Reporting with GraphQL
    • Accounting Interfaces
      • Quickbooks Online
      • Quickbooks Desktop
      • Spectrum
      • Vista Viewpoint
      • Sage
      • Net Suite
    • Integrations
      • Avalara
      • HaulHub
      • Fast-Weigh Ticket Integrator
    • Hardware
      • Scale House Check List
      • IP Cameras
      • Moxa NPort 5110
      • Web Switch
      • TagMaster CT45
      • External IP Addresses
      • Tegaur Kiosk
      • I&E Kiosk (Legacy)
      • Bluetooth Printers
    • Loader App
      • Setup
  • FAQs and Best Practices
    • Frequently Asked Questions
      • Can I integrate Fast-Weigh with my Accounting Software?
      • What is Fast-Weigh’s NTEP CC #?
      • Can I import ticket data via CSV?
      • Does the web portal adjust based on Time Zones?
      • Why does changing the pricing template not update my orders?
      • Can I connect cameras to the ticketing app?
      • Can I connect my scale to the ticketing app?
      • What are the required computer specs to run Fast-Weigh
      • How do I get a custom report created?
      • Why does cash ticket pricing not behave like charge tickets?
      • Why does my E-Ticket look different than my archived ticket?
      • Can I export any of my data?
      • How do I fix an unsynced record?
      • How do I reset my password?
      • Where can I submit a feature request?
      • Does every customer need an order?
      • Do Ticket Numbers have to be unique?
      • Can Fast-Weigh do inbound ticketing?
      • Why are my requested custom ticket changes not showing on my tickets?
    • Best Practices
      • Security and Administration
      • Order Management
      • Product Pricing
      • Tax Code Defaults
      • Setting up a New Device
Powered by GitBook
LogoLogo
On this page
  • config.json
  • tickets.sql
Export as PDF
  1. References
  2. Integrations

Fast-Weigh Ticket Integrator

Last updated 2 months ago

The Fast-Weigh Ticket Integrator uses 32-bit ODBC connections to query compatible databases and post tickets to the Fast-Weigh API. It syncs tickets every 3 minutes.

The API will create/update/void any of the tickets posted.

  1. Create config.json file in the same directory as the .exe and set the api_key and dsn vars

  2. Create tickets.sql file in the same directory as the .exe

  3. Set FastWeighTicketIntegrator.exe to run at startup. (Run shell:startup via Windows Run. Copy a shortcut to the .exe into the startup directory.)

  4. Done!

Your directory should look like:

- config.json
- FastWeighTicketIntegrator.exe
- tickets.sql

Once the exe runs you'll also have some logs / debug files:

- api_payload.json
- api_response.json

config.json

You can write your own ODBC connection string in the "dsn" option, or use a 32-bit system DSN by name (preferred).

{
	"api_endpoint_url": "https://fwticketapi.azurewebsites.net/ticket",
	"api_key": "your-api-key-goes-here",
	"api_auth_method": "bearer",
	"dsn": "dsn=..."
}

tickets.sql

It is a simple text file with only the sql statement in it.

Field names should be renamed to match the keys in the ticket payload.

Sub-fields like the Region fields, Customer fields, etc... should be formated with underscores. Doing so will allow the program to parse the fields and nest them to match the format expected by the API endpoint.

A shortened example from the Libra dataset:

SELECT
  TicketNum AS TicketNumber,
  Transactions_DateTimeTransaction AS TicketDateTime,
  Customers_Customer_ID AS Customer_CustomerID
FROM Transactions
WHERE Transactions_DateTimeTransaction >= Date()-3

The above results in the following payload object:

{
	"TicketNumber": 1234,
	"TicketDateTime": "2022-04-01 12:00:00",
	"Customer": {
		"CustomerID": "ABC"
	}
}

Note: In some cases, the nesting will go 2 or 3 levels deep. Truck_Hauler_HaulerID for example.

Here's a starter script for a Libra Access DB:

SELECT
  TicketNum AS TicketNumber
  ,FORMAT( DATEADD('h', 5, Transactions_DateTimeTransaction) , 'YYYY-MM-DDThh:mm:ss') AS TicketDateTime
  ,FORMAT( DATEADD('h', 5, Transactions_DateTimeTransaction) , 'YYYY-MM-DDThh:mm:ss') AS PrintDateTime
  ,-5 AS UTCOffset
  ,Weighmaster AS Operator
  ,Transactions_TonsGrossWeight AS GrossWeight
  ,Transactions_TonsTareWeight AS TareWeight
  ,Transactions_TonsNetWeight AS NetWeight
  ,Trucks_Truck_ID AS Truck_TruckID
  ,Mid([Trucks_Description],1,10) AS Truck_Hauler_HaulerID
  ,Trucks_Description AS Truck_Hauler_HaulerName
  ,'External' AS Truck_Hauler_HaulerType
  ,'EXEMPT' AS TaxCode_Code
  ,'DURACAP' AS Region_RegionName
  ,'ASBURY' AS Location_LocationName
  ,'ASBRY' AS Yard_YardName
  ,Customers_Customer_ID AS Customer_CustomerID
  ,Customers_Customer_Name AS Customer_CustomerName
  ,Jobs_Job_ID AS Order_ExternalOrderID
  ,Jobs_Job_Name AS Order_Description
  ,Jobs_PO_Number AS Order_PONumber
  ,'true' AS Order_UsePOD
  ,'U' AS OrderProduct_FreightType
  ,'U' AS OrderProduct_SurchargeType
  ,'EXEMPT' AS OrderProduct_TaxCode_Code
  ,Products_Product_ID AS OrderProduct_Product_ProductID
  ,Products_Product_Name AS OrderProduct_Product_ProductDescription
  ,'Ton' AS OrderProduct_Product_UnitOfMeasure
  ,VoidTkt AS Void
FROM Transactions
WHERE Transactions_DateTimeTransaction >= Date()-3

Development notes

  • 32-bit Python. Many of these old databases are only compatible with 32-bit applications/drivers.

  • pyodbc requires Microsoft C++ Build Tools. The easiest way to get this is via the Visual Studio Installer.

  • Create virtual env: py -m venv venv (make sure you activate the env as well)

  • Install requirements: pip install -r requirements.txt

  • Dev command: py main.py

  • Build command: py build.py

If you're using the endpoint url or , set the api_auth_method to "api-key".

If you're using the endpoint url , set the api_auth_method to "bearer".

The tickets.sql file should conform to the .

https://api.fast-weigh.com/v3/tickets
https://api.fast-weigh.com/v2/tickets
https://fwticketapi.azurewebsites.net/ticket
FW API ticket payload body
Download the exe from the latest release