阅读约 3 分钟第 8 / 15 篇
POST /api/vendor/invoice-verify 中转百度智能云 OCR 的「增值税发票验真」接口,根据发票要素校验发票真伪。
⚠️ 该接口为中转接口,不支持匿名请求,调用前需在请求头携带
Authorization: Bearer <API Key>。
POST https://wwcai.cn/api/vendor/invoice-verify
Content-Type: application/json
Authorization: Bearer <your_api_key>| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| invoice_num | string | 是 | 发票号码 |
| invoice_date | string | 是 | 开票日期,如 20240518 |
| invoice_type | string | 是 | 发票类型,如 special_vat_invoice / normal_invoice / elec_invoice_special 等 |
| total_amount | string | 是 | 价税合计(含税总额) |
| invoice_code | string | 条件 | 发票代码;电子发票、机动车销售等类型可省略 |
| check_code | string | 条件 | 校验码后 6 位;增值税专票、普通发票等部分类型必填 |
{
"words_result": {
"VerifyResult": "0001",
"InvoiceType": "增值税专用发票",
"InvoiceDate": "2024年05月18日",
"InvoiceNum": "244120000007865317"
},
"log_id": 1234567890
}| 字段 | 类型 | 说明 |
|---|---|---|
| words_result.VerifyResult | string | 验真结果:0001=一致,0000=不一致 |
| words_result.InvoiceType | string | 发票类型名称 |
| words_result.InvoiceDate | string | 开票日期 |
| words_result.InvoiceNum | string | 发票号码 |
| log_id | integer | 百度请求追踪 ID |
curl -X POST "https://wwcai.cn/api/vendor/invoice-verify" -H "Authorization: Bearer <your_api_key>" -H "Content-Type: application/json" -d '{"invoice_num":"244120000007865317","invoice_date":"20240518","invoice_type":"special_vat_invoice","total_amount":"307.52","invoice_code":"044001900211","check_code":"6593"}'import requests
resp = requests.post(
"https://wwcai.cn/api/vendor/invoice-verify",
headers={"Authorization": "Bearer <your_api_key>"},
json={
"invoice_num": "244120000007865317",
"invoice_date": "20240518",
"invoice_type": "special_vat_invoice",
"total_amount": "307.52",
"invoice_code": "044001900211",
"check_code"
const resp = await fetch("https://wwcai.cn/api/vendor/invoice-verify", {
method: "POST",
headers: { Authorization: "Bearer <your_api_key>", "Content-Type": "application/json" },
body: JSON.stringify({
invoice_num: "244120000007865317",
invoice_date: "20240518",
invoice_type: "special_vat_invoice",
total_amount: "307.52",
invoice_code: "044001900211",
| 状态码 | 说明 |
|---|---|
| 400 | 缺少必填字段(invoice_num/invoice_date/invoice_type/total_amount) |
| 401 | 未携带或无效的 API Key |
| 402 | 该端点额度不足(按次扣减额度) |
| 429 | 超过每日配额 |
登录后发表评论。
暂无评论。来发表第一条吧。