jsp-open-api-signature/examples/multi_column.py
Simple.C.Han 13c7f62870 init
2026-06-17 10:23:52 +08:00

50 lines
1000 B
Python

from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from openx_sdk import OpenXClient
# 正式使用时建议从环境变量或配置文件读取,不要硬编码在业务代码中。
ACCESS_KEY = ""
SECRET_KEY = ""
BASE_URL = "https://open.jsptax.com"
PATH = "/invoice/output/list"
QUERY = {
"comId": "100342309",
"period": "202604",
"invoiceType": [
"1"
],
"pageNum": "1",
"pageSize": "10",
"taxRate":1,
"autoLabel": [
"0"
]
}
BODY = {
"comId": 101379804,
"period": "202605",
"taxRate": 1,
"invoiceType": [
],
"pageNum":1,
"pageSize":10
}
def call_api() -> None:
client = OpenXClient(BASE_URL, ACCESS_KEY, SECRET_KEY)
# response = client.get(PATH, params=QUERY)
response = client.post(PATH, json_body=BODY)
print("status:", response.status_code)
print(response.text)
if __name__ == "__main__":
call_api()