otto/marketplace-php-sdk

This package is abandoned and no longer maintained. No replacement package was suggested.

Otto Market PHP SDK

0.2.3 2022-02-28 12:09 UTC

This package is auto-updated.

Last update: 2023-02-20 08:31:08 UTC


README

Test and Verify

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

  1. Sign up for Otto Market – You need a working seller account. Register here and fetch your credentials.
  2. 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 otto/marketplace-php-sdk. You can include the SDK in your project using the following in the root directory of your project.:

composer require otto/marketplace-php-sdk

Use of the SDK

Set a new deliveryType and deliveryTime

<?php

use Otto\Market\Client\Configuration;
use Otto\Market\Products\Model\Delivery;
use Otto\Market\Client\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