A comprehensive PHP SDK for integrating with Malaysia's LHDN (Lembaga Hasil Dalam Negeri) MyInvois e-invoicing system. This SDK simplifies the process of submitting, validating, and managing electronic invoices in compliance with Malaysian tax regulations.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/zulfadliresources/myinvois

v1.0.0 2025-12-16 18:36 UTC

This package is auto-updated.

Last update: 2025-12-16 18:56:12 UTC


README

A comprehensive PHP SDK for integrating with Malaysia's LHDN (Lembaga Hasil Dalam Negeri) MyInvois e-invoicing system. This SDK simplifies the process of submitting, validating, and managing electronic invoices in compliance with Malaysian tax regulations.

Features

  • Document Management: Create, submit, and retrieve e-invoices, credit notes, debit notes, and other UBL 2.1 compliant documents
  • Validation: Built-in validation for document structure and data integrity
  • API Integration: Seamless integration with MyInvois API endpoints for production and sandbox environments
  • Taxpayer Services: Query taxpayer information and manage registrations
  • Notification Handling: Process and respond to system notifications
  • Identity Services: Handle authentication and authorization
  • XML/JSON Serialization: Automatic conversion between PHP objects and UBL XML/JSON formats
  • Error Handling: Comprehensive error handling with detailed messages
  • Type Safety: Full PHP 8.3 support with strict typing

Requirements

  • PHP >= 8.3
  • Composer
  • Valid MyInvois API credentials (Client ID, Client Secret, etc.)

Installation

Install via Composer:

composer require zulfadliresources/myinvois

Quick Start

use MyInvois\MyInvoisClient;

$config = [
    'apiKey' => 'your-api-key',
    'clientId' => 'your-client-id',
    'clientSecret' => 'your-client-secret',
    'production' => false, // Set to true for production
];

$client = new MyInvoisClient($config);

// Create and submit an invoice
$invoice = new Invoice();
// ... configure invoice ...

$submission = $client->getDocumentSubmissionService()->submit($invoice);

Documentation

For detailed SDK documentation, including:

  • Complete API reference
  • Integration guides
  • Code examples
  • UBL specifications
  • Troubleshooting

See docs/MyInvois_SDK_Summary.md.

Testing

Run the test suite with PHPUnit:

composer install
vendor/bin/phpunit

Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

For major changes, please open an issue first to discuss the proposed changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Disclaimer

This SDK is not officially affiliated with LHDN Malaysia. Use at your own risk and ensure compliance with current regulations.