Tachain.Sdk 0.1.0

dotnet add package Tachain.Sdk --version 0.1.0
                    
NuGet\Install-Package Tachain.Sdk -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tachain.Sdk" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tachain.Sdk" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Tachain.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tachain.Sdk --version 0.1.0
                    
#r "nuget: Tachain.Sdk, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tachain.Sdk@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tachain.Sdk&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Tachain.Sdk&version=0.1.0
                    
Install as a Cake Tool

Tachain.Sdk - the C# library for the Tactic Chain Public API

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

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • SDK version: 0.1.0
  • Generator version: 7.25.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

<a id="frameworks-supported"></a>

Frameworks supported

<a id="dependencies"></a>

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

<a id="installation"></a>

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Tachain.Sdk.Api;
using Tachain.Sdk.Client;
using Tachain.Sdk.Model;

<a id="packaging"></a>

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Tachain.Sdk.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

<a id="usage"></a>

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Connections

Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method.

To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see here for details). To use your own HttpClient instance just pass it to the ApiClass constructor.

HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new YourApiClass(yourHttpClient, yourHandler);

If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory.

HttpClient yourHttpClient = new HttpClient();
var api = new YourApiClass(yourHttpClient);

You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available.

Here an example of DI setup in a sample web project:

services.AddHttpClient<YourApiClass>(httpClient =>
   new PetApi(httpClient));

<a id="getting-started"></a>

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Tachain.Sdk.Api;
using Tachain.Sdk.Client;
using Tachain.Sdk.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.example.com";
            // Configure API key authorization: ApiKey
            config.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("X-API-Key", "Bearer");
            // Configure API key authorization: Signature
            config.ApiKey.Add("X-Signature", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("X-Signature", "Bearer");
            // Configure Bearer token for authorization: BearerToken
            config.AccessToken = "YOUR_BEARER_TOKEN";
            // Configure API key authorization: Timestamp
            config.ApiKey.Add("X-Timestamp", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("X-Timestamp", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new ApiDeclarationApi(httpClient, config, httpClientHandler);
            var xCredentialType = "Token";  // string | Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
            var attachmentId = "attachmentId_example";  // string? | query 方式传入的单个附件申报 ID。 (optional) 
            var formDataId = "formDataId_example";  // string? | query 方式传入的单个表单申报 ID。 (optional) 
            var tacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest = new TacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest?(); // TacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest? |  (optional) 

            try
            {
                // 申报信息删除接口。
                Model4 result = apiInstance.DeleteV1DeclarationDelete(xCredentialType, attachmentId, formDataId, tacticChainApiServiceControllersApiIntegrationV1ApiDeclarationDeleteRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling ApiDeclarationApi.DeleteV1DeclarationDelete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

<a id="documentation-for-api-endpoints"></a>

Documentation for 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 申报文件/表单提交接口。
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 第三方-获取统一枚举列表(支持批量查询/查询所有)
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 PostV1OrderSubmitAudit POST /v1/order/SubmitAudit 销售方根据已入库的订单、生产、发货及申报资料提交审核。
ApiOrderWorkflowApi PutV1OrderConfirmReceipt PUT /v1/order/ConfirmReceipt 采购方按整单或单条订单明细确认收货。
ApiProductionApi DeleteV1ProductionDelete DELETE /v1/production/Delete 删除生产记录单。
ApiProductionApi GetV1ProductionListPaging GET /v1/production/ListPaging 查询生产记录单及详细领料信息。
ApiProductionApi PostV1ProductionCreate POST /v1/production/Create 创建生产记录单。
ApiProductionApi PutV1ProductionUpdate PUT /v1/production/Update 修改生产记录单。

<a id="documentation-for-models"></a>

Documentation for Models

<a id="documentation-for-authorization"></a>

Documentation for Authorization

Authentication schemes defined for the API: <a id="BearerToken"></a>

BearerToken

  • Type: Bearer Authentication

<a id="ApiKey"></a>

ApiKey

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

<a id="Timestamp"></a>

Timestamp

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

<a id="Signature"></a>

Signature

  • Type: API key
  • API key parameter name: X-Signature
  • Location: HTTP header
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 87 9/29/2026

Minor update