aidsoul/iiko-sdk

PHP SDK for IIKO (Card/Biz/Cloud/Transport)

Maintainers

👁 AidSoul

Package info

github.com/aidsoul/iiko-sdk

pkg:composer/aidsoul/iiko-sdk

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0 2023-10-02 08:13 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 634f78cca8e8f463058c92482ac13311ea3b5bd8

  • aidsoul <work-aidsoul.woop@outlook.com>
  • Ivan Okhotnikov <ohotnikovivan.woop@yandex.ru>

iikoiiko php sdkiiko apiiiko cardiiko transportiiko biziiko cloud

This package is auto-updated.

Last update: 2026-06-11 15:21:00 UTC


README

For install:

composer require aidsoul/iiko-sdk

Calling the constructor to get started

include "vendor/autoload.php";

use AidSoul\Iiko\Cloud\Cloud;
use AidSoul\Iiko\Card\Card;
use AidSoul\Iiko\ApiProvider;
use AidSoul\Iiko\CardApiProvider;
use GuzzleHttp\Client;

$client = new Client([
 'base_uri' => "https://api-ru.iiko.services",
 'verify' => false,
 'timeout' => 30.0,
]);

$apiProviderCloud = new ApiProvider($client, 'API_KEY');

Dictionary IIKO Cloud

$getDiscountData = $iikoCloud->dictionary->discount->get();
$getOrderData = $iikoCloud->dictionary->order->get();
$getPaymentData = $iikoCloud->dictionary->payment->get();
$getRemovalData = $iikoCloud->dictionary->removal->get();

Nomenclature

$nomeclature = new AidSoul\Iiko\Cloud\Nomenclature\Nomenclature($client, '14324f43');
$nomeclature->getNomenclature();
$nomeclature->getGroups();
$nomeclature->getProductCategories();
$nomeclature->getProducts();
$nomeclature->getRevision();
$nomeclature->getSizes();

Menu

$menu = new AidSoul\Iiko\Cloud\Menu\Menu($apiProviderCloud);
$menu->getMenu();
$menu->getMenuById();

Order

$order = $iikoCloud->order;

# Create order
## Set order container
 $order->orderData->setCustomerInfo(['id' => 'Customer id from iiko']);
 $order->orderData->setCustomerInfo(['name' => 'Customer name']);

 $order->orderData->setPhone('+79996288989');
 $order->orderData->setDeliveryPoint([
 'street' => [
 'city' => City,
 'name' => Street name (Street must be filled in the Streets directory
 ],
 'house' => house,
 'building' => building,
 'floor' => floor,
 'entrance' => entrance
 ]);

 $order->orderData->setComment('comment');
 $order->orderData->setItems([
 [
 'productId' => product_id,
 'price' => price,
 'amount' => amount,
 'type' => 'Product'
 ]
 ]);

 $order->orderData->setOrderServiceType( 'DeliveryByCourier' OR 'DeliveryByClient' );
 $order->orderData->setTerminalGroupId($iikoCloud->terminalGroup->getFirstTerminalGroup());
 
 $order->orderData->setDiscount($fields['coupon']);

 $order->orderData->setPayments([
 [
 'paymentTypeKind' => 'Card',
 'sum' => sum,
 'paymentTypeId' => paymentTypeId (FROM payment dictionary),
 'isProcessedExternal' => false,
 'paymentAdditionalData' => [ //optional
 "credential" => '+79999999999',
 "searchScope" => "Phone"
 ]
 ],
 [
 'paymentTypeKind' => 'IikoCard',
 'sum' => sum,
 'paymentTypeId' => paymentTypeId (FROM payment dictionary),
 'isProcessedExternal' => false
 ],
 [
 'paymentTypeKind' => 'Cash',
 'sum' => sum,
 'paymentTypeId' => paymentTypeId (FROM payment dictionary),
 'isProcessedExternal' => false
 ]
 ]);

#Order actions
$order->check();
$order->create();

$order->calculate(); //If you use coupon
$order->searchOrder($id); //Use order_id to search for an order

Customers

Login | Get customers info use phone number

$userData = $iikoCloud->authorization->login->login('phone_number');

Registration

$userInfo = new CustomerForImport([
 'name' => 'Name',
 'phone' => 'Phone',
 'birthday' => 'YYYY-MM-DD',
]);
$userId = $iikoCard->registration->registration($userInfo);