conviu/kaufland-seller-api

这是 Kaufland.de 卖家 API v2。更多信息请访问 [https://sellerapi.kaufland.com/](https://sellerapi.kaufland.com/)

dev-main 2024-05-23 17:40 UTC

This package is auto-updated.

Last update: 2024-09-23 18:19:41 UTC


README

这是 Kaufland.de 卖家 API v2。更多信息请访问 https://sellerapi.kaufland.com/

安装与使用

需求

PHP 7.2 及以上版本。

Composer

要通过 Composer 安装绑定,请在 composer.json 中添加以下内容

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/conviu/kaufland-seller-api.git"
    }
  ],
  "require": {
    "conviu/kaufland-seller-api": "*@dev"
  }
}

然后运行 composer install

您的项目可以自由选择所需的 HTTP 客户端,请要求提供 HTTP 客户端功能的包: https://packagist.org.cn/providers/psr/http-client-implementation https://packagist.org.cn/providers/php-http/async-client-implementation https://packagist.org.cn/providers/psr/http-factory-implementation

例如

composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门指南

请按照 安装过程 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');




$apiInstance = new KauflandSellerApi\Api\AttributesApi(
    // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
    // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
    new GuzzleHttp\Client()
);
$id_attribute = 21; // int | The ID of the attribute
$storefront = new \KauflandSellerApi\Model\Storefront(); // Storefront | Specifies the store by country
$locale = new \KauflandSellerApi\Model\ProductDataLocale(); // ProductDataLocale | Allows clients to consume the data in languages that are different from the storefront-default locale

try {
    $result = $apiInstance->getAttribute($id_attribute, $storefront, $locale);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AttributesApi->getAttribute: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 /v2

模型

授权

所有端点均不需要授权。

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

seller-api-support@kaufland-online.de

关于此包

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本: 2.14.1
    • 生成器版本: 7.5.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen