From 227c2f423ea8ac9bf570bab7c6d1b5a1fd2a766d Mon Sep 17 00:00:00 2001 From: Anya Stettler Date: Mon, 17 Mar 2014 19:12:39 -0700 Subject: [PATCH] Renamed Files --- tax-cancel.txt => CancelTaxTest.txt | 0 tax-get-GET.txt => EstimateTaxTest.txt | 0 tax-get-POST.txt => GetTaxTest.txt | 290 +++++++++--------- PingTest.txt | 0 README.md | 38 ++- ...ss-validate.txt => ValidateAddressTest.txt | 0 6 files changed, 182 insertions(+), 146 deletions(-) rename tax-cancel.txt => CancelTaxTest.txt (100%) rename tax-get-GET.txt => EstimateTaxTest.txt (100%) rename tax-get-POST.txt => GetTaxTest.txt (95%) create mode 100644 PingTest.txt rename address-validate.txt => ValidateAddressTest.txt (100%) diff --git a/tax-cancel.txt b/CancelTaxTest.txt similarity index 100% rename from tax-cancel.txt rename to CancelTaxTest.txt diff --git a/tax-get-GET.txt b/EstimateTaxTest.txt similarity index 100% rename from tax-get-GET.txt rename to EstimateTaxTest.txt diff --git a/tax-get-POST.txt b/GetTaxTest.txt similarity index 95% rename from tax-get-POST.txt rename to GetTaxTest.txt index 689bb0a..186f361 100644 --- a/tax-get-POST.txt +++ b/GetTaxTest.txt @@ -1,145 +1,145 @@ -curl -u : -H "Content-Type: text/json" -d '{ -"DocDate": "2013-06-01", -"CustomerCode": "uniqueCustomerId", -"CompanyCode": "SDK", -"DocType": "SalesInvoice", -"Commit": false, -"Client": "Cool ERP,3,5", -"DocCode": "someInvoiceNumber", -"DetailLevel": "Tax", -"CustomerUsageType": "G", -"ExemptionNo": "12334", -"Discount": 0, -"PurchaseOrderNo":"PO 23423", -"ReferenceCode":"", -"PosLaneCode":"", -"BusinessIdentificationNo":"", -"TaxOverride": -{ -"Reason":"Item Returned", -"TaxDate":"2013-05-05", -"TaxOverrideType":"TaxDate" -}, -"Addresses": -[ -{ -"AddressCode": "Origin", -"Line1": "118 N Clark St", -"City": "Chicago", -"Region": "IL", -"PostalCode": "60602-1304", -"Country": "US" -}, -{ -"AddressCode": "Dest", -"Line1": "1060 W. Addison St", -"City": "Chicago", -"Region": "IL", -"PostalCode": "60613-4566", -"Country": "US" -} -], -"Lines": -[ -{ -"LineNo": "00001", -"DestinationCode": "Dest", -"OriginCode": "Origin", -"ItemCode": "SP-001", -"Description": "Running Shoe", -"TaxCode": "PC030147", -"Qty": 1, -"Amount": 100 -} -] -}' "https://development.avalara.net/1.0/tax/get" - -Where is your AvaTax account number, and is your AvaTax account license key. - -Expected response: -{ -"ResultCode": "Success", -"DocCode": "someInvoiceNumber", -"DocDate": "2013-06-01", -"Timestamp": "2013-10-10T02:24:51.0304498Z", -"TotalAmount": "100", -"TotalDiscount": "0", -"TotalExemption": "100", -"TotalTaxable": "0", -"TotalTax": "0", -"TotalTaxCalculated": "0", -"TaxLines": [ -{ -"LineNo": "00001", -"TaxCode": "PC030147", -"Taxability": "true", -"BoundaryLevel": "Address", -"Exemption": "100", -"Discount": "0", -"Taxable": "0", -"Rate": "0.092500", -"Tax": "0", -"TaxCalculated": "0", -"TaxDetails": [ -{ -"Country": "US", -"Region": "IL", -"JurisType": "State", -"Taxable": "0", -"Rate": "0.062500", -"Tax": "0", -"JurisName": "ILLINOIS", -"TaxName": "IL STATE TAX"} -,{ -"Country": "US", -"Region": "IL", -"JurisType": "County", -"Taxable": "0", -"Rate": "0.007500", -"Tax": "0", -"JurisName": "COOK", -"TaxName": "IL COUNTY TAX"} -,{ -"Country": "US", -"Region": "IL", -"JurisType": "City", -"Taxable": "0", -"Rate": "0.012500", -"Tax": "0", -"JurisName": "CHICAGO", -"TaxName": "IL CITY TAX"} -,{ -"Country": "US", -"Region": "IL", -"JurisType": "Special", -"Taxable": "0", -"Rate": "0.010000", -"Tax": "0", -"JurisName": "REGIONAL TRANSPORT. AUTHORITY (RTA)", -"TaxName": "IL SPECIAL TAX"} -] -} -] -, -"TaxAddresses": [ -{ -"AddressCode": "Dest", -"Country": "US", -"Region": "IL", -"TaxRegionId": "2062953", -"JurisCode": "1703114000", -"Address": "1060 W ADDISON ST", -"City": "CHICAGO", -"PostalCode": "60613-4566"} -,{ -"AddressCode": "Origin", -"Country": "US", -"Region": "IL", -"TaxRegionId": "2062953", -"JurisCode": "1703114000", -"Address": "118 N CLARK ST", -"City": "CHICAGO", -"PostalCode": "60602-1304"} -] -, -"TaxDate": "2013-05-05"} +curl -u : -H "Content-Type: text/json" -d '{ +"DocDate": "2013-06-01", +"CustomerCode": "uniqueCustomerId", +"CompanyCode": "SDK", +"DocType": "SalesInvoice", +"Commit": false, +"Client": "Cool ERP,3,5", +"DocCode": "someInvoiceNumber", +"DetailLevel": "Tax", +"CustomerUsageType": "G", +"ExemptionNo": "12334", +"Discount": 0, +"PurchaseOrderNo":"PO 23423", +"ReferenceCode":"", +"PosLaneCode":"", +"BusinessIdentificationNo":"", +"TaxOverride": +{ +"Reason":"Item Returned", +"TaxDate":"2013-05-05", +"TaxOverrideType":"TaxDate" +}, +"Addresses": +[ +{ +"AddressCode": "Origin", +"Line1": "118 N Clark St", +"City": "Chicago", +"Region": "IL", +"PostalCode": "60602-1304", +"Country": "US" +}, +{ +"AddressCode": "Dest", +"Line1": "1060 W. Addison St", +"City": "Chicago", +"Region": "IL", +"PostalCode": "60613-4566", +"Country": "US" +} +], +"Lines": +[ +{ +"LineNo": "00001", +"DestinationCode": "Dest", +"OriginCode": "Origin", +"ItemCode": "SP-001", +"Description": "Running Shoe", +"TaxCode": "PC030147", +"Qty": 1, +"Amount": 100 +} +] +}' "https://development.avalara.net/1.0/tax/get" + +Where is your AvaTax account number, and is your AvaTax account license key. + +Expected response: +{ +"ResultCode": "Success", +"DocCode": "someInvoiceNumber", +"DocDate": "2013-06-01", +"Timestamp": "2013-10-10T02:24:51.0304498Z", +"TotalAmount": "100", +"TotalDiscount": "0", +"TotalExemption": "100", +"TotalTaxable": "0", +"TotalTax": "0", +"TotalTaxCalculated": "0", +"TaxLines": [ +{ +"LineNo": "00001", +"TaxCode": "PC030147", +"Taxability": "true", +"BoundaryLevel": "Address", +"Exemption": "100", +"Discount": "0", +"Taxable": "0", +"Rate": "0.092500", +"Tax": "0", +"TaxCalculated": "0", +"TaxDetails": [ +{ +"Country": "US", +"Region": "IL", +"JurisType": "State", +"Taxable": "0", +"Rate": "0.062500", +"Tax": "0", +"JurisName": "ILLINOIS", +"TaxName": "IL STATE TAX"} +,{ +"Country": "US", +"Region": "IL", +"JurisType": "County", +"Taxable": "0", +"Rate": "0.007500", +"Tax": "0", +"JurisName": "COOK", +"TaxName": "IL COUNTY TAX"} +,{ +"Country": "US", +"Region": "IL", +"JurisType": "City", +"Taxable": "0", +"Rate": "0.012500", +"Tax": "0", +"JurisName": "CHICAGO", +"TaxName": "IL CITY TAX"} +,{ +"Country": "US", +"Region": "IL", +"JurisType": "Special", +"Taxable": "0", +"Rate": "0.010000", +"Tax": "0", +"JurisName": "REGIONAL TRANSPORT. AUTHORITY (RTA)", +"TaxName": "IL SPECIAL TAX"} +] +} +] +, +"TaxAddresses": [ +{ +"AddressCode": "Dest", +"Country": "US", +"Region": "IL", +"TaxRegionId": "2062953", +"JurisCode": "1703114000", +"Address": "1060 W ADDISON ST", +"City": "CHICAGO", +"PostalCode": "60613-4566"} +,{ +"AddressCode": "Origin", +"Country": "US", +"Region": "IL", +"TaxRegionId": "2062953", +"JurisCode": "1703114000", +"Address": "118 N CLARK ST", +"City": "CHICAGO", +"PostalCode": "60602-1304"} +] +, +"TaxDate": "2013-05-05"} diff --git a/PingTest.txt b/PingTest.txt new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 613ca3c..b03129b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,40 @@ -AvaTax-Calc-REST-cURL +AvaTax-REST-cURL +===================== + +This is a set of cURL sample requests and expected responses demonstrating the [AvaTax REST API](http://developer.avalara.com/api-docs/rest) methods: + [tax/get POST](http://developer.avalara.com/api-docs/rest/tax/post/), [tax/get GET](http://developer.avalara.com/api-docs/rest/tax/get), [tax/cancel POST](http://developer.avalara.com/api-docs/rest/tax/cancel), and [address/validate GET](http://developer.avalara.com/api-docs/rest/address-validation). + + For more information on the use of these methods and the AvaTax product, please visit our [developer site](http://developer.avalara.com/) or [homepage](http://www.avalara.com/) + +Contents: +---------- + + + + + + + + + + + + + +
Sample Files
CancelTaxTest.txtDemonstrates the CancelTax method used to void a document.
EstimateTaxTest.txtDemonstrates the EstimateTax method used for product- and line- indifferent tax estimates.
GetTaxTest.txtDemonstrates the GetTax method used for product- and line- specific calculation.
PingTest.txtUses a hardcoded EstimateTax call to test connectivity and credential information.
ValidateAddressTest.txtDemonstrates the ValidateAddress method to normalize an address.
Other Files
.gitattributes-
.gitignore-
LICENSE.md-
README.md-
+ +Dependencies: +----------- +- Ruby 1.9.2 or later + +Requirements: +---------- +- Make sure to install any required gems by navigating to the root directory in the command line and running "bundle install". +- Authentication requires an valid **Account Number** and **License Key**, which should be entered in the test file (e.g. GetTaxTest.rb) you would like to run. +- If you do not have an AvaTax account, a free trial account can be acquired through our [developer site](http://developer.avalara.com/api-get-started) + + +AvaTax-REST-cURL ===================== Set of cURL sample requests and expected responses for the AvaTax tax calcluation REST API diff --git a/address-validate.txt b/ValidateAddressTest.txt similarity index 100% rename from address-validate.txt rename to ValidateAddressTest.txt