gubee-marketplace / php-sdk
Gubee SDK for PHP
Package info
github.com/gubee-marketplace/gubee-magento-m2-sdk
pkg:composer/gubee-marketplace/php-sdk
Requires
- php: ^8.0
- php-di/php-di: ^6.4
- php-http/client-common: ^2.7
- php-http/discovery: *
- php-http/multipart-stream-builder: ^1.3
- psr/container-implementation: ^1.0
- psr/http-client: ^1.0 | ^2.0
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.0
- psr/log: ^1.1|^2.0|^3.0
Requires (Dev)
- fakerphp/faker: ^1.23
- guzzlehttp/guzzle: ^7.8
- laminas/laminas-coding-standard: ^2.5
- league/openapi-psr7-validator: ^0.24
- monolog/monolog: ^2.9
- php-http/curl-client: ^2.3
- php-http/mock-client: ^1.6
- phpcompatibility/php-compatibility: ^9.3
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^9.6
- rector/rector: ^2.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Gubee PHP SDK
English | Português (Brasil)
PHP SDK for integrating with the Gubee API, aimed at teams that need to consume catalog, orders, promotions, media, platform, and related Gubee resources from PHP applications.
Summary
- Installation
- Documentation And Help
- What This Repository Covers
- Usage/Examples
- Running Tests
- Development
- Repository Maintenance
- Contributing
- Contributors
- Official Links
- FAQ
- License
Installation
Install gubee-marketplace/php-sdk with Composer.
composer require gubee-marketplace/php-sdk
Documentation And Help
- API and integration docs: developers.gubee.com.br
- Official Gubee website: gubee.com.br
- Repository contribution flow: CONTRIBUTING.md
- Security reports: SECURITY.md
- Bug reports and feature requests: GitHub Issues
What This Repository Covers
- HTTP client with Bearer authentication, retries, and response history
- models and enums for API payloads
- resources for catalog, orders, ads, invoice, notifications, promotions, tags, media, shipping, and platform APIs
- unit tests and integration contract tests against the OpenAPI specification
Usage/Examples
<?php use Gubee\SDK\Client; $client = (new Client()) ->authenticate('your-token');
Revalidate a token
<?php use Gubee\SDK\Client; $client = (new Client()) ->authenticate('your-token'); $token = $client->token()->revalidate('your-token'); echo $token->getSellerId();
Query platform configuration
<?php use Gubee\SDK\Client; use Gubee\SDK\Resource\PlatformResource; $client = (new Client()) ->authenticate('your-token'); $platforms = (new PlatformResource($client))->configuration();
Load a product by id
<?php use Gubee\SDK\Client; use Gubee\SDK\Resource\Catalog\ProductResource; $client = (new Client()) ->authenticate('your-token'); $product = (new ProductResource($client))->loadById('product-id'); echo $product->getId();
Read the last response
<?php use Gubee\SDK\Client; $client = (new Client()) ->authenticate('your-token'); $client->token()->revalidate('your-token'); $response = $client->getLastResponse();
Running Tests
To run tests, run the following command:
composer test
Development
composer cs
composer cs:fix
composer rector:dry-run
composer test
Repository Maintenance
- CI:
.github/workflows/ci.yml - security checks:
.github/workflows/security.yml - stale triage:
.github/workflows/stale.yml - changelog automation:
.github/workflows/changelog.yml - contributors banner:
.github/workflows/contributors.yml
Contributing
Read CONTRIBUTING.md before opening issues or pull requests.
Contributors
Official Links
- Developer portal: developers.gubee.com.br
- Official website: gubee.com.br
FAQ
Which PHP version is supported?
This SDK targets PHP ^8.0, matching the requirement declared in composer.json.
Does the SDK include a built-in DI container?
No dedicated application container is required for normal use. The SDK bootstraps its internal service provider, and the common entrypoint is instantiating Gubee\SDK\Client directly.
How do I authenticate requests?
Instantiate Client and call authenticate('your-token') before using a resource.
How do I access resources not exposed as shortcut methods on `Client`?
Instantiate the resource directly with the client instance, for example new ProductResource($client) or new PlatformResource($client).
Are there tests for the SDK contracts?
Yes. The repository includes unit tests and integration contract tests validated against the OpenAPI fixture in test/Integration/Contract/openapi-integration.json.
License
This project is currently distributed as proprietary software unless the maintainers publish a different license later.
