thecodebunny / otto-api
TheCodeBunny Otto API
dev-master
2023-09-04 08:52 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.2
- league/oauth2-client: ^2.6
- monolog/monolog: 3.4.0
- phpunit/phpunit: ^10.0
- psr/log: 3.0.0
Requires (Dev)
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.6
This package is auto-updated.
Last update: 2024-11-04 11:42:46 UTC
README
Deprecation Notice!
After 31.03.2023 we will not support the sdk anymore. There will be no further development.
Notice!
Only products and shipments are currently supported. Other interfaces will follow!
Introduction
The otto market PHP SDK is an easy way for developers to access the otto market api in their php code, and build their programs on top of that. A detailed documentation about all interfaces can be found at our documentation.
Jump to:
Requirements
- Sign up for Otto Market – You need a working seller account. Register here and fetch your credentials.
- Minimum requirements – To run the SDK, your system needs PHP >= 7.4.
Installation
To use the SDK we recommend using Composer. It is available via Packagist under the thecodebunny/otto-api
.
You can include the SDK in your project using the following in the root directory of your project.:
composer require thecodebunny/otto-api
Use of the SDK
Set a new deliveryType and deliveryTime
<?php use Thecodebunny\OttoApi\Configuration; use Thecodebunny\OttoApi\Products\Model\Delivery; use Thecodebunny\OttoApi\PartnerApiClient; // Configure the client $configuration = Configuration::forLive('my-api-username', 'my-api-password'); $client = new PartnerApiClient($configuration); // Update the delivery information for all products $myProducts = $client->getPartnerProductClient()->getProducts(); foreach ($myProducts as $productVariation) { $delivery = new Delivery(); $delivery->setType('PARCEL'); $delivery->setDeliveryTime(2); $productVariation->setDelivery($delivery); } // Save the updated products $client->getPartnerProductClient()->postProducts($myProducts);
Example CLI Client
For an implemented example go to samples.
Features
We offer the following methods for usage:
- products
- get brands
- get categories
- get category definition from category
- get products
- post products from json
- get activeStatus
- post activeStatus
- get marketplaceStatus
- shipments
- get shipments
- post shipments
Resources
- License – see Apache 2.0 License