bennetgallein/lex-office-api
Composer 安装命令:
composer require bennetgallein/lex-office-api
包简介
Simple API Integration for Lex-Office
关键字:
README 文档
README
Requirements
PHP: >= 7.4
Extensions: Composer, PHP-JSON
Install
composer:
composer require clicksports/lex-office-api
Usage
Search for the official API Documentation here.
You need an API Key for that.
Basic
$apiKey = getenv('LEX_OFFICE_API_KEY'); // store keys in .env file $api = new \Clicksports\LexOffice\Api($apiKey);
set cache
// can be any PSR-6 compatibly cache handler // in this example we are using symfony/cache $cacheInterface = new \Symfony\Component\Cache\Adapter\FilesystemAdapter( 'lexoffice', 3600, __DIR__ . '/cache' ); $api->setCacheInterface($cacheInterface);
Contact Endpoint
// get a page /** @var \Clicksports\LexOffice\Api $api */ $client = $api->contact(); $client->size = 100; $client->sortDirection = 'ASC'; $client->sortProperty = 'name'; // get a page $response = $client->getPage(0); //get all $response = $client->getAll(); // other methods $response = $client->get($entityId); $response = $client->create($data);
Country Endpoint
$response = $api->country()->getAll();
Invoices Endpoint
$response = $api->invoice()->getAll(); $response = $api->invoice()->get($entityId); $response = $api->invoice()->create($data); $response = $api->invoice()->document($entityId); // get document ID $response = $api->invoice()->document($entityId, true); // get file content
Down Payment Invoices Endpoint
$response = $api->downPaymentInvoice()->getAll(); $response = $api->downPaymentInvoice()->get($entityId); $response = $api->downPaymentInvoice()->create($data); $response = $api->downPaymentInvoice()->document($entityId); // get document ID $response = $api->downPaymentInvoice()->document($entityId, true); // get file content
Order Confirmation Endpoint
$response = $api->orderConfirmation()->getAll(); $response = $api->orderConfirmation()->get($entityId); $response = $api->orderConfirmation()->create($data); $response = $api->orderConfirmation()->document($entityId); // get document ID $response = $api->orderConfirmation()->document($entityId, true); // get file content
Quotation Endpoint
$response = $api->quotation()->getAll(); $response = $api->quotation()->get($entityId); $response = $api->quotation()->create($data); $response = $api->quotation()->document($entityId); // get document ID $response = $api->quotation()->document($entityId, true); // get file content
Voucher Endpoint
$response = $api->voucher()->getAll(); $response = $api->voucher()->get($entityId); $response = $api->voucher()->create($data); $response = $api->voucher()->update($entityId, $data); $response = $api->voucher()->document($entityId); // get document ID $response = $api->voucher()->document($entityId, true); // get file content
Credit Notes Endpoint
$response = $api->creditNote()->getAll(); $response = $api->creditNote()->get($entityId); $response = $api->creditNote()->create($data); $response = $api->creditNote()->document($entityId); // get document ID $response = $api->creditNote()->document($entityId, true); // get file content
Payment Endpoint
$response = $api->payment()->get($entityId);
Payment Conditions Endpoint
$response = $api->paymentCondition()->getAll();
Posting Categories Endpoint
$response = $api->postingCategory()->getAll();
Profile Endpoint
$response = $api->profile()->get();
Recurring Templates Endpoint
// get single entitiy $response = $api->recurringTemplate()->get($entityId); // use pagination $client = $api->recurringTemplate(); $client->size = 100; // get a page $response = $client->getPage(0); //get all $response = $client->getAll();
Voucherlist Endpoint
$client = $api->voucherlist(); $client->size = 100; $client->sortDirection = 'DESC'; $client->sortColumn = 'voucherNumber'; $client->types = [ 'salesinvoice', 'salescreditnote', 'purchaseinvoice', 'purchasecreditnote', 'invoice', 'downpaymentinvoice', 'creditnote', 'orderconfirmation', 'quotation' ]; $client->statuses = [ 'draft', 'open', 'paid', 'paidoff', 'voided', //'overdue', overdue can only be fetched alone 'accepted', 'rejected' ]; // get everything what we can, not recommend: //$client->setToEverything() // get a page $response = $client->getPage(0); //get all $response = $client->getAll();
File Endpoint
$response = $api->file()->upload($filePath, $voucherType); $response = $api->file()->get($entityId);
get JSON from Response
$json = $api->*()->getAsJson($response);
bennetgallein/lex-office-api 适用场景与选型建议
bennetgallein/lex-office-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.25k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rest」 「api」 「lex-office」 「lexoffice」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bennetgallein/lex-office-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bennetgallein/lex-office-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bennetgallein/lex-office-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple API Integration for Lexoffice
Simple API Integration for Lexoffice
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
Simple API Integration for Lex-Office
统计信息
- 总下载量: 1.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-11