PHPackages                             djeventplannerhub/djep-php-sdk - 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. djeventplannerhub/djep-php-sdk

ActiveLibrary[API Development](/categories/api)

djeventplannerhub/djep-php-sdk
==============================

Official PHP SDK for the DJ Event Planner (DJEP) REST API

V1.1.1(today)00MITPHPPHP &gt;=7.4

Since Jul 24Pushed todayCompare

[ Source](https://github.com/djeventplannerhub/djep-php-sdk)[ Packagist](https://packagist.org/packages/djeventplannerhub/djep-php-sdk)[ Docs](https://github.com/djeventplannerhub/djep-php-sdk)[ RSS](/packages/djeventplannerhub-djep-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

DJEP PHP SDK
============

[](#djep-php-sdk)

Official PHP SDK for the [DJ Event Planner (DJEP)](https://www.djeventplanner.com) REST API.

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

[](#requirements)

- PHP 7.4 or later
- cURL extension
- JSON extension

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

[](#installation)

### Via Composer (recommended)

[](#via-composer-recommended)

```
composer require djeventplannerhub/djep-php-sdk
```

### Manual Installation

[](#manual-installation)

Download the SDK and include the autoloader:

```
require 'djep-php-sdk/autoload.php';
```

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

[](#quick-start)

```
use DJEP\Client;

// Load your API key from environment variables (never hardcode keys)
$djep = new Client(getenv('DJEP_API_KEY'), getenv('DJEP_DOMAIN'));

// Check API status
$status = $djep->status();
echo $status->data->api_version;

// List upcoming events
$events = $djep->events->list(['status' => 'Booked', 'per_page' => 10]);
foreach ($events->data as $event) {
    echo $event->event_type . ' on ' . $event->event_date . "\n";
}
```

Authentication
--------------

[](#authentication)

Your API key is generated in DJEP under **Setup &gt; Integrations &gt; API Key**. The key format depends on your role:

- **Master Admin:** `secretkey_djidnumber`
- **Employee/Salesperson:** `secretkey_djidnumber_employeeid`

**Important:** Never hardcode your API key in source files. Use environment variables or a config file outside your web root.

```
// Option 1: Environment variable (recommended)
$djep = new Client(getenv('DJEP_API_KEY'), getenv('DJEP_DOMAIN'));

// Option 2: Config file outside web root
$config = require '/path/outside/webroot/djep-config.php';
$djep = new Client($config['api_key'], $config['domain']);

// Option 3: WordPress (wp-config.php constants)
$djep = new Client(DJEP_API_KEY, DJEP_DOMAIN);
```

Usage
-----

[](#usage)

### Events

[](#events)

```
// List events
$events = $djep->events->list(['status' => 'Booked', 'sort_by' => 'event_date']);

// Get a single event
$event = $djep->events->get(56789);

// Create an event (financials auto-calculated from package)
$event = $djep->events->create([
    'clientid' => 12345,
    'event_date' => '2026-09-15',
    'event_type' => 'Wedding',
    'start_time' => '3:00 PM',
    'end_time' => '11:00 PM',
    'addons' => '501:2,502:1',
]);
echo "Total fee: " . $event->data->financials->total_fee;

// Update specific fields
$djep->events->update(56789, [
    'status' => 'Confirmed',
    'guest_count' => 200,
    'comments' => 'Client confirmed by phone',
]);

// Update and recalculate financials
$djep->events->update(56789, ['pkg_idnumber' => 14200], true);

// Delete an event (cascading)
$djep->events->delete(56789);

// Event sub-data
$payments = $djep->events->payments(56789);
$songs = $djep->events->musicRequests(56789);
$planning = $djep->events->planning(56789);
```

### Clients

[](#clients)

```
$clients = $djep->clients->list(['per_page' => 25]);
$client = $djep->clients->get(12345);

$newClient = $djep->clients->create([
    'first_name' => 'John',
    'last_name' => 'Smith',
    'email' => 'john@example.com',
]);

$djep->clients->update(12345, ['email' => 'new@example.com']);
$djep->clients->delete(12345);
```

### Venues, Employees, Packages, Addons, Contacts

[](#venues-employees-packages-addons-contacts)

```
// All follow the same pattern
$venues = $djep->venues->list();
$venue = $djep->venues->get(789);

$employees = $djep->employees->list();
$packages = $djep->packages->list();
$addons = $djep->addons->list();
$contacts = $djep->contacts->list();
```

### Vendors

[](#vendors)

```
$vendors = $djep->vendors->list();
$vendor = $djep->vendors->get(3456);

// Link a vendor to an event
$djep->vendors->linkToEvent(56789, 3456);
```

### Payments

[](#payments)

```
// List all payments company-wide
$payments = $djep->payments->list(['per_page' => 50]);

// Add a payment to an event
$result = $djep->payments->addToEvent(56789, 500.00, 'Credit Card', [
    'processing_fee' => 15.00,
    'comments' => 'Final payment',
]);

// Note: the balance_due returned here is the event total minus all payments
// received. This is a different figure from the balance_due field on the event
// record itself, which is the event total minus the retainer.
echo "Balance due: " . $result->data->balance_due;
```

### Music Requests

[](#music-requests)

```
// Get requests for an event
$songs = $djep->musicRequests->forEvent(56789);

// Add a music request
$djep->musicRequests->add(56789, 'Queen', 'Bohemian Rhapsody', 'MPL');
$djep->musicRequests->add(56789, 'ABBA', 'Dancing Queen', 'DED', 'For the bride');
```

### Booking Helpers

[](#booking-helpers)

```
// List available helpers
$helpers = $djep->bookingHelpers->list();

// Run a helper by unique_id (recommended)
$result = $djep->bookingHelpers->run(56789, 'book_event_1');
echo $result->data->log;

// Or by position index
$result = $djep->bookingHelpers->run(56789, null, 0);
```

### Availability

[](#availability)

```
// Check a single date
$avail = $djep->availability->check('09/15/2026');
if ($avail->data->available) {
    echo $avail->data->employees->available . ' employees available';
}

// Check a date range (max 90 days)
$range = $djep->availability->range('09/01/2026', '09/30/2026');
foreach ($range->data->dates as $date) {
    echo $date->date . ': ' . ($date->available ? 'Available' : 'Unavailable') . "\n";
}
```

### Settings

[](#settings)

```
// Website tools (form config, field labels, validation)
$rfiSettings = $djep->settings->websiteTools('request_info');

// Company settings
$company = $djep->settings->company();

// Custom field configuration
$fields = $djep->settings->customFields();
```

### Expenses

[](#expenses)

```
$expenses = $djep->expenses->list(['per_page' => 25]);
$categories = $djep->expenses->categories();
$payees = $djep->expenses->payees();
$methods = $djep->expenses->paymentMethods();
```

### Other Resources

[](#other-resources)

```
// Submissions
$rfi = $djep->submissions->rfi();
$quotes = $djep->submissions->quotes();
$contactUs = $djep->submissions->contactUs();

// Closed dates, equipment, systems
$closedDates = $djep->closedDates->list();
$equipment = $djep->equipment->list();
$systems = $djep->systems->list();
```

Auto-Pagination
---------------

[](#auto-pagination)

For resources with pagination, use `all()` to automatically iterate through every page:

```
// Fetches all events across all pages
foreach ($djep->events->all(['status' => 'Booked']) as $event) {
    echo $event->event_date . "\n";
}

// Works with any paginated resource
foreach ($djep->clients->all() as $client) {
    echo $client->first_name . ' ' . $client->last_name . "\n";
}
```

Error Handling
--------------

[](#error-handling)

The SDK throws specific exceptions for different error types:

```
use DJEP\Exceptions\AuthenticationException;
use DJEP\Exceptions\NotFoundException;
use DJEP\Exceptions\ValidationException;
use DJEP\Exceptions\ForbiddenException;
use DJEP\Exceptions\RateLimitException;
use DJEP\Exceptions\DJEPException;

try {
    $event = $djep->events->get(99999);
} catch (AuthenticationException $e) {
    // Invalid or missing API key (401)
    echo "Auth error: " . $e->getMessage();
} catch (NotFoundException $e) {
    // Resource not found (404)
    echo "Not found: " . $e->getMessage();
} catch (ForbiddenException $e) {
    // Insufficient permissions (403)
    echo "Forbidden: " . $e->getMessage();
} catch (ValidationException $e) {
    // Invalid parameters (400)
    echo "Validation error: " . $e->getMessage();
} catch (RateLimitException $e) {
    // Too many requests (429)
    echo "Rate limited: " . $e->getMessage();
} catch (DJEPException $e) {
    // Any other API error, including network and TLS failures
    echo "Error: " . $e->getMessage();
}
```

Configuration Options
---------------------

[](#configuration-options)

```
$djep = new Client(getenv('DJEP_API_KEY'), getenv('DJEP_DOMAIN'), [
    'timeout'   => 60,                     // Request timeout in seconds (default: 30)
    'ca_bundle' => '/path/to/cacert.pem',  // Custom CA bundle (default: PHP's own setting)
    'base_url'  => 'https://staging.example.com/api/api.asp', // Override the endpoint
]);
```

OptionDefaultNotes`timeout``30`Request timeout in seconds.`ca_bundle`nonePath to a PEM CA bundle, used when PHP has no `curl.cainfo` configured. Must be readable or the client throws on construction.`base_url``https://{domain}/api/api.asp`Full endpoint override, useful for staging domains. Must begin with `https://` — the client throws otherwise, because the API key is sent as a bearer credential and cannot travel over plaintext HTTP.### TLS certificate errors

[](#tls-certificate-errors)

If a request fails with `cURL error (60): SSL certificate problem: unable to get local issuer certificate`, this almost always means your PHP installation has no CA bundle configured — not that there is a problem with the DJEP server. It is common on Windows, XAMPP and some Docker images.

Fix it by pointing cURL at a CA bundle:

1. Download `cacert.pem` from [curl.se/docs/caextract.html](https://curl.se/docs/caextract.html)
2. Either set it globally in `php.ini`:

    ```
    curl.cainfo = "/path/to/cacert.pem"
    ```
3. Or pass it for this client only:

    ```
    $djep = new Client(getenv('DJEP_API_KEY'), getenv('DJEP_DOMAIN'), [
        'ca_bundle' => '/path/to/cacert.pem',
    ]);
    ```

**Do not disable certificate verification to work around this.** Your API key grants full access to the associated DJEP account. With verification disabled, anyone able to intercept the connection can capture the key and use it. The SDK will emit a PHP warning if verification is ever turned off.

Security
--------

[](#security)

- **Never** commit API keys to version control
- Store keys in environment variables, `.env` files (excluded from Git), or config files outside your web root
- Use the most restrictive API key for your use case (employee key instead of master admin where possible)
- API keys provide full access to the associated account — treat them like passwords
- Only use the SDK in server-side code. Never expose an API key to browser JavaScript, mobile app source, or any client-side context where it can be inspected
- All requests are made over HTTPS with certificate verification enabled, and redirects are never followed, so the `Authorization` header is never replayed to another host
- Rotate a key immediately if you suspect it has been exposed — **Setup &gt; Integrations &gt; API Key** has Regenerate and Revoke options

API Documentation
-----------------

[](#api-documentation)

Full API documentation is available at your DJEP instance:

```
https://yourdomain.com/api/api.asp?action=docs

```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb1707f5d08ad9bc18302c71fdaa6d43e9e32c253f26633b828a3a809b12f0c1?d=identicon)[djeventplannerhub](/maintainers/djeventplannerhub)

---

Top Contributors

[![djeventplannerhub](https://avatars.githubusercontent.com/u/48489479?v=4)](https://github.com/djeventplannerhub "djeventplannerhub (7 commits)")

---

Tags

eventapisdkdjPlannerdjep

### Embed Badge

![Health badge](/badges/djeventplannerhub-djep-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/djeventplannerhub-djep-php-sdk/health.svg)](https://phpackages.com/packages/djeventplannerhub-djep-php-sdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

46688.8k5](/packages/deepseek-php-deepseek-php-client)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

138114.7k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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