kintsugi-tax/tax-platform-sdk
Composer 安装命令:
composer require kintsugi-tax/tax-platform-sdk
包简介
README 文档
README
Developer-friendly & type-safe Php SDK specifically catered to leverage kintsugi-tax/tax-platform-sdk API.
Summary
Table of Contents
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json file:
composer require "kintsugi-tax/tax-platform-sdk"
SDK Example Usage
Example
declare(strict_types=1); require 'vendor/autoload.php'; use KintsugiTax\SDK; use KintsugiTax\SDK\Models\Components; use KintsugiTax\SDK\Models\Operations; $sdk = SDK\SDK::builder()->build(); $request = new Components\AddressBase( phone: '555-123-4567', street1: '1600 Amphitheatre Parkway', street2: 'Building 40', city: 'Mountain View', county: 'Santa Clara', state: 'CA', postalCode: '94043', country: Components\CountryCodeEnum::Us, fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043', ); $requestSecurity = new Operations\SearchV1AddressValidationSearchPostSecurity( apiKeyHeader: '<YOUR_API_KEY_HERE>', ); $response = $sdk->addressValidation->search( request: $request, security: $requestSecurity ); if ($response->response200SearchV1AddressValidationSearchPost !== null) { // handle response }
Authentication
Per-Client Security Schemes
This SDK supports the following security schemes globally:
| Name | Type | Scheme |
|---|---|---|
apiKeyHeader |
apiKey | API key |
customHeader |
apiKey | API key |
You can set the security parameters through the setSecurity function on the SDKBuilder when initializing the SDK. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use KintsugiTax\SDK; use KintsugiTax\SDK\Models\Components; $sdk = SDK\SDK::builder() ->setSecurity( new Components\Security( apiKeyHeader: '<YOUR_API_KEY_HERE>', customHeader: '<YOUR_API_KEY_HERE>', ) ) ->build(); $request = new Components\ValidationAddress( line1: '1600 Amphitheatre Parkway', line2: '', line3: '', city: 'Mountain View', state: 'CA', postalCode: '94043', id: 215, county: '', fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043', ); $response = $sdk->addressValidation->suggestions( request: $request ); if ($response->any !== null) { // handle response }
Per-Operation Security Schemes
Some operations in this SDK require the security scheme to be specified at the request level. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use KintsugiTax\SDK; use KintsugiTax\SDK\Models\Components; use KintsugiTax\SDK\Models\Operations; $sdk = SDK\SDK::builder()->build(); $request = new Components\AddressBase( phone: '555-123-4567', street1: '1600 Amphitheatre Parkway', street2: 'Building 40', city: 'Mountain View', county: 'Santa Clara', state: 'CA', postalCode: '94043', country: Components\CountryCodeEnum::Us, fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043', ); $requestSecurity = new Operations\SearchV1AddressValidationSearchPostSecurity( apiKeyHeader: '<YOUR_API_KEY_HERE>', ); $response = $sdk->addressValidation->search( request: $request, security: $requestSecurity ); if ($response->response200SearchV1AddressValidationSearchPost !== null) { // handle response }
Available Resources and Operations
Available methods
AddressValidation
- search - Search
- suggestions - Suggestions
Customers
- list - Get Customers
- create - Create Customer
- getById - Get Customer By Id
- update - Update Customer
- getByExternalId - Get Customer By External Id
- getTransactions - Get Transactions By Customer Id
- createTransaction - Create Transaction By Customer Id
Exemptions
- list - Get Exemptions
- create - Create Exemption
- getById - Get Exemption By Id
- uploadCertificate - Upload Exemption Certificate
Exemptions.Attachments
- get - Get Attachments For Exemption
Filings
- get - Get Filings
- getById - Get Filing By Id
- getByRegistrationId - Get Filings By Registration Id
Nexus
- listPhysical - Get Physical Nexus
- createPhysical - Create Physical Nexus
- updatePhysical - Update Physical Nexus
- delete - Delete Physical Nexus
- list - Get Nexus For Org
Products
- getProductsV1ProductsGet - Get Products
- createProductV1ProductsPost - Create Product
- getProductCategoriesV1ProductsCategoriesGet - Get Product Categories
- get - Get Product By Id
- update - Update Product
Registrations
- list - Get Registrations
- create - Create Registration
- getById - Get Registration By Id
- update - Update Registration
- deregister - Deregister Registration
TaxEstimation
- estimate - Estimate Tax
Transactions
- list - Get Transactions
- create - Create Transaction
- getByExternalId - Get Transaction By External Id
- update - Update Transaction
- get - Get Transaction By Id
- getByFilingId - Get Transactions By Filing Id
- createCreditNote - Create Credit Note By Transaction Id
- updateCreditNote - Update Credit Note By Transaction Id
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\APIException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the search method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ErrorResponse | 401 | application/json |
| Errors\BackendSrcAddressValidationResponsesValidationErrorResponse | 422 | application/json |
| Errors\ErrorResponse | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Example
declare(strict_types=1); require 'vendor/autoload.php'; use KintsugiTax\SDK; use KintsugiTax\SDK\Models\Components; use KintsugiTax\SDK\Models\Errors; use KintsugiTax\SDK\Models\Operations; $sdk = SDK\SDK::builder()->build(); try { $request = new Components\AddressBase( phone: '555-123-4567', street1: '1600 Amphitheatre Parkway', street2: 'Building 40', city: 'Mountain View', county: 'Santa Clara', state: 'CA', postalCode: '94043', country: Components\CountryCodeEnum::Us, fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043', ); $requestSecurity = new Operations\SearchV1AddressValidationSearchPostSecurity( apiKeyHeader: '<YOUR_API_KEY_HERE>', ); $response = $sdk->addressValidation->search( request: $request, security: $requestSecurity ); if ($response->response200SearchV1AddressValidationSearchPost !== null) { // handle response } } catch (Errors\ErrorResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\BackendSrcAddressValidationResponsesValidationErrorResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\ErrorResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\APIException $e) { // handle default exception throw $e; }
Server Selection
Override Server URL Per-Client
The default server can be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use KintsugiTax\SDK; use KintsugiTax\SDK\Models\Components; use KintsugiTax\SDK\Models\Operations; $sdk = SDK\SDK::builder() ->setServerURL('https://api.trykintsugi.com') ->build(); $request = new Components\AddressBase( phone: '555-123-4567', street1: '1600 Amphitheatre Parkway', street2: 'Building 40', city: 'Mountain View', county: 'Santa Clara', state: 'CA', postalCode: '94043', country: Components\CountryCodeEnum::Us, fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043', ); $requestSecurity = new Operations\SearchV1AddressValidationSearchPostSecurity( apiKeyHeader: '<YOUR_API_KEY_HERE>', ); $response = $sdk->addressValidation->search( request: $request, security: $requestSecurity ); if ($response->response200SearchV1AddressValidationSearchPost !== null) { // handle response }
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
SDK Created by Speakeasy
kintsugi-tax/tax-platform-sdk 适用场景与选型建议
kintsugi-tax/tax-platform-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 789 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kintsugi-tax/tax-platform-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kintsugi-tax/tax-platform-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 789
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-11