<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
$taxjar = TaxJar\Client::withApiKey('YOUR API TOKEN'); | |
$order_taxes = $taxjar->taxForOrder([ | |
'from_country' => 'US', | |
'from_zip' => '07001', | |
'from_state' => 'NJ', | |
'to_country' => 'US', | |
'to_zip' => '07446', | |
'to_state' => 'NJ', | |
'amount' => 16.50, | |
'shipping' => 1.5, | |
'line_items' => [ | |
[ | |
'quantity' => 1, | |
'unit_price' => 15.0, | |
'product_tax_code' => 31000 | |
] | |
] | |
]); | |
echo $order_taxes->amount_to_collect; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment