Module: AvaTax::Client::Utilities

Included in:
AvaTax::Client
Defined in:
lib/avatax/client/utilities.rb

Instance Method Summary collapse

Instance Method Details

#get_my_subscription(serviceTypeId) ⇒ Object

Checks if the current user is subscribed to a specific service

Returns a subscription object for the current account, or 404 Not Found if this subscription is not enabled for this account.

This API will return an error if it is called with invalid authentication credentials.

This API is intended to help you determine whether you have the necessary subscription to use certain API calls within AvaTax. You can examine the subscriptions returned from this API call to look for a particular product or subscription to provide useful information to the current user as to whether they are entitled to use specific features of AvaTax. Swagger Name: AvaTaxClient

Parameters:

  • serviceTypeId (String)

    The service to check

Returns:

  • (Object)


19
20
# File 'lib/avatax/client/utilities.rb', line 19

def get_my_subscription(serviceTypeId)        path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
get(path, {}, AvaTax::VERSION)      end

#list_my_subscriptionsFetchResult

List all services to which the current user is subscribed

Returns the list of all subscriptions enabled for the currently logged in user.

This API will return an error if it is called with invalid authentication credentials.

This API is intended to help you determine whether you have the necessary subscription to use certain API calls within AvaTax. You can examine the subscriptions returned from this API call to look for a particular product or subscription to provide useful information to the current user as to whether they are entitled to use specific features of AvaTax. Swagger Name: AvaTaxClient

Returns:

  • (FetchResult)


34
35
# File 'lib/avatax/client/utilities.rb', line 34

def list_my_subscriptions()        path = "/api/v2/utilities/subscriptions"
get(path, {}, AvaTax::VERSION)      end

#pingObject

Tests connectivity and version of the service

Check connectivity to AvaTax and return information about the AvaTax API server.

This API is intended to help you verify that your connection is working. This API will always succeed and will never return a error. It provides basic information about the server you connect to:

  • version - The version number of the AvaTax API server that responded to your request. The AvaTax API version number is updated once per month during Avalara's update process.
  • authenticated - A boolean flag indicating whether or not you sent valid credentials with your API request.
  • authenticationType - If you provided valid credentials to the API, this field will tell you whether you used Bearer, Username, or LicenseKey authentication.
  • authenticatedUserName - If you provided valid credentials to the API, this field will tell you the username of the currently logged in user.
  • authenticatedUserId - If you provided valid credentials to the API, this field will tell you the user ID of the currently logged in user.
  • authenticatedAccountId - If you provided valid credentials to the API, this field will contain the account ID of the currently logged in user.

This API helps diagnose connectivity problems between your application and AvaTax; you may call this API even if you do not have verified connection credentials. If this API fails, either your computer is not connected to the internet, or there is a routing problem between your office and Avalara, or the Avalara server is not available. For more information on the uptime of AvaTax, please see Avalara's AvaTax Status Page.

Security Policies

  • This API may be called without providing authentication credentials. Swagger Name: AvaTaxClient

Returns:

  • (Object)


61
62
# File 'lib/avatax/client/utilities.rb', line 61

def ping()        path = "/api/v2/utilities/ping"
get(path, {}, AvaTax::VERSION)      end