我正在使用zoho图书api。我正在使用下面的代码创建发票:
$url = "https://books.zoho.com/api/v3/invoices";
$headers = array(
"Authorization:" . $zoho_token,
"Content-Type: application/x-www-form-urlencoded",
);
$data = array(
"customer_id" => "my-customer-id",
"line_items" => array(
array(
"name" => "Test Product",
"rate" => 10,
"quantity" => 5,
"tax_percentage"=>5,
"item_total" => 52.5
),
),
"date" => date("Y-m-d"),
);
$jsonData = "&JSONString=" . urlencode(json_encode($data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
$urlData = json_decode(curl_exec($ch));
echo "<pre>";
print_r($urlData);发票已添加,但仍在我的zoho帐户上tax_percentage和item_total没有添加显示item_total automatically.so税没有添加在item_total中。
发布于 2017-08-30 00:24:35
提供tax_id,而不是添加tax_percentage。看起来不错
https://stackoverflow.com/questions/45893221
复制相似问题