kerekit/copy-depo-xml-export-client

Copy Depo XML Export client

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/kerekit/copy-depo-xml-export-client

v0.3.2 2025-12-04 22:14 UTC

This package is auto-updated.

Last update: 2025-12-04 22:15:06 UTC


README

Features

Implemented endpoints (methods):

  • categoryList
  • priceAndStockByProductCode
  • productAttributes

Endpoints (methods) to be implemented:

  • stockInformation
  • bevasarloListaCreate
  • priceAndStockByCategory
  • priceAndStockInfo
  • invoices
  • promotions

Installation

Install the latest version with:

$ composer require kerekit/copy-depo-xml-export-client

Basic Usage

<?php

use Kerekit\CopyDepoXmlExportClient\Client;
use Kerekit\CopyDepoXmlExportClient\Resources\SimpleStock;

// Init client
$client = new Client ('your-auth-code');

// Query categories
echo "Querying categories...\n";
$categories = $client->categoryList ();
$firstCategory = reset ($categories);

// Query product details
echo "Querying products of category '$firstCategory->name'...\n";
$products = $client->productAttributes (
    categoryId: $firstCategory->id,
    description: true,
    imageUrl: true,
);
$firstProduct = reset ($products);

// Query product stock & price only
echo "Querying price & stock for found product '$firstProduct->name'...\n";
$ids = [$firstProduct->id];
$pricesAndStocks = $client->priceAndStockByProductCode (productIds: $ids);
$priceAndStock = reset ($pricesAndStocks);
switch ($priceAndStock->simpleStock) {
    case SimpleStock::Green:
        echo "Product is in stock.\n";
        break;

    case SimpleStock::Yellow:
        echo "Product is expected to be in stock shortly.\n";
        break;

    case SimpleStock::Red:
        echo "Product can be pre-ordered.\n";
        break;

    default:
        throw new \Exception ("Unexpected stock: '$priceAndStock->simpleStock'");
        break;
}