Skip to main content

tachain-sdk

Public integration endpoints. Set your own base URL and credential before calling.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 0.1.1
  • Generator version: 7.25.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Source repository and local build

This SDK is in the generated/python directory of the open-source SDK repository.

git clone https://github.com/ta-chain/tachain-sdk.git
cd tachain-sdk/generated/python
python3 -m pip install .

Requirements.

Python 3.10+

Installation & Usage

pip install

After this version is published on PyPI, install it with:

python3 -m pip install tachain-sdk==0.1.1

For a source build, use the checkout steps above.

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import tachain_sdk

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import tachain_sdk
from tachain_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.example.com
# See configuration.py for a list of all supported configuration parameters.
configuration = tachain_sdk.Configuration(
    host = "https://api.example.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Configure API key authorization: Signature
configuration.api_key['Signature'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Signature'] = 'Bearer'

# Configure Bearer authorization: BearerToken
configuration = tachain_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Configure API key authorization: Timestamp
configuration.api_key['Timestamp'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Timestamp'] = 'Bearer'


# Enter a context with an instance of the API client
with tachain_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = tachain_sdk.ApiDeclarationApi(api_client)
    x_credential_type = 'x_credential_type_example' # str | Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
    attachment_id = 'attachment_id_example' # str | 查询返回的附件申报记录标识;也可在 Body 按单据和资料类型删除。 (optional)
    form_data_id = 'form_data_id_example' # str | 查询返回的表单记录标识;也可在 Body 按业务键删除。 (optional)
    tactic_chain_api_service_controllers_api_integration_v1_api_declaration_delete_request = {"stageId":"Order","orderSide":"SO","supplierExtNo":"ERP-SO-001-10","customerName":"客户名称","documentTypeCode":"INVOICE","deleteAttachments":true,"deleteForms":false} # TacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest |  (optional)

    try:
        # 申报信息删除接口。
        api_response = api_instance.delete_v1_declaration_delete(x_credential_type, attachment_id=attachment_id, form_data_id=form_data_id, tactic_chain_api_service_controllers_api_integration_v1_api_declaration_delete_request=tactic_chain_api_service_controllers_api_integration_v1_api_declaration_delete_request)
        print("The response of ApiDeclarationApi->delete_v1_declaration_delete:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ApiDeclarationApi->delete_v1_declaration_delete: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.example.com

Class Method HTTP request Description
ApiDeclarationApi delete_v1_declaration_delete DELETE /v1/declaration/Delete 申报信息删除接口。
ApiDeclarationApi get_v1_declaration_list_paging GET /v1/declaration/ListPaging 申报信息查询接口。
ApiDeclarationApi get_v1_declaration_required_documents GET /v1/declaration/RequiredDocuments 单据所需申报信息查询接口。
ApiDeclarationApi post_v1_declaration_submit POST /v1/declaration/Submit 申报文件/表单提交接口。
ApiDeclarationUploadApi post_v1_declaration_upload_file POST /v1/declaration/UploadFile 上传申报文件,返回 FileId;文件内容最多 30 MiB。
ApiDeliveryApi delete_v1_delivery_delete DELETE /v1/delivery/Delete 删除发货单。
ApiDeliveryApi get_v1_delivery_list_paging GET /v1/delivery/ListPaging 查询发货单信息及明细信息。
ApiDeliveryApi get_v1_delivery_receipt_list_paging GET /v1/delivery/ReceiptListPaging 查询收货单集合,核对收货信息。
ApiDeliveryApi post_v1_delivery_create POST /v1/delivery/Create 创建发货单。
ApiDeliveryApi put_v1_delivery_confirm_receipt PUT /v1/delivery/ConfirmReceipt 确认收货。
ApiDeliveryApi put_v1_delivery_return_receipt PUT /v1/delivery/ReturnReceipt 收货退回。
ApiDeliveryApi put_v1_delivery_update PUT /v1/delivery/Update 修改发货单。
ApiEnumApi get_v1_enum_get_list GET /v1/enum/GetList 第三方-获取统一枚举列表(支持批量查询/查询所有)
ApiMaterialApi delete_v1_material_delete DELETE /v1/material/Delete 删除未被使用的资料;软删除,已被订单等业务使用时返回业务错误。
ApiMaterialApi get_v1_material_get GET /v1/material/Get 按编码或 ID 精确查询。
ApiMaterialApi get_v1_material_list_paging GET /v1/material/ListPaging 分页查询;searchText 搜索编码或名称,scopeCode 按加工阶段筛选。
ApiMaterialApi post_v1_material_create POST /v1/material/Create 创建原料资料。
ApiMaterialApi put_v1_material_update PUT /v1/material/Update 完整修改原料资料。
ApiOrderApi delete_v1_order_delete DELETE /v1/order/Delete 第三方-更新订单状态(通过匹配条件获取订单ID)
ApiOrderApi delete_v1_order_delete_line DELETE /v1/order/DeleteLine 第三方-更新订单明细状态(通过匹配条件获取明细ID)
ApiOrderApi get_v1_order_po_list_paging GET /v1/order/POListPaging 第三方-获取采购订单分页列表(含明细)
ApiOrderApi get_v1_order_so_list_paging GET /v1/order/SOListPaging 第三方-获取销售订单分页列表(含明细)
ApiOrderApi post_v1_order_create POST /v1/order/Create 第三方-创建订单(含明细)
ApiOrderApi post_v1_order_so_accept POST /v1/order/SoAccept 第三方-销售订单接单(支持绑定成品/自动创建成品)
ApiOrderApi put_v1_order_update PUT /v1/order/Update 第三方-更新订单(部分字段)
ApiOrderWorkflowApi get_v1_order_receipt_pending GET /v1/order/ReceiptPending 采购订单确认收货待办项查询。
ApiOrderWorkflowApi post_v1_order_declaration_verification POST /v1/order/DeclarationVerification 销售订单提交审核前一键校验。
ApiOrderWorkflowApi post_v1_order_submit_audit POST /v1/order/SubmitAudit 销售方根据已入库的订单、生产、发货及申报资料提交审核。
ApiOrderWorkflowApi put_v1_order_confirm_receipt PUT /v1/order/ConfirmReceipt 采购方按整单或单条订单明细确认收货。
ApiProcessRouteApi delete_v1_process_route_delete DELETE /v1/processRoute/Delete 软删除加工路线;历史单据保持其已有引用,新建业务不可再选择该路线。
ApiProcessRouteApi get_v1_process_route_get GET /v1/processRoute/Get 按路线编码或查询返回的 ID 精确查询,两者同时传入须一致。
ApiProcessRouteApi get_v1_process_route_list_paging GET /v1/processRoute/ListPaging 分页查询正常路线;searchText 匹配编码或名称,scopeCode 筛选加工阶段。
ApiProcessRouteApi post_v1_process_route_create POST /v1/processRoute/Create 创建加工路线及有序工序。
ApiProcessRouteApi put_v1_process_route_update PUT /v1/processRoute/Update 完整修改路线;steps 省略保留原工序,数组则替换全部工序,空数组清空。
ApiProductApi delete_v1_product_delete DELETE /v1/product/Delete 删除未被使用的资料;软删除,已被订单等业务使用时返回业务错误。
ApiProductApi get_v1_product_get GET /v1/product/Get 按编码或 ID 精确查询。
ApiProductApi get_v1_product_list_paging GET /v1/product/ListPaging 分页查询;searchText 搜索编码或名称,scopeCode 按加工阶段筛选。
ApiProductApi post_v1_product_create POST /v1/product/Create 创建成品资料。
ApiProductApi put_v1_product_update PUT /v1/product/Update 完整修改成品资料。
ApiProductionApi delete_v1_production_delete DELETE /v1/production/Delete 删除生产记录单。
ApiProductionApi get_v1_production_list_paging GET /v1/production/ListPaging 查询生产记录单及详细领料信息。
ApiProductionApi post_v1_production_create POST /v1/production/Create 创建生产记录单。
ApiProductionApi put_v1_production_update PUT /v1/production/Update 修改生产记录单。
ApiReferenceApi get_v1_reference_enum_values GET /v1/reference/EnumValues 查询 enum_value;EnumTypeId 必填,Value 可选精确匹配。
ApiReferenceApi get_v1_reference_mappings GET /v1/reference/Mappings 查询 external_mapping;MappedTable 必填,ExternalValue 可选精确匹配。

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerToken

  • Type: Bearer authentication

ApiKey

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Timestamp

  • Type: API key
  • API key parameter name: X-Timestamp
  • Location: HTTP header

Signature

  • Type: API key
  • API key parameter name: X-Signature
  • Location: HTTP header

Author

Metadata

Release files for tachain-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tachain-sdk 0.1.1
File Size Uploaded Provenance
tachain_sdk-0.1.1.tar.gz 172.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tachain-sdk 0.1.1
File Interpreter ABI Platform
tachain_sdk-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 567.3 kB

Release files / tachain_sdk-0.1.1.tar.gz

Download URL tachain_sdk-0.1.1.tar.gz
Size 172.0 kB
Tags Source
SHA-256 checksum
How to use checksums
32ca5a8bbd74c51366abeae5050a7c4c8273ab4d1c6aa2a8bcca5b63db63a85e
BLAKE2b-256 checksum
How to use checksums
d564f53decb8d4fe33480dbbe9bbacaa20a295bc9e3f80e2ab030ae46e21fde0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / tachain_sdk-0.1.1-py3-none-any.whl

Download URL tachain_sdk-0.1.1-py3-none-any.whl
Size 395.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f03e8e0b800ce518ccf77ca94474472e3ee2a18466d34d1e27e0fb7e77886575
BLAKE2b-256 checksum
How to use checksums
3fef2f0f2cce09b9a48dd8184b809934dedcb8d60199c483eb23171344f8c9c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for tachain-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tachain_sdk-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page