The Microsoft Business Center API is a RESTful API that provides an interface to the Microsoft Business Center service.
PHP 7.4 and later. Should also work with PHP 8.0.
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/spysystem/msbc-rest.git"
}
],
"require": {
"spysystem/msbc-rest": "*@dev"
}
}Then run composer install
Download the files and include autoload.php:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Spy\MsbcRestClient\Api\AuthenticateApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$grant_type = 'client_credentials'; // string
$client_id = 'b8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8'; // string
$client_secret = 'b8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8'; // string
$scope = 'https://api.businesscentral.dynamics.com/.default'; // string
try {
$result = $apiInstance->authenticate($grant_type, $client_id, $client_secret, $scope);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticateApi->authenticate: ', $e->getMessage(), PHP_EOL;
}All URIs are relative to https://api.businesscentral.dynamics.com/v2.0/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Production/ODataV4/Company('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthenticateApi | authenticate | POST /token | |
| BatchApi | callBatchService | POST /$batch | |
| CompanyApi | getCompanies | GET /companies | |
| JournalLinesPageApi | deleteTempJournalLine | DELETE /journalLines('{id}') | |
| SpyAccountingPeriodsApi | getSpyAccountingPeriods | GET /SpyAccountingPeriods | |
| SpyApplyCustomerTemplatesCodeUnitApi | applyCustomerTemplates | POST /SpyApplyCustomerTemplates_ApplyTemplates | |
| SpyCalcCustomerBalanceCodeUnitApi | calcCustomerBalance | POST /SpyCalcCustomerBalance_calcCustomerBalance | |
| SpyCountryPageApi | createSpyCountry | POST /SpyCountryPage | |
| SpyCountryPageApi | deleteSpyCountry | DELETE /SpyCountryPage('{Code}') | |
| SpyCountryPageApi | editSpyCountry | PATCH /SpyCountryPage('{Code}') | |
| SpyCountryPageApi | getSpyCountries | GET /SpyCountryPage | |
| SpyCountryPageApi | getSpyCountry | GET /SpyCountryPage('{Code}') | |
| SpyCustLedgerPageApi | createCustomerLedgerEntry | POST /SpyCustLedgerPage | |
| SpyCustLedgerPageApi | deleteCustomerLedgerEntry | DELETE /SpyCustLedgerPage({Entry_No}) | |
| SpyCustLedgerPageApi | editCustomerLedgerEntry | PATCH /SpyCustLedgerPage({Entry_No}) | |
| SpyCustLedgerPageApi | getCustomerLedgerEntries | GET /SpyCustLedgerPage | |
| SpyCustLedgerPageApi | getCustomerLedgerEntry | GET /SpyCustLedgerPage({Entry_No}) | |
| SpyCustomerPageApi | createCustomer | POST /SpyCustomer | |
| SpyCustomerPageApi | deleteCustomer | DELETE /SpyCustomer('{account}') | |
| SpyCustomerPageApi | editCustomer | PATCH /SpyCustomer('{account}') | |
| SpyCustomerPageApi | getCustomer | GET /SpyCustomer('{account}') | |
| SpyCustomerPageApi | getCustomers | GET /SpyCustomer | |
| SpyCustomerTemplatePageApi | createCustomerTemplate | POST /SpyCustomerTemplate | |
| SpyCustomerTemplatePageApi | deleteCustomerTemplate | DELETE /SpyCustomerTemplate('{Code}') | |
| SpyCustomerTemplatePageApi | editCustomerTemplate | PATCH /SpyCustomerTemplate('{Code}') | |
| SpyCustomerTemplatePageApi | getCustomerTemplate | GET /SpyCustomerTemplate('{Code}') | |
| SpyCustomerTemplatePageApi | getCustomerTemplates | GET /SpyCustomerTemplate | |
| SpyCustomerTransPageApi | createCustomerTransaction | POST /SpyCustomerTrans | |
| SpyCustomerTransPageApi | deleteCustomerTransaction | DELETE /SpyCustomerTrans({Entry_No}) | |
| SpyCustomerTransPageApi | editCustomerTransaction | PATCH /SpyCustomerTrans({Entry_No}) | |
| SpyCustomerTransPageApi | getCustomerTransaction | GET /SpyCustomerTrans({Entry_No}) | |
| SpyCustomerTransPageApi | getCustomerTransactions | GET /SpyCustomerTrans | |
| SpyDefaultDimensionPageApi | createDefaultDimension | POST /SpyDefaultDimension | |
| SpyDefaultDimensionPageApi | deleteDefaultDimension | DELETE /SpyDefaultDimension({TableID},'{No}','{DimensionCode}') | |
| SpyDefaultDimensionPageApi | editDefaultDimension | PATCH /SpyDefaultDimension({TableID},'{No}','{DimensionCode}') | |
| SpyDefaultDimensionPageApi | getDefaultDimension | GET /SpyDefaultDimension({TableID},'{No}','{DimensionCode}') | |
| SpyDefaultDimensionPageApi | getDefaultDimensions | GET /SpyDefaultDimension | |
| SpyExchangeRatesPageApi | createExchangeRate | POST /SpyExchangeRates | |
| SpyExchangeRatesPageApi | deleteExchangeRate | DELETE /SpyExchangeRates('{CurrencyCode}',{StartingDate}) | |
| SpyExchangeRatesPageApi | editExchangeRate | PATCH /SpyExchangeRates('{CurrencyCode}',{StartingDate}) | |
| SpyExchangeRatesPageApi | getExchangeRate | GET /SpyExchangeRates('{CurrencyCode}',{StartingDate}) | |
| SpyExchangeRatesPageApi | getExchangeRates | GET /SpyExchangeRates | |
| SpyExtensionInfoApi | getSpyExtensionInfo | GET /SpyExtensionInfo | |
| SpyFieldsPageApi | createField | POST /SpyFieldsPage | |
| SpyFieldsPageApi | deleteField | DELETE /SpyFieldsPage({TableNo},{FieldNo}) | |
| SpyFieldsPageApi | editField | PATCH /SpyFieldsPage({TableNo},{FieldNo}) | |
| SpyFieldsPageApi | getField | GET /SpyFieldsPage({TableNo},{FieldNo}) | |
| SpyFieldsPageApi | getFields | GET /SpyFieldsPage | |
| SpyGeneralLedgerSetupApi | getSpyGeneralLedgerSetup | GET /SpyGeneralLedgerSetup | |
| SpyInsertPostCodeCodeUnitApi | insertPostCode | POST /SpyInsertPostCode_InsertPostCode | |
| SpyJournalPageApi | createJournalEntry | POST /SpyJournalPage | |
| SpyJournalPageApi | deleteJournalEntry | DELETE /SpyJournalPage('{JournalTemplateName}','{JournalBatchName}',{LineNo}) | |
| SpyJournalPageApi | editJournalEntry | PATCH /SpyJournalPage('{JournalTemplateName}','{JournalBatchName}',{LineNo}) | |
| SpyJournalPageApi | getJournalEntries | GET /SpyJournalPage | |
| SpyJournalPageApi | getJournalEntry | GET /SpyJournalPage('{JournalTemplateName}','{JournalBatchName}',{LineNo}) | |
| SpyLedgerAccountPageApi | createLedgerAccount | POST /SpyLedgerAccount | |
| SpyLedgerAccountPageApi | deleteLedgerAccount | DELETE /SpyLedgerAccount('{No}') | |
| SpyLedgerAccountPageApi | editLedgerAccount | PATCH /SpyLedgerAccount('{No}') | |
| SpyLedgerAccountPageApi | getLedgerAccount | GET /SpyLedgerAccount('{No}') | |
| SpyLedgerAccountPageApi | getLedgerAccounts | GET /SpyLedgerAccount | |
| SpyLedgerTransPageApi | createLedgerTransactionEntry | POST /SpyLedgerTrans | |
| SpyLedgerTransPageApi | deleteLedgerTransactionEntry | DELETE /SpyLedgerTrans({Entry_No}) | |
| SpyLedgerTransPageApi | editLedgerTransactionEntry | PATCH /SpyLedgerTrans({Entry_No}) | |
| SpyLedgerTransPageApi | getLedgerTransactionEntries | GET /SpyLedgerTrans | |
| SpyLedgerTransPageApi | getLedgerTransactionEntry | GET /SpyLedgerTrans({Entry_No}) | |
| SpyPaymentTermPageApi | createPaymentTerm | POST /SpyPaymentTerm | |
| SpyPaymentTermPageApi | createPaymentTermV2 | POST /SpyPaymentTermV2 | |
| SpyPaymentTermPageApi | deletePaymentTerm | DELETE /SpyPaymentTerm('{code}') | |
| SpyPaymentTermPageApi | deletePaymentTermV2 | DELETE /SpyPaymentTermV2({systemId}) | |
| SpyPaymentTermPageApi | editPaymentTerm | PATCH /SpyPaymentTerm('{code}') | |
| SpyPaymentTermPageApi | editPaymentTermV2 | PATCH /SpyPaymentTermV2({systemId}) | |
| SpyPaymentTermPageApi | getPaymentTerm | GET /SpyPaymentTerm('{code}') | |
| SpyPaymentTermPageApi | getPaymentTermV2 | GET /SpyPaymentTermV2({systemId}) | |
| SpyPaymentTermPageApi | getPaymentTerms | GET /SpyPaymentTerm | |
| SpyPaymentTermPageApi | getPaymentTermsV2 | GET /SpyPaymentTermV2 | |
| SpyPostCodePageApi | createPostalCode | POST /SpyPostCode | |
| SpyPostCodePageApi | deletePostalCode | DELETE /SpyPostCode('{Code}','{City}') | |
| SpyPostCodePageApi | editPostalCode | PATCH /SpyPostCode('{Code}','{City}') | |
| SpyPostCodePageApi | getPostalCode | GET /SpyPostCode('{Code}','{City}') | |
| SpyPostCodePageApi | getPostalCodes | GET /SpyPostCode | |
| SpySupplierPageApi | createSupplier | POST /SpySupplier | |
| SpySupplierPageApi | deleteSupplier | DELETE /SpySupplier('{No}') | |
| SpySupplierPageApi | editSupplier | PATCH /SpySupplier('{No}') | |
| SpySupplierPageApi | getSupplier | GET /SpySupplier('{No}') | |
| SpySupplierPageApi | getSuppliers | GET /SpySupplier | |
| SpySupplierTransPageApi | createSupplierTransaction | POST /SpySupplierTrans | |
| SpySupplierTransPageApi | deleteSupplierTransaction | DELETE /SpySupplierTrans({Entry_No}) | |
| SpySupplierTransPageApi | editSupplierTransaction | PATCH /SpySupplierTrans({Entry_No}) | |
| SpySupplierTransPageApi | getSupplierTransaction | GET /SpySupplierTrans({Entry_No}) | |
| SpySupplierTransPageApi | getSupplierTransactions | GET /SpySupplierTrans | |
| SpyTemplateLinePageApi | createTemplateLine | POST /SpyTemplateLine | |
| SpyTemplateLinePageApi | deleteTemplateLine | DELETE /SpyTemplateLine('{Template}',{LineNo}) | |
| SpyTemplateLinePageApi | editTemplateLine | PATCH /SpyTemplateLine('{Template}',{LineNo}) | |
| SpyTemplateLinePageApi | getTemplateLine | GET /SpyTemplateLine('{Template}',{LineNo}) | |
| SpyTemplateLinePageApi | getTemplateLines | GET /SpyTemplateLine | |
| SpyVatPostingSetupPageApi | createSpyVatSetting | POST /SpyVatPostingSetup | |
| SpyVatPostingSetupPageApi | deleteSpyVatSetting | DELETE /SpyVatPostingSetup('{VatBusPostingGroup}','{VatProdPostingGroup}') | |
| SpyVatPostingSetupPageApi | editSpyVatSetting | PATCH /SpyVatPostingSetup('{VatBusPostingGroup}','{VatProdPostingGroup}') | |
| SpyVatPostingSetupPageApi | getSpyVatSetting | GET /SpyVatPostingSetup('{VatBusPostingGroup}','{VatProdPostingGroup}') | |
| SpyVatPostingSetupPageApi | getSpyVatSettings | GET /SpyVatPostingSetup | |
| SpyVendLedgerPageApi | createSupplierLedgerEntry | POST /SpyVendLedgerPage | |
| SpyVendLedgerPageApi | deleteSupplierLedgerEntry | DELETE /SpyVendLedgerPage({Entry_No}) | |
| SpyVendLedgerPageApi | editSupplierLedgerEntry | PATCH /SpyVendLedgerPage({Entry_No}) | |
| SpyVendLedgerPageApi | getSupplierLedgerEntries | GET /SpyVendLedgerPage | |
| SpyVendLedgerPageApi | getSupplierLedgerEntry | GET /SpyVendLedgerPage({Entry_No}) | |
| TempJournalLinesPageApi | commitToJournalLine | POST /SpyCreateJournalLine_commitToJournalLine | |
| TempJournalLinesPageApi | commitToJournalLineWithFileData | POST /SpyCreateJournalLine_commitToJournalLineWithFileData | |
| TempJournalLinesPageApi | createTempJournalLine | POST /journalLines | |
| TempJournalLinesPageApi | deleteAllTempJournalLines | POST /SpyCreateJournalLine_deleteAllEntries | |
| TempJournalLinesPageApi | editTempJournalLine | PATCH /journalLines('{id}') | |
| TempJournalLinesPageApi | getTempJournalLine | GET /journalLines('{id}') | |
| TempJournalLinesPageApi | getTempJournalLines | GET /journalLines |
- AuditFields
- AuthenticateErrorResponse
- AuthenticateResponse
- BaseEntity
- BatchRequest
- BatchRequestItem
- BatchResponse
- BatchResponseItem
- CommitToJournalLineWithFileData
- Companies
- CompaniesList
- CompaniesListResponse
- CreateJournalLine
- Error
- ErrorResponse
- JournalLine
- JournalLineList
- JournalLineListResponse
- JournalLineResponse
- ODataEnvelope
- SpyAccountingPeriod
- SpyAccountingPeriodList
- SpyAccountingPeriodsResponse
- SpyApplyCustomerTemplates
- SpyCountry
- SpyCountryList
- SpyCountryListResponse
- SpyCountryResponse
- SpyCreateJournalLineCommitToJournalLineResponse
- SpyCustLedger
- SpyCustLedgerList
- SpyCustLedgerListResponse
- SpyCustLedgerResponse
- SpyCustomer
- SpyCustomerList
- SpyCustomerListResponse
- SpyCustomerResponse
- SpyCustomerTemplate
- SpyCustomerTemplateList
- SpyCustomerTemplateListResponse
- SpyCustomerTemplateResponse
- SpyCustomerTrans
- SpyCustomerTransList
- SpyCustomerTransListResponse
- SpyCustomerTransResponse
- SpyDefaultDimension
- SpyDefaultDimensionList
- SpyDefaultDimensionListResponse
- SpyDefaultDimensionResponse
- SpyDimension
- SpyExchangeRates
- SpyExchangeRatesList
- SpyExchangeRatesListResponse
- SpyExchangeRatesResponse
- SpyExtensionInfo
- SpyExtensionInfoList
- SpyExtensionInfoResponse
- SpyFields
- SpyFieldsList
- SpyFieldsListResponse
- SpyFieldsResponse
- SpyGeneralLedgerSetup
- SpyGeneralLedgerSetupList
- SpyGeneralLedgerSetupResponse
- SpyInsertPostCode
- SpyJournalEntriesList
- SpyJournalEntriesListResponse
- SpyJournalEntry
- SpyJournalEntryResponse
- SpyLedgerAccount
- SpyLedgerAccountList
- SpyLedgerAccountListResponse
- SpyLedgerAccountResponse
- SpyLedgerTrans
- SpyLedgerTransList
- SpyLedgerTransListResponse
- SpyLedgerTransResponse
- SpyPaymentTerm
- SpyPaymentTermList
- SpyPaymentTermListResponse
- SpyPaymentTermResponse
- SpyPaymentTermV2
- SpyPaymentTermV2List
- SpyPaymentTermV2ListResponse
- SpyPaymentTermV2Response
- SpyPostCode
- SpyPostCodeList
- SpyPostCodeListResponse
- SpyPostCodeResponse
- SpySupplier
- SpySupplierList
- SpySupplierListResponse
- SpySupplierResponse
- SpySupplierTrans
- SpySupplierTransList
- SpySupplierTransListResponse
- SpySupplierTransResponse
- SpyTemplateLine
- SpyTemplateLineList
- SpyTemplateLineListResponse
- SpyTemplateLineResponse
- SpyVatPostingSetup
- SpyVatPostingSetupList
- SpyVatPostingSetupListResponse
- SpyVatPostingSetupResponse
- SpyVendLedger
- SpyVendLedgerList
- SpyVendLedgerListResponse
- SpyVendLedgerResponse
- SystemId
Authentication schemes defined for the API:
- Type: Bearer authentication
To run the tests, use:
composer install
vendor/bin/phpunitThis PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0.0- Generator version:
7.10.0
- Generator version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen