booni3 / redstag-wms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A PHP Package to connect to RedStag WMS API

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via composer:

composer require booni3/redstag-wms

Usage

Authenticate

$config = new \Booni3\RedstagWms\Api\Config();
$config->username = 'username-123';
$config->password = 'abcdefghijklmnop';
$api = \Booni3\RedstagWms\RedstagWms::make($config)->login();

Get Products

$products = $api->products()->getProducts(
    [
        'created_at' => [
            'from' => now()->subYears(2)->format('Y-m-d'),
            'to' => now()->format('Y-m-d'),
        ]
    ],
    [
        'sort_field' => 'created_at',
        'sort_dir' => 'desc',
        'page' => 1,
        'limit' => 100
    ]
);

Get Order

$order = $api->orders()->getOrder(143708)

Get Orders

$orders = $api->orders()->getOrders(
    [
        'created_at' => [
            'from' => now()->subYears(2)->format('Y-m-d'),
            'to' => now()->format('Y-m-d'),
        ]
    ],
    [
        'sort_field' => 'created_at',
        'sort_dir' => 'desc',
        'page' => 1,
        'limit' => 100
    ],
    [
        'unique_id',
        'created_at'
    ]
);

List Inventories

$inventory = $api->inventory()->listInventories(null, null, new DateTime('now -24 hours'));

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

License:MIT License


Languages

Language:PHP 100.0%