Download the PHP package ktr/business-central-sdk without Composer

On this page you can find all versions of the php package ktr/business-central-sdk. 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 business-central-sdk

Microsoft Business Central SDK for Laravel

Latest Version on Packagist Total Downloads Tests

A modern Laravel SDK for Microsoft Dynamics 365 Business Central. Connect to Business Central's web services with an elegant, Laravel-style API that feels right at home in your Laravel application.

Why This Package?

Building integrations with Microsoft Business Central can be complex and time-consuming. This SDK simplifies the entire process by providing:

Features

✅ Model-Based API - Eloquent-like models for all Business Central entities ✅ Query Builder - Intuitive filtering with where(), whereIn(), whereContains(), and more ✅ Relationship Expansion - Eager load related data with expand() ✅ Pagination Support - Built-in take(), skip(), lazy(), and all() methods ✅ HTTP Client Macro - Use Http::businessCentral() for quick API calls ✅ Facade Support - Simple BusinessCentral::get() / ::post() interface ✅ Automatic Token Management - OAuth2 tokens cached and refreshed automatically ✅ Laravel 11 & 12 Support - Tested on PHP 8.2 and 8.3

Requirements

Installation

Install the package via Composer:

Configuration

Add your Business Central credentials to your .env file:

Getting Your Credentials

  1. Register your app in Azure Portal
  2. Create an App Registration with API permissions for Business Central
  3. Generate a client secret
  4. Note your Tenant ID from Azure AD
  5. Find your Company ID and Environment from Business Central

Tip: For sandbox testing, set BUSINESS_CENTRAL_ENVIRONMENT=sandbox

Usage

This SDK provides three different APIs to fit your coding style. All examples below accomplish the same task - choose the one that feels best for your project.

1. Model-Based API (Recommended)

The Model API provides an Eloquent-like experience with full IDE autocompletion:

2. HTTP Client Macro

For quick, one-off API calls without models:

3. Facade API

Clean and simple for straightforward API interactions:

Query Builder Examples

The Model API includes a powerful query builder with OData support:

Basic Filtering

Advanced Filtering

Selecting Fields

Expanding Relationships

Sorting

Pagination

Finding Records

Data Type Handling

The query builder intelligently handles different data types to ensure correct OData formatting:

Important Notes:

Available Models

This SDK provides access to 85+ Business Central entities. Here are the most commonly used:

Sales & Customers

Purchasing & Vendors

Inventory & Items

Financial

Journals

Reporting & Analysis

Master Data

Tip: All models are located in Ktr\BusinessCentral\Models\ApiV20 namespace and include full PHPDoc type hints for IDE autocompletion.

API Reference

For detailed information about available fields, filters, and operations for each entity, refer to the official Microsoft Business Central API v2.0 Documentation.

Real-World Examples

Example 1: Create a Complete Sales Order

Example 2: Generate Sales Report

Example 3: Sync Inventory Levels

Example 4: Customer Management

Troubleshooting

Authentication Errors

If you receive authentication errors:

  1. Verify your credentials in .env
  2. Check that your Azure app has the correct API permissions
  3. Ensure your client secret hasn't expired
  4. Clear the token cache: php artisan cache:clear

API Limitations

OData Query Syntax

This SDK uses OData v4 query conventions. If you encounter filter errors:

Getting Help

Testing

Run the test suite:

Run tests with coverage:

Check code style:

Fix code style:

Changelog

Please see CHANGELOG for recent changes and version history.

Contributing

We welcome contributions! Please see CONTRIBUTING for details on how to contribute to this project.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


Built with ❤️ for the Laravel community


All versions of business-central-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
laravel/framework Version ^11.0|^12.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 ktr/business-central-sdk contains the following files

Loading the files please wait ...