jtl-scx / channel-api-client
API Client for SCX Channel API
Installs: 3 364
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 7
Requires
- php: ^7.4|8.0.*
- ext-json: *
- ext-zlib: *
- jtl-scx/api-base-client: ^1.4
- jtl/php-generic-collection: ^0.3
- myclabs/php-enum: ^1.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- phpstan/phpstan: ^0.12.64
- phpunit/phpunit: ^9.0
- vimeo/psalm: ^4.3
Suggests
- guzzlehttp/guzzle: Require this for making HTTP calls
- jtl/scx-api-client: Required. Installed it!
- dev-master
- 0.51.0
- 0.50.0
- 0.49.0
- 0.48.1
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.1
- 0.45.0
- 0.44.0
- 0.43.2
- 0.43.1
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.1
- 0.40.0
- 0.39.1
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.1
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.1
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.1
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.1
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.1
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.1
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- dev-dependabot/composer/phpstan/phpstan-1.9.14
- dev-dependabot/composer/phpstan/phpstan-1.9.13
- dev-dependabot/composer/phpstan/phpstan-1.9.12
- dev-dependabot/composer/phpunit/phpunit-9.5.28
- dev-dependabot/composer/vimeo/psalm-4.30.0
- dev-dependabot/composer/guzzlehttp/guzzle-7.4.5
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/jtl/php-generic-collection-0.5.0
- dev-dependabot/composer/friendsofphp/php-cs-fixer-3.4.0
- dev-EA-4131
- dev-EA-4041
- dev-EA-3910
- dev-EA-3531
- dev-EA-1917
- dev-EA-3671
- dev-unlinkSeller
- dev-EA-3807
- dev-EA-3511
- dev-EA-3722
This package is auto-updated.
Last update: 2023-01-20 02:01:22 UTC
README

SCX PHP-Channel-API-Client
SCX Channel-API Client repository for JTL-Sales-Channel-Extension based on PHP.
Usage
use JTL\SCX\Client\Api\AuthAwareApiClient; use JTL\SCX\Client\Api\Configuration; use JTL\SCX\Client\Channel\Api\Attribute\AttributesApi; use JTL\SCX\Client\Channel\Api\Category\CategoryApi; use JTL\SCX\Client\Channel\Api\Event\EventApi; use JTL\SCX\Client\Channel\Api\Notification\NotificationApi; use JTL\SCX\Client\Channel\Api\Offer\OfferApi; use JTL\SCX\Client\Channel\Api\Order\OrderApi; use JTL\SCX\Client\Channel\Api\Price\PriceApi; use JTL\SCX\Client\Channel\Api\Report\ReportApi; use JTL\SCX\Client\Channel\Api\Seller\SellerApi; $configuration = new Configuration( Configuration::HOST_PRODUCTION, $_ENV['refreshToken'] ); // create a AuthAwareApiClient to handle authentication $client = new AuthAwareApiClient($configuration); // read and acknowledge seller events $eventApi = new EventApi($client); // manage sellers (create) $sellerApi = new SellerApi($client); // manage meta data such as Categories, Attributes or Price $attributesApi = new AttributesApi($client); $categoryApi = new CategoryApi($client); $priceApi = new PriceApi($client); // manage orders (send new orders, update order status or address information) $orderApi = new OrderApi($client); // manage offers (mark in progress, mark as listed, mark as listing failed) $offerApi = new OfferApi($client); // Send a notification message back to SCX Channel API. $notificationApi = new NotificationApi($client); // Send requested Report back to SCX $reportingApi = new ReportApi($client); // Send SELLER_INVENTORY Report // see tests/Api/Report/Request/SendReportRequestTest.php
Working with Events
Seller events are one of the most important features in SCX-Channel-Api. A Seller Event is created by a Seller API Implementation, such as JTL-Wawi to request a action by the existing channel integration.
See JTL\SCX\Client\Channel\Event\EventType
for a list of existing Events.
use JTL\SCX\Client\Channel\Api\Event\EventApi; use JTL\SCX\Client\Channel\Api\Event\Request\GetEventListRequest; $eventApi = new EventApi($authAwareApiClient); // read a bulk of unacknowledged events from SCX Channel Api $sellerEventList = $eventApi->get(); foreach ($sellerEventList->getEventList() as $eventContainer) { // The Id of the event use this id to acknowledge event after processing $id = $eventContainer->getId(); // Datetime when the event was created $createdAt = $eventContainer->getCreatedAt(); // The Event Type $type = $eventContainer->getType(); // The Event itself $eventModel = $eventContainer->getEvent(); // processEvent($eventContainer) // finally acknowledge event after processing $eventApi->ack(new AcknowledgeEventIdListRequest([$id])); }