dotsplatform / catalog-api-sdk
SDK for the Dots Catalog Integration API (catalog-api).
Requires
- php: ^8.1|^8.2|^8.3|^8.4|^8.5
- dotsplatform/utils: ^1.|^2.
- guzzlehttp/guzzle: ^7.8
- illuminate/support: *
Requires (Dev)
- phpstan/phpstan: ^1.
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-08-11 13:57:34 UTC
README
Typed PHP client for the Dots Catalog Integration API (catalog-api).
use Dotsplatform\CatalogApiSdk\Client\CatalogClient; use Dotsplatform\CatalogApiSdk\DTO\Params\CatalogAuthContext; use Dotsplatform\CatalogApiSdk\DTO\Params\CatalogBatchParams; $auth = CatalogAuthContext::fromArray([ 'accountId' => $accountId, 'companyId' => $companyId, 'companyAddressId' => $addressId, 'headers' => [ 'X-Internal-Gateway-Token' => config('catalog.internal_gateway_token'), 'Idempotency-Key' => $key, ], ]); $result = app(CatalogClient::class)->upsertItems($auth, CatalogBatchParams::fromArray([ 'items' => [$row1, $row2], ])); $result->getBatchId();
The account/company/company-address context travels in the URL path
(accounts/{account}/companies/{company}/company-addresses/{companyAddress});
headers carry only the gateway token and optional Idempotency-Key / Api-Lang.
Bind in the consumer: CatalogClient::class => CatalogHttpClient::class, set
RESOURCES_CATALOG_EXTERNAL_HOST, and (in clients-api) forward the gateway
headers. Tests bind SuccessCatalogStubClient / FailCatalogStubClient.
The SDK is pure transport — it never verifies partner tokens; it forwards the headers the caller supplies.