PHPackages                             nava/pandago-php - 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. nava/pandago-php

ActiveLibrary[API Development](/categories/api)

nava/pandago-php
================

PHP client for the pandago API

00PHPCI passing

Since May 15Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/NavanithanS/pandago-php)[ Packagist](https://packagist.org/packages/nava/pandago-php)[ RSS](/packages/nava-pandago-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Pandago PHP Client Library 📦
============================

[](#pandago-php-client-library-)

A robust PHP client library for interacting with the Pandago API for on-demand courier delivery services. This library provides a clean, type-safe interface for all Pandago API operations with comprehensive validation and error handling.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration &amp; Authentication](#configuration--authentication)
- [Quick Start](#quick-start)
- [Laravel Integration](#laravel-integration)
- [API Reference](#api-reference)
    - [Order Operations](#order-operations)
    - [Outlet Management](#outlet-management)
- [Error Handling](#error-handling)
- [Supported Countries](#supported-countries)
- [Testing](#testing)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)

Features
--------

[](#features)

- 🔒 **Secure Authentication:** JWT-based authentication with RSA key pairs
- 📦 **Complete Order Management:** Create, update, cancel, and track delivery orders
- 🏪 **Outlet Management:** Create and manage delivery pickup locations
- 🌍 **Multi-Country Support:** Works across 12+ countries and regions
- ⚡ **Real-time Tracking:** Get live courier location and order status updates
- 💰 **Fee Estimation:** Calculate delivery costs before placing orders
- 📸 **Proof of Delivery:** Retrieve delivery confirmation photos
- ✅ **Built-in Validation:** Comprehensive parameter validation with helpful error messages
- 🛠️ **Error Handling:** Context-aware error handling with actionable suggestions
- 🚀 **Laravel Integration:** First-class Laravel support with service provider and facade
- 🧪 **Testing Support:** Mock servers and comprehensive test utilities
- 📊 **Logging:** PSR-3 compatible logging for debugging and monitoring

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

[](#requirements)

- **PHP:** 7.1 or later
- **Extensions:** `ext-json`
- **Dependencies:**
    - `GuzzleHttp/Guzzle` (^6.3|^7.0)
    - `Firebase/php-jwt` (^5.0|^6.0)
    - `Ramsey/uuid` (^3.8|^4.0)
    - `Symfony/validator` (^3.4|^4.0|^5.0|^6.0)
    - PSR-3 compatible logger

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

[](#installation)

Install via Composer:

```
composer require nava/pandago-php
```

Configuration &amp; Authentication
----------------------------------

[](#configuration--authentication)

### 1. Generate RSA Key Pair

[](#1-generate-rsa-key-pair)

First, generate your RSA key pair for secure API communication:

```
# Generate private key
openssl genrsa -out pandago-private.pem 2048

# Generate public key from private key
openssl rsa -in pandago-private.pem -pubout > pandago-public.pem
```

Alternatively, use an online RSA generator:

- Visit [CryptoTools RSA Generator](https://www.cryptotools.net/rsa)
- Select 2048-bit key length
- Click "Generate Key Pair"
- Save the private key as `pandago-private.pem`
- Save the public key as `pandago-public.pem`

### 2. Register with Pandago

[](#2-register-with-pandago)

Contact your Pandago representative and provide:

- **Public Key:** Contents of `pandago-public.pem`
- **Brand/Branch Details:**
    - Name (e.g., "Store ABC")
    - Address with coordinates
    - Phone number
    - Callback URL (optional, for webhooks)

You'll receive:

- **Client ID:** `pandago:my:00000000-0000-0000-0000-000000000000`
- **Key ID:** `00000000-0000-0000-0000-000000000001`
- **Scope:** `pandago.api.my.*`

### 3. Basic Configuration

[](#3-basic-configuration)

```
use Nava\Pandago\Client;

$client = Client::make(
    'pandago:my:00000000-0000-0000-0000-000000000000', // Client ID
    '00000000-0000-0000-0000-000000000001',             // Key ID
    'pandago.api.my.*',                                 // Scope
    file_get_contents('/path/to/pandago-private.pem'),  // Private Key
    'my',                                               // Country
    'sandbox',                                          // Environment
    30,                                                 // Timeout (seconds)
    $logger                                             // PSR-3 Logger (optional)
);
```

Quick Start
-----------

[](#quick-start)

Here's a complete example of creating a delivery order:

```
