Avalara Developer Network Developer blog

REST v2.16.12 Patch Notes

This article is about the December 2016 monthly update to the AvaTax REST v2 API.

UPDATED 2016-12-07 - The team added the definition of “Mixed” sourcing to the client library to address California sourcing scenarios prior to launch. Launch has been rescheduled for Tuesday, December 13th.

Environment URL Release Date
Sandbox https://sandbox-rest.avatax.com 2016-12-01
Production https://rest.avatax.com 2016-12-13

POST /api/v2/transactions/create

The sourcing field on TransactionLineModel had a mismatch between its documentation and its return value. In release 2.16.11, the field was documented as a string, but its value was being returned as an integer. Many libraries would still successfully parse this value although there was a discrepancy in the data formats. In release 2.16.12, this value is now being returned as a string, matching its documentation. If your application expected this value to be returned as an integer, you may need to update your code.

An example of the incorrect result and updated result is shown here:

Incorrect result from 2.16.11

{
  "lines": [
    {
      "sourcing": 42,
      "details": [
        {
          "sourcing": "Destination"
        }
      ]
    }
  ]
}

Corrected result from 2.16.12

{
  "lines": [
    {
      "sourcing": "Mixed",
      "details": [
        {
          "sourcing": "Destination"
        }
      ]
    }
  ]
}

New Point Of Sale Data API

Avalara now provides a data file API for customers with offline point-of-sale systems. This new API is available to calculate current tax rates for each physical location within the company, in CSV, JSON, and XML file formats.

More information on the Point-Of-Sale data API is available on the Developer Blog.

API Documentation Updates

The automatically generated API documentation for AvaTax has been updated with comments and explanations for each API call. These explanations can help guide you through unfamiliar APIs and explain how they are intended to be used.

GET /api/v2/definitions/countries

Many customers need to create a drop down user interface in their system that shows a selectable list of countries. AvaTax now provides a convenient, friendly, accessible JSON endpoint for retrieving data about countries in a format suitable for use in a dropdown box. For each country, this API lists its US English name and its two character ISO 3166 country code.

Sample results are below:

{
  "@recordsetCount": 253,
  "value": [
    {
      "code": "AD",
      "name": "ANDORRA"
    },
    ...
}

GET /api/v2/definitions/regions

Similar to the country definition API, AvaTax also provides a full list of all region codes, either accessible by country or as a single list.

Sample results are below:

{
  "@recordsetCount": 5120,
  "value": [
    {
      "countryCode": "AF",
      "code": "BAL",
      "name": "Balkh",
      "classification": "Province"
    },
    ...
}

Improved JSON formatting error messages

For users who are hand-authoring JSON documents to transmit to AvaTax, the 2.16.12 release will provide detailed error messages about which part of your JSON payload could not be parsed, plus an explanation of why it could not be recognized.

Bugfixes and Improvements

  • Custom error message when you create two users with a duplicate username
  • Transactions no longer throw an error if they only have addresses at the line level
  • Only one company location may be set as the default; setting another location to default will clear the default flag on all other locations
  • User can now fetch information about themself even if they have restricted permissions
  • The 'Transaction Commit' API call with an empty payload no longer changes status to Posted
  • API calls with empty payloads now show correct error messages
  • Password complexity enforced in password operations
  • Additional file operations security and logging
  • Additional integration tests for document types
  • Additional path traversal security protection

Happy Holidays!

–Ted Spence, Director, AvaTax Core Engine

Subscribe via RSS!

Back to posts