Download the PHP package andreilungeanu/smartbill without Composer

On this page you can find all versions of the php package andreilungeanu/smartbill. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smartbill

Smartbill Laravel Package

Latest Version on Packagist Total Downloads

A Laravel package for the Smartbill API, supporting Laravel 11, 12 and 13. CI tests against Laravel 13.

Installation

You can install the package via composer:

Configuration

You can publish the configuration file with:

This will create a config/smartbill.php file in your application's config directory. You should add your Smartbill API credentials to your .env file:

Usage Examples

You can interact with the API in three ways:

1. Using the Facade (recommended for Laravel)

This is the most convenient method for use within a Laravel application.

2. Using the Service Container

This is useful for dependency injection within your own classes.

Both of these methods work seamlessly because Laravel's service container automatically handles the creation of the required HTTP client and injects it into the package.

3. Manual Instantiation (Advanced)

Parameterless new Smartbill() is no longer possible: the constructor now takes a configured HTTP client. If you need to use this package outside of a Laravel application or wish to manually construct the object, you must now provide a configured Illuminate\Http\Client\PendingRequest instance to its constructor.

Example 1: Creating an Invoice

This example shows how to create a new invoice and retrieve its number.

Example API Response

A successful createV2 call will return an array decoded from the following JSON structure:

documentViewUrl is a public link that needs no authentication. It serves an HTML view of the document, not the PDF — use getPdf() below for the PDF bytes. The deprecated create() returns the same body without the last three keys.


Example 2: Downloading an Invoice PDF

This example shows how to download the PDF content of an existing invoice.


And many more...

This is just a small sample of the available methods. The authoritative contract is Smartbill's OpenAPI spec at api.smartbill.ro. DOCUMENTATION.md is an older transcription kept on GitHub for reference; it still shows some deprecated signatures.

Error handling

A misspelled or wrongly typed field is rejected with 400 and a body that names the offending field. The package surfaces it as SmartbillRequestException:

Every other failure throws SmartbillApiException. getMessage() is the cause only — Smartbill sometimes wraps it in HTML meant for its own interface; the tags and the trailing help text are removed, and the wrapped detail is kept. getResponse() still holds the untouched response.

Exceeding the rate limit (30 calls per 10 seconds per token) throws SmartbillRateLimitException and locks the token for ten minutes. Do not retry it.

Known Issues

Smartbill-side behaviour, verified against the live API on 2026-08-23. Listed so callers know what to expect; none of it is something this package can fix.

Internal Server Errors on Invalid Request Data — fixed by Smartbill

Resolved. This issue was found and reported from this package. Re-tested against the live API on 2026-08-23 and confirmed fixed: a misspelled field now returns 400 with errors[].param naming it — precisely the behaviour asked for below. The original report is kept struck through for the record. See Error handling for how the package surfaces it today.

When working with the Smartbill API, there are a few known issues to be aware of:

  1. Internal Server Errors on Invalid Request Data: The API may return a 500 Internal Server Error when the request payload contains invalid data, such as a typo in a required field name.

    For example, sending nume instead of name in the client object will trigger a 500 error:

    Ideally, the API should respond with a 400 Bad Request status and a helpful error message detailing which field is incorrect. Instead, it returns a generic 500 error, which makes debugging difficult as it incorrectly suggests a server-side failure rather than a client-side mistake.

While this package attempts to mitigate these issues where possible, the fundamental problems lie with the API's implementation. We are awaiting fixes from the Smartbill provider to ensure more reliable and standards-compliant behavior.

AI coding agents (Laravel Boost)

This package ships AI guidelines at resources/boost/guidelines/core.blade.php. If your application uses Laravel Boost (^2.2), Boost can fold them into your agent instruction files (CLAUDE.md, AGENTS.md, Cursor rules, ...) so your assistant knows the API's traps before it writes a single call.

Boost will not enable them on its own — you have to opt in:

On an existing Boost install, use php artisan boost:update --discover instead (Boost 2.3.2+; the default from 2.5.0). Either way, pick andreilungeanu/smartbill when Boost asks which third-party guidelines to include. Boost skips that prompt in non-interactive runs, and from 2.5.3 also when boost:update runs as a Composer script — so a post-update-cmd hook will not add the package for you.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of smartbill with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andreilungeanu/smartbill contains the following files

Loading the files please wait ...