thecodebunny/otto-api

TheCodeBunny Otto API

dev-master 2023-09-04 08:52 UTC

This package is auto-updated.

Last update: 2024-11-04 11:42:46 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 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