PHPackages                             codesbytvt/smartmart360-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. codesbytvt/smartmart360-sdk

ActiveLibrary[API Development](/categories/api)

codesbytvt/smartmart360-sdk
===========================

SmartMart360 external API PHP SDK with document types primary approach and proper autoloading

2.8.1(4mo ago)011proprietaryPHPPHP ^8.1

Since Dec 12Pushed 4mo agoCompare

[ Source](https://github.com/codesbytvt/smartmart360-sdk)[ Packagist](https://packagist.org/packages/codesbytvt/smartmart360-sdk)[ RSS](/packages/codesbytvt-smartmart360-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (0)

SmartMart360 PHP SDK v2.7.0 (`codesbytvt/smartmart360-sdk`)
===========================================================

[](#smartmart360-php-sdk-v270-codesbytvtsmartmart360-sdk)

🔥 PHARMACY ENHANCED: Medicine Catalogue with Variants!
------------------------------------------------------

[](#-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=true` returns item\_variant\_id with each item
- **📊 Per-Variant Stock Details**: `include_stock_details=true` shows 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 &amp; Autoloading
--------------------------------

[](#-installation--autoloading)

### Option 1: Install from Packagist (Recommended)

[](#option-1-install-from-packagist-recommended)

```
composer require codesbytvt/smartmart360-sdk
```

### Option 2: Local Development Repository

[](#option-2-local-development-repository)

If the SDK isn't published yet, add this to your `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "/path/to/smartmart360-sdk",
            "options": {
                "symlink": false
            }
        }
    ],
    "require": {
        "codesbytvt/smartmart360-sdk": "2.1.0"
    }
}
```

### Autoloading Verification

[](#autoloading-verification)

After installation, verify autoloading works:

```
// This should work without require/include statements
use SmartMart\External\SmartMartClient;
use SmartMart\External\TRANSACTION_TYPES;
use SmartMart\External\PARTY_TYPES;

// Create client
$client = new SmartMartClient($url, $apiKey, $clientId, $appName);
```

🔧 Troubleshooting Autoloading Issues
------------------------------------

[](#-troubleshooting-autoloading-issues)

If you get `Class not found` errors, try these solutions:

### 1. Regenerate Autoloader

[](#1-regenerate-autoloader)

```
# Clear composer cache
composer clear-cache

# Remove and reinstall vendor directory
rm -rf vendor/
composer install

# Or just regenerate autoload files
composer dump-autoload
```

### 2. Check Installation

[](#2-check-installation)

```
# Verify package is installed
composer show codesbytvt/smartmart360-sdk

# Check autoload files exist
ls -la vendor/composer/
```

### 3. Test Autoloading Manually

[](#3-test-autoloading-manually)

Create a test file:

```
