PHPackages                             siberfx/laravel-tryoto - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. siberfx/laravel-tryoto

ActiveLibrary[API Development](/categories/api)

siberfx/laravel-tryoto
======================

tryoto.com unofficial api integration using laravel http client.

1.0.1(1y ago)0256↑75.3%MITPHPPHP ^8.2||^8.3

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/siberfx/laravel-tryoto)[ Packagist](https://packagist.org/packages/siberfx/laravel-tryoto)[ Docs](https://github.com/siberfx/laravel-tryoto)[ RSS](/packages/siberfx-laravel-tryoto/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

### v1.0

[](#v10)

create your Controller and with a construct method inject our service as below;

```
class TryOtoController
{
    public $service;

    public function __construct()
    {
        $this->service = new TryotoService;
    }

    /// your code below
```

the constructed service will automatically generate for you the token instance and cache id for 58 minutes by default. the token is valid for only 1 hour in official documents, so I hardcoded that value for some certain reasons to 58 minutes fixed. you can change it from config file for your needs

Usage;
------

[](#usage)

some set of samples of usages in controller, you can adjust them in the way of your needs;

```
 public function auth()
    {
        return $this->service->authorize();
    }

    public function cancelOrder($orderId = 'OID-60774-1001')
    {
        return $this->service->cancelOrder($orderId);
    }

    public function orderDetail($orderId = 'OID-60774-1001')
    {
        return $this->service->orderDetail($orderId);
    }

    public function orderList()
    {
        return $this->service->listOrders();
    }

    public function createOrder($order)
    {
        return $this->dataSet($order);
    }

    public function setWebhook()
    {
        return (new TryotoService)->setWebhook();
    }

    public function dataSet(array $order = [])
    {
        $siteTitle = 'Shop title';

        if (empty($order) || !is_array($order)) {
            $order = [
                'orderCode' => '1231223',
                'amount' => 5.00,
                'sub_total' => 5.00,
                'description' => 'test description',
                'orderDate' => Carbon::parse(Carbon::now())->format('d/m/y H:i'),
                'deliverySlotDate' => Carbon::parse(Carbon::now()->addDay())->format('d/m/y'), // next day date
                'customer_name' => 'John Doe',
                'customer_email' => 'john@doe.com',
                'customer_phone' => '123456789',
                'customer_address' => 'test address',
                'customer_state' => 'State',
                'customer_city' => 'City',
                'customer_country' => 'TR',
                'customer_zipcode' => '12345',
                'products' => [
                    [
                        "productId" => 1,
                        "name" => 'product name 1',
                        "price" => 5.00,
                        "rowTotal" => 5,
                        "quantity" => 1,
                        "serialnumber" => "",
                        "sku" => 'SKU-Code',
                        "image" => 'https://fullpath-to-image.jpg',
                    ],
                    [
                        "productId" => 2,
                        "name" => 'product name 2',
                        "price" => 5.00,
                        "taxAmount" => 0,
                        "quantity" => 1,
                        "serialnumber" => "",
                        "sku" => 'SKU-Code 2',
                        "image" => 'https://fullpath-to-image-2.jpg',
                    ]
                ]
            ];
        }

        $body = [
            "orderId" => $order['orderCode'], // check documentation for your needs
            "ref1" => "", // check documentation for your needs
            "pickupLocationCode" => "", // check documentation for your needs
//            "deliveryOptionId" => "", // check documentation for your needs
            "serviceType" => "",
            "createShipment" => false,
            "storeName" => $siteTitle,
            "payment_method" => "paid",
            "amount" => (double)$order['amount'],
            "amount_due" => 0,
            "customsValue" => "12",
            "customsCurrency" => "TRY",
            "shippingAmount" => 20,
            "subtotal" => (double)$order['sub_total'],
            "currency" => "TRY",
            "shippingNotes" => $order['description'],
            "packageSize" => "small",
            "packageCount" => (int)count($order['products']),
            "packageWeight" => 1,
            "boxWidth" => 10, // check documentation for your needs
            "boxLength" => 10, // check documentation for your needs
            "boxHeight" => 10, // check documentation for your needs
            "orderDate" => $order['orderDate'], // "30/12/2020 15:45",
            "deliverySlotDate" => $order['deliverySlotDate'], //"31/12/2020",
            "deliverySlotTo" => "12pm",
            "deliverySlotFrom" => "6:30pm",
            "senderName" => $siteTitle,
            "customer" => [
                "name" => $order['customer_name'],
                "email" => $order['customer_email'],
                "mobile" => $order['customer_phone'],
                "address" => $order['customer_address'],
                "district" => $order['customer_state'],
                "city" => $order['customer_city'],
                "country" => $order['customer_country'],
                "postcode" => $order['customer_zipcode'],
                "lat" => "",
                "lon" => "",
                "refID" => "",
                "W3WAddress" => ""
            ],
            "items" => $this->productsParser($order['products'])
        ];

        $this->service->createOrder($body);

        return $body;
    }

    public function productsParser(array $products)
    {
        $result = [];

        foreach ($products as $single) {
            $result[] = [
                "productId" => $single['productId'],
                "name" => $single['name'],
                "price" => $single['price'],
                "rowTotal" => (double)$single['price'] * $single['quantity'],
                "taxAmount" => $single['taxAmount'],
                "quantity" => $single['quantity'],
                "serialnumber" => $single['serialnumber'],
                "sku" => $single['sku'],
                "image" => $single['image'],
            ];
        }
        return $result;
    }

    public function listenWebhook(Request $request)
    {
        $orderId = $request->get('orderId');
        $statusCode = $request->get('status');

        $trackingNumber = $request->get('trackingNumber');
        $brandedTrackingURL = $request->get('brandedTrackingURL');
        $driverName = $request->get('driverName');
        $driverEmail = $request->get('driverEmail');
        $timestamp = $request->get('timestamp');

        if (!$statusCode || !$orderId) {
            return false;
        }

        // here is your code for handling the webhook response

    }
```

Credits
-------

[](#credits)

- [Selim Görmüş](http://siberfx.com) - Lead Software Engineer &amp; Lead Maintainer;

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

646d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/319c5a3ca014236bc2d28e3e37825e1ec467b51455c020c6666d1f40f493c2e1?d=identicon)[siberfx](/maintainers/siberfx)

---

Top Contributors

[![siberfx](https://avatars.githubusercontent.com/u/10257240?v=4)](https://github.com/siberfx "siberfx (5 commits)")

---

Tags

Siberfxtryotocargo integrationshipment automationshipment integration

### Embed Badge

![Health badge](/badges/siberfx-laravel-tryoto/health.svg)

```
[![Health](https://phpackages.com/badges/siberfx-laravel-tryoto/health.svg)](https://phpackages.com/packages/siberfx-laravel-tryoto)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[echolabsdev/prism

A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.

2.3k388.3k10](/packages/echolabsdev-prism)[sburina/laravel-whmcs-up

WHMCS API client and user provider for Laravel

271.3k](/packages/sburina-laravel-whmcs-up)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
