GETinvoice-check
請求書情報検証
請求書情報を入力して真贋を検証します
導入ドキュメント
請求書情報を入力して真贋を検証します
実装サンプルコード
Shell、Python、Go、Java、PHP の呼び出し例をまとめ、既存プロジェクトに組み込みやすくしています。
Shell 例
curl --request GET \
--url 'https://openapi.toolkk.com/v1/invoice-check' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "invoiceCode": "044001900111",\n "invoiceNo": "00012345",\n "invoiceDate": "2024-01-01",\n "invoiceAmt": "100.00",\n "verCode": "123456"\n}'Python 例
import os
import requests
url = "https://openapi.toolkk.com/v1/invoice-check"
payload = {
"invoiceCode": "044001900111",
"invoiceNo": "00012345",
"invoiceDate": "2024-01-01",
"invoiceAmt": "100.00",
"verCode": "123456"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.get(url, headers=headers, params=payload, timeout=30)
response.raise_for_status()
print(response.json())Go 例
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/invoice-check"
payload := []byte("{\n \"invoiceCode\": \"044001900111\",\n \"invoiceNo\": \"00012345\",\n \"invoiceDate\": \"2024-01-01\",\n \"invoiceAmt\": \"100.00\",\n \"verCode\": \"123456\"\n}")
req, err := http.NewRequest("GET", endpoint, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}Java 例
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ToolkkExample {
public static void main(String[] args) throws Exception {
String payload = "{\n \"invoiceCode\": \"044001900111\",\n \"invoiceNo\": \"00012345\",\n \"invoiceDate\": \"2024-01-01\",\n \"invoiceAmt\": \"100.00\",\n \"verCode\": \"123456\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/invoice-check"))
.method("GET", HttpRequest.BodyPublishers.ofString(payload))
.header("Content-Type", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP 例
<?php
$endpoint = 'https://openapi.toolkk.com/v1/invoice-check';
$payload = "{\n \"invoiceCode\": \"044001900111\",\n \"invoiceNo\": \"00012345\",\n \"invoiceDate\": \"2024-01-01\",\n \"invoiceAmt\": \"100.00\",\n \"verCode\": \"123456\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;リクエスト例
{
"invoiceCode": "044001900111",
"invoiceNo": "00012345",
"invoiceDate": "2024-01-01",
"invoiceAmt": "100.00",
"verCode": "123456"
}レスポンス例
{
"code": "SUCCESS",
"message": "success",
"data": {
"result": "验证通过",
"invoiceType": "增值税普通发票",
"seller": "阿里巴巴(中国)有限公司"
}
}リクエスト項目
以下の項目はサンプル JSON から自動抽出した参考情報です。
| パス | 型 | サンプル値 |
|---|---|---|
| invoiceCode | string | 044001900111 |
| invoiceNo | string | 00012345 |
| invoiceDate | string | 2024-01-01 |
| invoiceAmt | string | 100.00 |
| verCode | string | 123456 |
レスポンス項目
以下の項目はサンプル JSON から自動抽出した参考情報です。
| パス | 型 | サンプル値 |
|---|---|---|
| code | string | SUCCESS |
| message | string | success |
| data | object | {...} |
| data.result | string | 验证通过 |
| data.invoiceType | string | 增值税普通发票 |
| data.seller | string | 阿里巴巴(中国)有限公司 |