Search by

ta-chain / tachain-sdk

ziyunhx

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

Package info

github.com/ta-chain/tachain-sdk-php

pkg:composer/ta-chain/tachain-sdk

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-10-16 07:15 UTC

This package is not auto-updated.

Last update: 2026-11-11 09:12:40 UTC


README

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

Source repository and local build

This package is distributed from its standalone source repository. Its generated code is also maintained in the SDK monorepo.

git clone https://github.com/ta-chain/tachain-sdk-php.git
cd tachain-sdk-php
composer install --no-interaction --prefer-dist

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

After version 0.1.1 is released on Packagist, install it with:

composer require ta-chain/tachain-sdk:0.1.1

Composer obtains the source from the standalone PHP repository.

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/TachainSdk/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: ApiKey
$config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

// Configure API key authorization: Signature
$config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKey('X-Signature', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Signature', 'Bearer');

// Configure Bearer authorization: BearerToken
$config = TachainSdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure API key authorization: Timestamp
$config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKey('X-Timestamp', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = TachainSdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Timestamp', 'Bearer');


$apiInstance = new TachainSdk\Api\ApiDeclarationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_credential_type = 'x_credential_type_example'; // string | 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'; // string | 查询返回的附件申报记录标识;也可在 Body 按单据和资料类型删除。
$form_data_id = 'form_data_id_example'; // string | 查询返回的表单记录标识;也可在 Body 按业务键删除。
$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}; // \TachainSdk\Model\TacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest

try {
    $result = $apiInstance->deleteV1DeclarationDelete($x_credential_type, $attachment_id, $form_data_id, $tactic_chain_api_service_controllers_api_integration_v1_api_declaration_delete_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApiDeclarationApi->deleteV1DeclarationDelete: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

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

Class Method HTTP request Description
ApiDeclarationApi deleteV1DeclarationDelete DELETE /v1/declaration/Delete 申报信息删除接口。
ApiDeclarationApi getV1DeclarationListPaging GET /v1/declaration/ListPaging 申报信息查询接口。
ApiDeclarationApi getV1DeclarationRequiredDocuments GET /v1/declaration/RequiredDocuments 单据所需申报信息查询接口。
ApiDeclarationApi postV1DeclarationSubmit POST /v1/declaration/Submit 申报文件/表单提交接口。
ApiDeclarationUploadApi postV1DeclarationUploadFile POST /v1/declaration/UploadFile 上传申报文件,返回 FileId;文件内容最多 30 MiB。
ApiDeliveryApi deleteV1DeliveryDelete DELETE /v1/delivery/Delete 删除发货单。
ApiDeliveryApi getV1DeliveryListPaging GET /v1/delivery/ListPaging 查询发货单信息及明细信息。
ApiDeliveryApi getV1DeliveryReceiptListPaging GET /v1/delivery/ReceiptListPaging 查询收货单集合,核对收货信息。
ApiDeliveryApi postV1DeliveryCreate POST /v1/delivery/Create 创建发货单。
ApiDeliveryApi putV1DeliveryConfirmReceipt PUT /v1/delivery/ConfirmReceipt 确认收货。
ApiDeliveryApi putV1DeliveryReturnReceipt PUT /v1/delivery/ReturnReceipt 收货退回。
ApiDeliveryApi putV1DeliveryUpdate PUT /v1/delivery/Update 修改发货单。
ApiEnumApi getV1EnumGetList GET /v1/enum/GetList 第三方-获取统一枚举列表(支持批量查询/查询所有)
ApiMaterialApi deleteV1MaterialDelete DELETE /v1/material/Delete 删除未被使用的资料;软删除,已被订单等业务使用时返回业务错误。
ApiMaterialApi getV1MaterialGet GET /v1/material/Get 按编码或 ID 精确查询。
ApiMaterialApi getV1MaterialListPaging GET /v1/material/ListPaging 分页查询;searchText 搜索编码或名称,scopeCode 按加工阶段筛选。
ApiMaterialApi postV1MaterialCreate POST /v1/material/Create 创建原料资料。
ApiMaterialApi putV1MaterialUpdate PUT /v1/material/Update 完整修改原料资料。
ApiOrderApi deleteV1OrderDelete DELETE /v1/order/Delete 第三方-更新订单状态(通过匹配条件获取订单ID)
ApiOrderApi deleteV1OrderDeleteLine DELETE /v1/order/DeleteLine 第三方-更新订单明细状态(通过匹配条件获取明细ID)
ApiOrderApi getV1OrderPOListPaging GET /v1/order/POListPaging 第三方-获取采购订单分页列表(含明细)
ApiOrderApi getV1OrderSOListPaging GET /v1/order/SOListPaging 第三方-获取销售订单分页列表(含明细)
ApiOrderApi postV1OrderCreate POST /v1/order/Create 第三方-创建订单(含明细)
ApiOrderApi postV1OrderSoAccept POST /v1/order/SoAccept 第三方-销售订单接单(支持绑定成品/自动创建成品)
ApiOrderApi putV1OrderUpdate PUT /v1/order/Update 第三方-更新订单(部分字段)
ApiOrderWorkflowApi getV1OrderReceiptPending GET /v1/order/ReceiptPending 采购订单确认收货待办项查询。
ApiOrderWorkflowApi postV1OrderDeclarationVerification POST /v1/order/DeclarationVerification 销售订单提交审核前一键校验。
ApiOrderWorkflowApi postV1OrderSubmitAudit POST /v1/order/SubmitAudit 销售方根据已入库的订单、生产、发货及申报资料提交审核。
ApiOrderWorkflowApi putV1OrderConfirmReceipt PUT /v1/order/ConfirmReceipt 采购方按整单或单条订单明细确认收货。
ApiProcessRouteApi deleteV1ProcessRouteDelete DELETE /v1/processRoute/Delete 软删除加工路线;历史单据保持其已有引用,新建业务不可再选择该路线。
ApiProcessRouteApi getV1ProcessRouteGet GET /v1/processRoute/Get 按路线编码或查询返回的 ID 精确查询,两者同时传入须一致。
ApiProcessRouteApi getV1ProcessRouteListPaging GET /v1/processRoute/ListPaging 分页查询正常路线;searchText 匹配编码或名称,scopeCode 筛选加工阶段。
ApiProcessRouteApi postV1ProcessRouteCreate POST /v1/processRoute/Create 创建加工路线及有序工序。
ApiProcessRouteApi putV1ProcessRouteUpdate PUT /v1/processRoute/Update 完整修改路线;steps 省略保留原工序,数组则替换全部工序,空数组清空。
ApiProductApi deleteV1ProductDelete DELETE /v1/product/Delete 删除未被使用的资料;软删除,已被订单等业务使用时返回业务错误。
ApiProductApi getV1ProductGet GET /v1/product/Get 按编码或 ID 精确查询。
ApiProductApi getV1ProductListPaging GET /v1/product/ListPaging 分页查询;searchText 搜索编码或名称,scopeCode 按加工阶段筛选。
ApiProductApi postV1ProductCreate POST /v1/product/Create 创建成品资料。
ApiProductApi putV1ProductUpdate PUT /v1/product/Update 完整修改成品资料。
ApiProductionApi deleteV1ProductionDelete DELETE /v1/production/Delete 删除生产记录单。
ApiProductionApi getV1ProductionListPaging GET /v1/production/ListPaging 查询生产记录单及详细领料信息。
ApiProductionApi postV1ProductionCreate POST /v1/production/Create 创建生产记录单。
ApiProductionApi putV1ProductionUpdate PUT /v1/production/Update 修改生产记录单。
ApiReferenceApi getV1ReferenceEnumValues GET /v1/reference/EnumValues 查询 enum_value;EnumTypeId 必填,Value 可选精确匹配。
ApiReferenceApi getV1ReferenceMappings GET /v1/reference/Mappings 查询 external_mapping;MappedTable 必填,ExternalValue 可选精确匹配。

Models

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

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP 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.PhpClientCodegen