Download the PHP package codesbytvt/smartmart360-sdk without Composer
On this page you can find all versions of the php package codesbytvt/smartmart360-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codesbytvt/smartmart360-sdk
More information about codesbytvt/smartmart360-sdk
Files in codesbytvt/smartmart360-sdk
Package smartmart360-sdk
Short Description SmartMart360 external API PHP SDK with document types primary approach and proper autoloading
License proprietary
Informations about the package smartmart360-sdk
SmartMart360 PHP SDK v2.7.0 (codesbytvt/smartmart360-sdk)
🔥 PHARMACY ENHANCED: Medicine Catalogue with Variants!
PHP SDK for integrating external applications (Hospital, Lab, Imaging, Insurance, Supplier Portal, etc.) with SmartMart360.
New in v2.5.0:
- 📦 PROPER AUTOLOADING: Classes separated into individual files for correct PSR-4 autoloading
- 🎯 DOCUMENT_TYPES Fully Independent: Can be imported separately from SmartMartClient
- 🔧 Enhanced Test Script: Comprehensive autoloading verification
- 📚 Improved Documentation: Clear separation of classes and usage examples
New in v2.4.0:
- 🎯 DOCUMENT TYPES NOW DEFAULT:
createTransaction()uses document types by default - 📋 Complete DOCUMENT_TYPES enum: All standard business document types included
- 🔄 Legacy TRANSACTION_TYPES: Still supported for backward compatibility
New in v2.3.0:
- Document type support for transaction creation
- Enhanced transaction creation flexibility
New in v2.7.0:
- 🏥 PHARMACY FIRST: Variants included by default for medicine catalogue
- 💊 Medicine Display Names: Variants show as "500mg Tablets (10's)" format
- 👨⚕️ Doctor-Friendly: Search medicines, see all variants with stock
- 🛒 Prescription Ready: Each variant includes item_variant_id for ordering
- 📱 Web Interface Optimized: Clean grouping under medicine names
New in v2.6.0:
- 🔍 Item Variants in Catalogue:
include_variants=truereturns item_variant_id with each item - 📊 Per-Variant Stock Details:
include_stock_details=trueshows stock per variant/location - 🎯 Enhanced getItems() Method: New parameters for variant and stock detail control
- 🛠️ getItemsWithVariants(): Convenience method for getting items with variants
- 📋 Complete Variant Information: SKU, MRP, UOM, and stock levels per variant
New in v2.5.0:
- 📦 PROPER AUTOLOADING: Classes separated into individual files for correct PSR-4 autoloading
- 🎯 DOCUMENT_TYPES Fully Independent: Can be imported separately from SmartMartClient
- 🔧 Enhanced Test Script: Comprehensive autoloading verification
New in v2.4.0:
- 🎯 DOCUMENT TYPES NOW DEFAULT:
createTransaction()uses document types by default - 📋 Complete DOCUMENT_TYPES enum: All standard business document types included
- 🔄 Legacy TRANSACTION_TYPES: Still supported for backward compatibility
New in v2.3.0:
- Document type support for transaction creation
- Enhanced transaction creation flexibility
New in v2.2.0:
- Categories API for hierarchical product organization
📦 Installation & Autoloading
Option 1: Install from Packagist (Recommended)
Option 2: Local Development Repository
If the SDK isn't published yet, add this to your composer.json:
Autoloading Verification
After installation, verify autoloading works:
🔧 Troubleshooting Autoloading Issues
If you get Class not found errors, try these solutions:
1. Regenerate Autoloader
2. Check Installation
3. Test Autoloading Manually
Create a test file:
4. Check PHP Include Path
5. Composer.json Configuration
Ensure your composer.json has:
6. Web Server Configuration
For Apache/Nginx, ensure vendor/ is accessible and the autoloader is loaded in your bootstrap file.
7. PHP Version Compatibility
Ensure you're using PHP 8.1+ as required by the SDK:
8. Run Autoloader Test
Use the included test script to diagnose issues:
This script will check:
- ✅ Vendor autoload file exists
- ✅ Autoloader loads correctly
- ✅ SDK package is installed
- ✅ Classes are autoloaded properly
- ✅ Constants are accessible
- ✅ PHP version compatibility
Requirements
- PHP 8.1+
- ext-json
Installation
Autoloaded namespaces:
All classes are in separate files for proper autoloading:
SmartMartClient.php- Main API clientDocumentTypes.php- Document type constantsPartyTypes.php- Party type constants
Quick start
🔥 New Unified Items API
Get Items with Stock Filtering
The new getItems() method provides flexible inventory views:
Stock Filter Options
| Filter | Description | Response Includes Stock Data |
|---|---|---|
'all' |
Complete catalogue | ❌ No |
'in_stock' |
Items with stock > 0 | ✅ Yes |
'out_of_stock' |
Items with stock ≤ 0 | ✅ Yes |
'low_stock' |
Items needing restock | ✅ Yes |
Response Format
Legacy Methods (Still Supported)
📂 Categories API
Get Item Categories
Get the complete list of item categories for catalog management:
Response Structure:
Use Cases:
- Build category dropdowns in your application
- Filter items by category
- Create hierarchical category navigation
- Sync category structure with your system
Request & response shape
- Headers are auto-added:
X-API-Key,X-Client-ID,X-Application-Source. - All methods return the same envelope:
Data contracts
- OpenAPI spec:
openapi.yaml - JSON examples:
docs/examples/*.jsoncreate-transaction-request.jsoncreate-transaction-response.jsonparty-sync-request.jsonpayment-request.jsoninvoice-response.jsonparty-statement-response.json
🏥 Pharmacy Prescription Workflow
Medicine Catalogue & Prescription Creation
Example Response Structure
Display Name Generation:
- Parses SKU patterns like
PARA500-TAB→500mg Tablets - Supports common pharmacy forms: Tablets, Capsules, Syrup, Injection, Cream, etc.
- Extracts strength information (500mg, 120mg/5ml, etc.)
- Falls back to SKU or barcode if parsing fails
Request & response shape
Using Document Type (RECOMMENDED - Primary Approach):
Using Transaction Type (Legacy - Only if needed):
Sample success response:
Common operations
Catalog & items
Parties (customers, suppliers, patients, doctors, etc.)
Transactions
Billing & payments
Reports
Reference values
Party types
Transaction types
Testing
Best practices
- Always check
status === 1before usingdata. - Add retries for transient failures.
- Cache catalog/stock when possible.
- Use reference codes (MRN, vendor code, prescription id) consistently.
- Run
healthCheck()before critical flows to validate connectivity.