PHPackages                             gacelabs/toktok-api - 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. gacelabs/toktok-api

ActivePlugin

gacelabs/toktok-api
===================

Toktok API

16PHP

Since Sep 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gacelabs/toktok-api)[ Packagist](https://packagist.org/packages/gacelabs/toktok-api)[ RSS](/packages/gacelabs-toktok-api/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Image of Toktok](https://github.com/gacelabs/toktok-api/raw/main/TT_400x400.jpg)](https://github.com/gacelabs/toktok-api/blob/main/TT_400x400.jpg)

toktok-api
==========

[](#toktok-api)

How to manage toktok deliveries thru Backend / end point calls

Requirements
------------

[](#requirements)

- PHP 7.0 and up

Installation
------------

[](#installation)

with composer

```
composer require gacelabs/toktok-api dev-main

```

[with zip](https://github.com/gacelabs/toktok-api/archive/refs/heads/main.zip) `https://github.com/gacelabs/toktok-api/archive/refs/heads/main.zip`

Declarations
------------

[](#declarations)

```
define('TOKTOK_USER', '');
define('TOKTOK_PASSWORD', '');
define('REFERRAL_CODE', '');
```

Usage
-----

[](#usage)

```
include ('path/to/ToktokApi.php');
$api = new ToktokApi;
```

There are two types of end point list:

- portal
- website

This is assigned in the `endpoint_list($type)` private method, where `$type` is (portal or website).

Found in [Line 184](https://github.com/gacelabs/toktok-api/blob/main/src/ToktokApi.php#L184)

Example
-------

[](#example)

To get toktok pricing and delivery directions, You can use this methos as your helper [toktok\_price\_directions\_format.php](https://github.com/gacelabs/toktok-api/blob/main/helper/toktok_price_directions_format.php).

(Please see [$toktok\_post](https://github.com/gacelabs/toktok-api/blob/main/helper/toktok_post_format.php) format).

```
$pricing = price_and_directions($api, $toktok_post);

$api->app_request('price_and_directions', $pricing);
if ($api->success) {
  $toktok_dpd = $api->response['result']['data']['getDeliveryPriceAndDirections'];
  $toktok_post['f_post'] = json_encode(['hash'=>$toktok_dpd['hash']], JSON_NUMERIC_CHECK);
  $toktok_post['f_distance'] = $toktok_dpd['pricing']['distance'] . ' km';
  $toktok_post['f_duration'] = format_duration($toktok_dpd['pricing']['duration']);
  $toktok_post['f_price'] = $toktok_dpd['pricing']['price'];
  $toktok_post['f_sender_mobile'] = preg_replace('/-/', '', $toktok_post['f_sender_mobile']);
  $toktok_post['f_recepient_mobile'] = preg_replace('/-/', '', $toktok_post['f_recepient_mobile']);
  $toktok_post['referral_code'] = REFERRAL_CODE;
}
```

Posting your order via toktok api:

```
$api->app_request('post_delivery', $toktok_post);
if ($api->success) {
  // get results here
  $data = $api->response;
} else {
  // throw $api->response error here
}
```

IF YOU LIKE MY WORK HERE? ANY AMOUNT OF DONATIONS WILL BE GLADLY APPRECIATED 🙌🙏🤝

[PAY PAL.ME](https://www.paypal.com/paypalme/datapushthru?country.x=PH&locale.x=en_US)

THANK YOU!

Reporting Issues
----------------

[](#reporting-issues)

Please [create an issue](https://github.com/gacelabs/toktok-api/issues) for any bugs, or submit merge requests.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/805bd5259f469c3fe0118fa8b39f557f4fbaeb870b244c7b287defac48471c0c?d=identicon)[gacelabs](/maintainers/gacelabs)

---

Top Contributors

[![gacelabs](https://avatars.githubusercontent.com/u/73697319?v=4)](https://github.com/gacelabs "gacelabs (34 commits)")

### Embed Badge

![Health badge](/badges/gacelabs-toktok-api/health.svg)

```
[![Health](https://phpackages.com/badges/gacelabs-toktok-api/health.svg)](https://phpackages.com/packages/gacelabs-toktok-api)
```

PHPackages © 2026

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