dotsplatform/catalog-api-sdk

SDK for the Dots Catalog Integration API (catalog-api).

Maintainers

Package info

github.com/dotsplatform/catalog-api-sdk

pkg:composer/dotsplatform/catalog-api-sdk

Transparency log

Statistics

Installs: 28

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.2 2026-08-11 13:56 UTC

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.