taxjar / taxjar-php

Sales Tax API Client for PHP 5.5+
https://developers.taxjar.com/api/reference/?php
MIT License
68 stars 24 forks source link

TaxJar\Client->createOrder() throws "GuzzleHttp\Exception\ClientException" with "Client error: 406" #8

Closed thanhtr closed 8 years ago

thanhtr commented 9 years ago

Hi,

I get the error when creating Order, this is the example of my "json_encode" array that I pass in to createOrder():

{"transacion_id":"359","transaction_date":"2015\/10\/14","from_country":"US","from_zip":"75211","from_state":"TX","from_city":"Dallas","from_street":"4105 Rock Quarry Road, Suite 400","to_country":"US","to_zip":"36604","to_state":"Alabama","to_city":"Helsinki","to_street":"Suvilahdenkatu 9 C 65 ","amount":27.65,"shipping":5.99,"sales_tax":2.77,"line_items":[{"quantity":1,"product-identifier":50369578,"description":"Waste Pick-Up - Rainbow","unit_price":14.35},{"quantity":1,"product-identifier":50194451,"description":"Fashion Dispenser and Refill Bags","unit_price":13.3}]}

What can be the problem?

Thank you very much for your help.

-Tung

aleccarper commented 9 years ago

Hi thanhtr,

It looks like you may have misspelled 'transaction_id'. Could update that and try again?

thanhtr commented 9 years ago

Oh yeah I didn't notice that :). Anyway now I get the 'Client error: 400'. This is my new "json_encode" request, one of them:

{"transaction_id":"360","transaction_date":"2015\/10\/15","to_country":"US","to_zip":"36604","to_state":"Alabama","to_city":"Helsinki","to_street":"Suvilahdenkatu 9 C 65 ","amount":21.5,"shipping":5.99,"sales_tax":2.15,"line_items":[{"quantity":1,"product-identifier":50194580,"description":"Hot Spot Spray, 16 OZ","unit_price":21.5}]}

thanhtr commented 9 years ago

One more test that I provide also "fromxx" params, the request got through. Hmm I wonder why I need to provide from params when I already set up my Nexus states in Taxjar Dashboard?

fastdivision commented 9 years ago

@thanhtr We've been looking into this issue, should have an update shortly from our engineers. For now, please provide from params if you can do so. Thanks for being patient!

thanhtr commented 9 years ago

@fastdivision don't worry :).