<?php
//查询发票信息
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$code = '033001800311';
$number = '61124608';
$date = '2019-06-15';
$extaxtotalfee = '2388.46';
$checkcode = '62057237940487749830';
$url = "https://api.jisuapi.com/invoiceverify/verify?appkey=$appkey&code=$code&number=$number&date=$date&extaxtotalfee=$extaxtotalfee&checkcode=$checkcode";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$invoiceverify = $jsonarr['result'];
echo $invoiceverify['number'].' '.$invoiceverify['code'].' '.$invoiceverify['seller'].' '.$invoiceverify['sellercreditno'].' '.$invoiceverify['sellerbank'].' '.$invoiceverify['selleraddress'].' '.$invoiceverify['buyer'].' '.$invoiceverify['buyercreditno'].' '.$invoiceverify['buyerbank'].' '.$invoiceverify['buyeraddress'].' '.$invoiceverify['totalfeecn'].' '.$invoiceverify['extaxtotalfee'].' '.$invoiceverify['date'].' '.$invoiceverify['totaltax'].' '.$invoiceverify['type'].' '.$invoiceverify['remark'].' '.$invoiceverify['district'].' '.$invoiceverify['type'].' '.$invoiceverify['machinecode'].' '.$invoiceverify['checkcode'].' '.$invoiceverify['state'].'
';
foreach($result['itemlist'] as $val)
{
echo $val['name'].' '.$val['type'].' '.$val['unit'].' '.$val['num'].' '.$val['price'].' '.$val['totalfee'].' '.$val['taxrate'].' '.$val['taxfee'].'
';
}