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-09-04 11:18:35 UTC
README
弃用通知!
从2023年3月31日起,我们将不再支持此SDK。将不再进行进一步开发。
注意!
目前仅支持产品和运输。其他接口将陆续推出!
简介
otto市场PHP SDK是开发人员访问otto市场API并在此基础上构建程序的一种简单方式。有关所有接口的详细文档可以在我们的文档中找到。
跳转到
要求
- 注册otto市场 – 您需要一个有效的卖家账户。在此注册并获取您的凭据。
- 最低要求 – 运行SDK,您的系统需要 PHP >= 7.4。
安装
要使用SDK,我们建议使用Composer。它可在Packagist下找到,地址为thecodebunny/otto-api
。您可以在项目的根目录中使用以下命令将SDK包含到您的项目中。
composer require thecodebunny/otto-api
SDK的使用
设置新的交付类型和交付时间
<?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);
CLI客户端示例
有关实现示例,请参阅示例。
功能
我们提供以下使用方法
资源
- 许可证 – 请参阅Apache 2.0许可证