Avalara Developer Network Developer trustFile

TrustFile API

API for posting sales / refunds / freight into TrustFile

Testing:

  • Test this endpoint @ https://stable-api.trustfile.avalara.com:443
  • To test this endpoint, you'll need the connectorToTFToken
  • Contact apis@trustfile.com to signup as an integrator and schedule certification

Tokens:

  • connectorToTFToken: identifies the connector and restricts access to environments / version of TrustFile API the connector is certified for
  • connectionId: identifies and authorizes access to the TF connection to push data into

Security:

Authorization is done through header param

Authorization: Bearer connectorToTFToken

Post Items

  • Creates new items or updates them if they already exist
  • Send sale items or refund items (the refund boolean of the item determines this)
  • If refund is true, Taxes and Amounts are automatically made negative by TrustFile (negative amounts/taxes will remain negative)
  • Addresses are used to source the jurisdictions involved in the sale
  • Defaults are used for shipFromAddress if none provided or the address is invalid. The default shipFromAddress can be retrieved with the GET /connections/{connectionID} route
  • In some cases, review by the user may be required (e.g. if the service does not provide taxes or shipping data for refunds). When this occurs, reviewRequired should be set to true and reviewMessage should be a string with the reason for the review.
  • Refunds should be pushed to TrustFile regardless of whether an original sale item exists
  • Maximum of 1000 items may be posted at one time
Api Endpoint
POST https://api.trustfile.avalara.com/v3/connections/{connectionId}/items

Path Parameters

connectionId
Required

ID of the connection to post the items to

string

Post Body Parameters

Array[Items]
itemId
Required
string
transactionDate
Required
string
ShipFromAddress
line1
string
city
string
state
string
zip
string
ShipToAddress
line1
string
city
string
state
Required
string
zip
Required
string
shippingAmount
Required

Shipping cost (not including taxes)

number
shippingTax
Required
number
salesAmount
Required

Item cost (not including shipping or taxes)

number
salesTax
Required
number
description
string
refund
Required
boolean
reviewRequired

Determines whether the user needs to review this item. This would be done when there are questions regarding whether the assumptions made by the connector result in the correct sales/refund/tax. Submitting this item as 'true' will make TrustFile flag the item to show to the user for approval.

boolean
reviewMessage

Message to show the user as to what they should review

string

Response

processed

Number of items processed

integer
dateTime
string

Retrieve Items by ItemId

Get items of the provided itemId for the given connection. Will include both the item and the refund, if it exists

Api Endpoint
GET https://api.trustfile.avalara.com/v3/connections/{connectionId}/items/{itemId}

Path Parameters

connectionId
Required

connectionId the item belongs to

string
itemId
Required

itemId of the item to retrieve

string

Response

Array[Items]
itemId
Required
string
transactionDate
Required
string
ShipFromAddress
line1
string
city
string
state
string
zip
string
ShipToAddress
line1
string
city
string
state
Required
string
zip
Required
string
shippingAmount
Required

Shipping cost (not including taxes)

number
shippingTax
Required
number
salesAmount
Required

Item cost (not including shipping or taxes)

number
salesTax
Required
number
description
string
refund
Required
boolean
reviewRequired

Determines whether the user needs to review this item. This would be done when there are questions regarding whether the assumptions made by the connector result in the correct sales/refund/tax. Submitting this item as 'true' will make TrustFile flag the item to show to the user for approval.

boolean
reviewMessage

Message to show the user as to what they should review

string

Retrieve ConnectionId Information

Queries for the company information TrustFile has stored

Api Endpoint
GET https://api.trustfile.avalara.com/v3/connections/{connectionId}

Path Parameters

connectionId
Required

connectionId that you wish to retrieve company information for

string

Response

Company
name
string
syncDate
string
phone
string
fax
string
createdAt
string
updatedAt
string
Address
line1
string
line2
string
line3
string
city
string
state
string
zip
string