Skip to content
nejcc edited this page Jul 7, 2026 · 2 revisions

Minimax SDK

A Laravel SDK for the Minimax accounting API (SI / HR / RS). It handles OAuth2 auth and token caching, and wraps issued invoices, orders, customers, items and the code lists behind a small fluent API.

  • Zero-config auth — OAuth2 password grant with automatic, leeway-aware token caching.
  • Fake mode — canned fixtures so the SDK and admin UI run end-to-end before your credentials arrive.
  • Fluent resources — typed CRUD helpers plus a generic escape hatch for any endpoint.
  • MCP server — read the API from AI coding agents (Boost, Claude, Codex).

Requirements

  • PHP 8.4+
  • Laravel 13

Install

composer require nejcc/minimax-sdk
php artisan vendor:publish --tag=minimax-config

Add your credentials to .env (see Configuration):

MINIMAX_LOCALIZATION=SI
MINIMAX_CLIENT_ID=...
MINIMAX_CLIENT_SECRET=...
MINIMAX_USERNAME=...
MINIMAX_PASSWORD=...
MINIMAX_ORG_ID=123456

No credentials yet? Set MINIMAX_FAKE=true and everything runs off canned fixtures.

Quick start

use Nejcc\Minimax\Facades\Minimax;

// which orgs can this user see
$orgs = Minimax::orgs()->all();

// customers in the default org
$customers = Minimax::customers()->all()['Rows'];

// switch org for one chain
Minimax::forOrg(654321)->items()->all();

// create a draft invoice, issue it, grab the PDF
$invoice = Minimax::invoices()->create([...]);
$pdf = Minimax::invoices()->pdf($invoice['IssuedInvoiceId'], $invoice['RowVersion']);

Next: Usage · Invoices · MCP · Admin UI · Testing

Clone this wiki locally