PHPackages                             ocolin/billmax - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ocolin/billmax

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ocolin/billmax
==============

A small REST API client for Billmax billing software

v1.2.0(2w ago)01MITPHPPHP ^8.3

Since Mar 31Pushed 2w agoCompare

[ Source](https://github.com/ocolin/Billmax)[ Packagist](https://packagist.org/packages/ocolin/billmax)[ Docs](https://github.com/ocolin/billmax)[ RSS](/packages/ocolin-billmax/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (5)Used By (0)

Billmax API Client
==================

[](#billmax-api-client)

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

[](#table-of-contents)

- [What is it?](#what-is-it)
- [Requirements](#requirements)
- [Installation](#installation)
- [Todo](#todo)
- [Configuration](#configuration)
    - [Settings](#settings)
    - [Authentication Mode](#authentication-mode)
    - [Configuring with Environment Variables](#configuring-with-environment-variables)
    - [Configuring with Constructor](#configuring-with-constructor)
    - [Guzzle HTTP Options](#guzzle-http-options)
- [Getting your API Key](#getting-your-api-key)
- [Response](#response)
- [Function Parameters](#function-parameters)
- [Method Functions](#method-functions)
    - [GET](#get)
    - [POST](#post)
    - [PATCH](#patch)
    - [DELETE](#delete)
- [Request Method](#request-method)
- [Filter](#filter)
    - [Condition Format](#condition-format)
    - [Example](#example)
    - [Condition Functions](#condition-functions)
    - [Operator Functions](#operator-functions)
- [Getting your API key](#Getting-your-API-key)
- [Uploading](#Uploading)

What is it?
-----------

[](#what-is-it)

This is a small lightweight PHP client for using the REST API service of Billmax billing software.

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

[](#requirements)

- PHP ^8.3
- guzzlehttp/guzzle ^7.10
- ocolin/global-type ^2.0

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

[](#installation)

```
composer require ocolin/billmax

```

Todo
----

[](#todo)

- Add OAuth2 support
- Add more integration testing

Configuration
-------------

[](#configuration)

### Settings

[](#settings)

The client can be configured by either environment variables, constructor arguments, or a combination of both, Here is a list of the settings needed for configuration.

EnvironmentConstructorDescriptionBILLMAX\_API\_KEY$apiKeyAPI Key to access serverBILLMAX\_API\_HOST$hostHostname and URI of API serverBILLMAX\_API\_AUTH$authAuthentication modeBILLMAX\_API\_USERNAME$usernameUsername for USERPASS modeBILLMAX\_API\_PASSWORD$passwordPassword for USERPASS modeBILLMAX\_API\_OAUTH2\_CLIENT\_ID$clientIdClient ID for OAuth2 modeBILLMAX\_API\_OAUTH2\_CLIENT\_SECRET$clientSecretClient secret for OAuth2 modeBILLMAX\_API\_APP\_ID$appIdApp ID found in BillmaxBILLMAX\_API\_DEVICE\_ID$deviceIdOptional Device IDBILLMAX\_API\_APP\_VERSION$appVersionOptional app version### Authentication mode.

[](#authentication-mode)

The Billmax REST API has 3 authentication modes:

- NONE - Uses only the Billmax remote application session ID
- USERPASS - Uses session ID of a staff employee via username/password
- OAUTH2 - Uses OAuth2 to authenticate. Not yet supported by this client.

### Configuring with Environment variables.

[](#configuring-with-environment-variables)

```
// Manually setting variables for demonstration
$_ENV['BILLMAX_API_HOST']     = 'https://myhost.com:3100/api/billmaxCoreApi/v1/';
$_ENV['BILLMAX_API_KEY']      = 'GETTHISFROMSESSIONIDINREMOTEAPP';
$_ENV['BILLMAX_API_AUTH']     = 'USERPASS';
$_ENV['BILLMAX_API_USERNAME'] = 'staffmember';
$_ENV['BILLMAX_API_PASSWORD'] = 'staffmemberpassword';
$_ENV['BILLMAX_API_APP_ID']   = 'billmax-techapp';

$billmax = new Ocolin\BillMax\Billmax();
```

### Configuring with constructor

[](#configuring-with-constructor)

The Billmax client uses a Config object class to hold settings. You can configure this by creating a Config object.

```
$config = new Ocolin\Billmax\Config(
        host: 'https://myhost.com:3100/api/billmaxCoreApi/v1/',
      apiKey: 'GETTHISFROMSESSIONIDINREMOTEAPP',
        auth: 'USERPASS',
    username: 'staffmember',
    password: 'staffmemberpassword',
       appId: 'billmax-techapp'
);

$billmax = new \Ocolin\Billmax\Billmax( $config: $config );
```

### Guzzle HTTP options.

[](#guzzle-http-options)

This client uses Guzzle to handle HTTP calls and allows for extra options to be specified in the Config object.

```
$config = new Ocolin\Billmax\Config(
    options: [
        'timeout' => 30,
        'verify'  => true
    ]
);
```

Response
--------

[](#response)

The Billmax client will return a response object with the following properties:

Property nameTypeDescriptionstatusintThe HTTP status code (200,401, etc)statusMessagestringThe HTTP status messageheadersarrayHTTP response headersbodyobject|arrayHTTP response body, json decodedFunction Parameters
-------------------

[](#function-parameters)

parametermethodtypedescriptionendpointALLstringEndpoint URI path. Any variable tokens will get replaced with matching kesy in query array/objectmethodN/AstringHTTP method to use in the request() methodqueryALLarray|objectURI path and query parameters. Keys that match {tokens} in URI will ne interpolated into the URI pathbodyPOST/PATCHarray|objectHTTP body in array or object format.autoGetPATCHbooleanAutomatically get the stored generation value of row to be updated in Billmax. If the generation value changed from the time you check to the time you patch, an error will be thrownMethod functions
----------------

[](#method-functions)

### GET

[](#get)

```
$response = $billmax->get(
    endpoint: '/accounts/{id}',
       query: [ 'id' => 1234 ]
);
```

### POST

[](#post)

```
$response = $billmax->post(
    endpoint: '/aps',
        body: [
        'name' => 'AP name',
        'description' => 'AP description',
        'pop' => 'My POP',
        'maximumDownloadRate' => 1000
        'maximumUploadRate' => 1000,
        'fccTechnologyCode' => 'Other Wireline',
        'technology' => 'wireless'
    ]
);
```

### PATCH

[](#patch)

```
$response = $billmax->patch(
    endpoint: '/aps/{id}',
       query: [ 'id' => 1234 ],
        body: [ 'name' => 'Updated AP name' ],
     autoGet: true // Defaults to true, but showing for example
);
```

### DELETE

[](#delete)

```
$response = $billmax->delete(
    endpoint: '/aps/{id}',
       query: [ 'id' => 1234 ]
);
```

Request method
--------------

[](#request-method)

Also included is a generic function without a specific HTTP method.

```
$response = $billmax->request(
    endpoint: '/aps/{id}',
    method: 'PATCH',
    query: [ 'id' => 1234 ],
    body: [ 'name' => 'updated name' ]
);
```

Filter
------

[](#filter)

The Billmax API has a query parameter that allows requests to be filtered. This class is to make creating filters easier by putting them in function calls rather than typing out a filter query.

A filter can have multiple conditions and each condiction consists of a field (a column in the database), an operator, and a value. The Filter allows these to be stacked together.

### Condition format

[](#condition-format)

```
Filter::where( name of columns )
    ->operatorFunction( value )
    ->build()

Filter::where( name of column1 )
    ->operator1( value )
    ->also( name of column2 )
    ->operator2( value )
    ->build()

```

### Example

[](#example)

```
use Ocolin\Billmax\Filter;
$output = $billmax->get(
    endpoint: '/accounts',
    query: [
        'fltrs' => Filter::where( 'id' )
                          ->in( [1,2,3] )
                          ->also( 'state' )
                          ->ne( 1 )
                          ->build()
    ]
);
```

### Condition functions

[](#condition-functions)

Function nameDescriptionwherestart conditionalsoadd additional conditionbuildbuild the query into a string### Operator functions

[](#operator-functions)

Function nameValue typeDescriptioneqstring|int|floatequalsnestring|int|floatnot equalslikestringlikenlikestringnot likeinarrayin \[\]ninarraynot in \[\]hasarrayhas \[\]nhasarraydoes not have \[\]gtstring|int|floatgreater thanltstring|int|floatless thangtestring|int|floatgreater than or equalltestring|int|floatless than or equalftstringfulltextindex - match againstftbstringfulltextindex - in boolean modeftqstringfulltextindex - with query expansionGetting your API key.
---------------------

[](#getting-your-api-key)

The api ksy is part of your billmax remove application and was generated when you set up the remote application. Locating your API Key:

- Log into Billmax staff portal
- Under the **System Administration** menu, go to **Remote Applications**
- Click on the number next to your **billmaxCoreApi** app
- Copy the value from the **Session Id** field
- Click **Generate Session Id** if you want to create a new key.

Uploading
---------

[](#uploading)

Because uploading files works much different from the rest of endpoints, a specific function as been created to handle file uploading.

### Upload arguments

[](#upload-arguments)

ArgumenttypedescriptionentitystringEntity to attach file. Ex: account, ticket, message, service, etc.entityIdintegerThe ID of entity to attach to. Ex: account 1, ticket 3, service 1, etc.filePathsarrayAn array of file arrays. See table below for file path values.### File Path Properties

[](#file-path-properties)

Each file takes an array of values:

Property NameTypeDescritionpathstringPath to and including the file to upload.classstringBillmax file class to use. Default is 'support'descriptionstringA description of the file for display purposes### Example

[](#example-1)

```
$output = $billmax->upload(
    entity: 'account',
    entityId: 1
    files: [
        [
            'path'        => __DIR__ '/file.txt',
            'class'       => 'support',
            'description' => 'My special file'
        ]
    ]
);
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance97

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~26 days

Total

4

Last Release

17d ago

### Community

Maintainers

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

---

Tags

apiclientrestbillingispbroadbandwispbillmax

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-billmax/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-billmax/health.svg)](https://phpackages.com/packages/ocolin-billmax)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[meteocontrol/vcom-api-client

HTTP Client for meteocontrol's VCOM API - The VCOM API enables you to directly access your data on the meteocontrol platform.

188.0k1](/packages/meteocontrol-vcom-api-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.1k38](/packages/dreamfactory-df-core)

PHPackages © 2026

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