mnastalski/baselinker-php

BaseLinker PHP library

v1.0.0 2024-12-08 21:27 UTC

This package is auto-updated.

Last update: 2024-12-08 21:32:48 UTC


README

PHP wrapper for baselinker.com.

Requirements

  • PHP >=8.1

Installation

composer require mnastalski/baselinker-php

Usage

Creating an instance

use Baselinker\Baselinker;

$baselinker = new Baselinker('[API token]');

Creating a request

$response = $baselinker->orders()->getOrders([
    'date_from' => 1609506671,
    'get_unconfirmed_orders' => true,
]);

$response->toArray();

/*
    [
        'status' => 'SUCCESS',
        'orders' => [
            [
                    'order_id' => '123456',
                    ...
            ],
            ...
        ]
    ]
*/

$orders = $response->getParameter('orders');

/*
    [
        [
                'order_id' => '123456',
                ...
        ],
        ...
    ]
*/

API Documentation

https://api.baselinker.com/