stellion/vidaxl-sdk

PHP VidaXL/DropXL SDK - Compatible with both VidaXL and DropXL APIs

1.0.0 2025-09-03 09:44 UTC

This package is auto-updated.

Last update: 2025-09-03 09:44:41 UTC


README

PHP SDK for VidaXL and DropXL APIs. Supports both the legacy VidaXL API and the new DropXL API.

Features

  • ✅ Full API compatibility with both VidaXL and DropXL
  • ✅ Built-in rate limiting (1 request/second for DropXL)
  • ✅ Order management (create, retrieve orders)
  • ✅ HTTP Basic Authentication
  • ✅ Sandbox and Production environments

Installation

composer require stellion/vidaxl-sdk

Usage

Basic Setup

use Stellion\Vidaxl\Client;
use Stellion\Vidaxl\Authentication;
use Stellion\Vidaxl\Mode;
use Stellion\Vidaxl\Http\Client as HttpClient;
use GuzzleHttp\Client as GuzzleClient;

// Configure authentication
$auth = new Authentication('your-email@example.com', 'your-api-token');

// Configure mode (live uses DropXL URLs by default)
$mode = Mode::live(); // or Mode::sandbox()

// Setup HTTP client with rate limiting
$httpClient = new HttpClient(new GuzzleClient());

// Create API client
$client = new Client($httpClient, $auth, $mode);

Rate Limiting

The SDK includes built-in rate limiting for DropXL API compliance:

// Default: 1 request per second (DropXL requirement)
$httpClient = new HttpClient(new GuzzleClient());

// Custom rate limit
$httpClient->setMinRequestInterval(0.5); // 0.5 seconds between requests

// Disable rate limiting (for VidaXL legacy API)
$httpClient->disableRateLimit();

Migration from VidaXL to DropXL

Simply update your environment variables:

  • Base URLs are automatically updated to DropXL
  • Authentication method remains the same
  • All API endpoints remain compatible

API Reference

Orders

// Get all orders
$orders = $client->getOrders();

// Get specific order
$args = new GetOrderArguments();
$args->setOrderReference('ORDER-123');
$order = $client->getOrder($args);

// Create order
$orderArgs = new CreateOrderArguments();
// ... configure order details
$result = $client->createOrder($orderArgs);

Changelog

v1.0.0

  • ✅ Updated for DropXL API compatibility
  • ✅ Added rate limiting support
  • ✅ Maintained backward compatibility with VidaXL
  • ✅ Production ready