To work with this package, firstly you must have a Loyverse account, and secondly you must create an API token through Loyverse itself.
- Documentation
- Installation
- Basic Usage
- Managing Categories
- Managing Customers
- Managing Discounts
- Managing Employees
- Managing Inventory
- Managing Items
- Managing Merchants
- Managing Modifiers
- Managing Payment Types
- Managing Pos Devices
- Managing Receipts
- Managing Shifts
- Managing Stores
- Managing Suppliers
- Managing Taxes
- Managing Variants
- Managing Webhooks
- Testing
- Contributing
- Security Vulnerabilities
- Credits
- License
To install the SDK in your project you need to require the package via composer:
composer require pashkevich/loyverse-sdk
You can create an instance of the SDK like so:
$loyverse = new Pashkevich\Loyverse\Loyverse(PERSONAL_ACCESS_TOKEN_HERE);
Using the Loyverse
instance you may perform multiple actions as well as retrieve the different resources Loyverse's
API provides:
$categories = $loyverse->categories();
This will give you an array of categories that you have access to, where each category is represented by an instance
of Pashkevich\Loyverse\Resources\Category
, this instance has multiple public properties like $id
, $name
, $color
, and others.
You may also retrieve a single category using:
$category = $loyverse->category(CATEGORY_ID_HERE);
On multiple actions supported by this SDK you may need to pass some parameters, for example when creating a new category:
$category = $loyverse->createCategory([
'name' => 'Fruits',
'color' => 'ORANGE',
]);
These parameters will be used in the POST request sent to Loyverse servers, you can find more information about the parameters needed for each action on Loyverse's official API documentation.
You can also set the desired timeout value:
$loyverse->setTimeout(120)->createCategory(array $data);
$loyverse->categories(array $parameters);
$loyverse->category(string $categoryId);
$loyverse->createCategory(array $data);
$loyverse->deleteCategory(string $categoryId);
On a Category
instance you may also call:
$category->update(array $data);
$category->delete();
$loyverse->customers(array $parameters);
$loyverse->customer(string $customerId);
$loyverse->createCustomer(array $data);
$loyverse->deleteCustomer(string $customerId);
On a Customer
instance you may also call:
$customer->update(array $data);
$customer->delete();
$loyverse->discounts(array $parameters);
$loyverse->discount(string $discountId);
$loyverse->createDiscount(array $data);
$loyverse->deleteDiscount(string $discountId);
On a Discount
instance you may also call:
$discount->update(array $data);
$discount->delete();
$loyverse->employees(array $parameters);
$loyverse->employee(string $employeeId);
$loyverse->inventory(array $parameters);
$loyverse->updateInventory(array $data);
$loyverse->items(array $parameters);
$loyverse->item(string $itemId);
$loyverse->createItem(array $data);
$loyverse->deleteItem(string $itemId);
On a Item
instance you may also call:
$item->update(array $data);
$item->delete();
$loyverse->merchant();
$loyverse->modifiers(array $parameters);
$loyverse->modifier(string $modifierId);
$loyverse->createModifier(array $data);
$loyverse->deleteModifier(string $modifierId);
On a Modifier
instance you may also call:
$modifier->update(array $data);
$modifier->delete();
$loyverse->paymentTypes(array $parameters);
$loyverse->paymentType(string $paymentTypeId);
$loyverse->posDevices(array $parameters);
$loyverse->posDevice(string $posDeviceId);
$loyverse->createPosDevice(array $data);
$loyverse->deletePosDevice(string $posDeviceId);
On a PosDevice
instance you may also call:
$posDevice->update(array $data);
$posDevice->delete();
$loyverse->receipts(array $parameters);
$loyverse->receipt(string $receiptNumber);
$loyverse->createReceipt(array $data);
$loyverse->createReceiptRefund(string $receiptNumber, array $data);
On a Receipt
instance you may also call:
$receipt->refund(array $data);
$loyverse->shifts(array $parameters);
$loyverse->shift(string $shiftId);
$loyverse->stores(array $parameters);
$loyverse->store(string $storeId);
$loyverse->suppliers(array $parameters);
$loyverse->supplier(string $supplierId);
$loyverse->createSupplier(array $data);
$loyverse->deleteSupplier(string $supplierId);
On a Supplier
instance you may also call:
$supplier->update(array $data);
$supplier->delete();
$loyverse->taxes(array $parameters);
$loyverse->tax(string $taxId);
$loyverse->createTax(array $data);
$loyverse->deleteTax(string $taxId);
On a Tax
instance you may also call:
$tax->update(array $data);
$tax->delete();
$loyverse->variants(array $parameters);
$loyverse->variant(string $variantId);
$loyverse->createVariant(array $data);
$loyverse->deleteVariant(string $variantId);
On a Variant
instance you may also call:
$variant->update(array $data);
$variant->delete();
$loyverse->webhooks(array $parameters);
$loyverse->webhook(string $webhookId);
$loyverse->createWebhook(array $data);
$loyverse->deleteWebhook(string $webhookId);
On a Webhook
instance you may also call:
$webhook->update(array $data);
$webhook->delete();
composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Loyverse SDK is open-sourced software licensed under the MIT license.