Skip to content

Instantly share code, notes, and snippets.

@JDutil
Created August 18, 2013 21:33
Show Gist options
  • Save JDutil/6264116 to your computer and use it in GitHub Desktop.
Save JDutil/6264116 to your computer and use it in GitHub Desktop.
Tax Cloud API improperly drops leading 0's from zip codes.
- request:
method: post
uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
body:
encoding: UTF-8
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://taxcloud.net"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://taxcloud.net"><env:Body><ins0:Lookup><ins0:apiLoginID>130821A0</ins0:apiLoginID><ins0:apiKey>1F2C26B9-F8A4-4E8F-9225-559BB4AC05F3</ins0:apiKey><tns:uspsUserID
xsi:nil="true"/><ins0:customerID>R321826055</ins0:customerID><ins0:cartID>R321826055</ins0:cartID><ins0:cartItems><ins0:CartItem><tns:Index>1</tns:Index><tns:TIC>0</tns:TIC><tns:ItemID>ABC</tns:ItemID><tns:Price>19.99</tns:Price><tns:Qty>1</tns:Qty></ins0:CartItem><ins0:CartItem><tns:Index>2</tns:Index><tns:TIC>0</tns:TIC><tns:ItemID>SHIPPING</tns:ItemID><tns:Price>0.0</tns:Price><tns:Qty>1</tns:Qty></ins0:CartItem></ins0:cartItems><ins0:origin><ins0:Address1>1
Main Street</ins0:Address1><ins0:Address2 xsi:nil="true"/><ins0:City>Burlington</ins0:City><ins0:State>AL</ins0:State><ins0:Zip5>05401</ins0:Zip5></ins0:origin><ins0:destination><ins0:Address1>128
State St</ins0:Address1><ins0:Address2></ins0:Address2><ins0:City>Montpelier</ins0:City><ins0:State>AL</ins0:State><ins0:Zip5>05433</ins0:Zip5><ins0:Zip4
xsi:nil="true"/></ins0:destination></ins0:Lookup></env:Body></env:Envelope>
headers:
Soapaction:
- '"http://taxcloud.net/Lookup"'
Content-Type:
- text/xml;charset=UTF-8
Content-Length:
- '1307'
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- '*/*'
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Cache-Control:
- private, max-age=0
Content-Type:
- text/xml; charset=utf-8
Server:
- Microsoft-IIS/7.0
X-Aspnet-Version:
- 4.0.30319
X-Powered-By:
- TaxCloud
Date:
- Sun, 18 Aug 2013 20:29:24 GMT
Content-Length:
- '560'
body:
encoding: UTF-8
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><LookupResponse
xmlns="http://taxcloud.net"><LookupResult><ResponseType>Error</ResponseType><Messages><ResponseMessage><ResponseType>Error</ResponseType><Message>The
Ship To zip code (5433) is not valid for this state (AL)</Message></ResponseMessage></Messages><CartItemsResponse
/></LookupResult></LookupResponse></soap:Body></soap:Envelope>
http_version:
recorded_at: Sun, 18 Aug 2013 20:29:24 GMT
recorded_with: VCR 2.5.0
@paulonnen
Copy link

Good morning,

The missing leading 0 on the zip code is a cosmetic error. The issue with this Lookup request is that both the origin and destination zip codes (05401 and 05433) are located in the state of Vermont. However, the state referenced the Lookup call is AL (Alabama). The error message is correct.

This error would have been caught if the VerifyAddress API call were used.

Thanks for using TaxCloud!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment