homedoctor-es/holded-php-sdk
最新稳定版本:1.0.3
Composer 安装命令:
composer require homedoctor-es/holded-php-sdk
包简介
A PHP package to access the Holded API by a comprehensive way.
关键字:
README 文档
README
A PHP package to access the Holded API by a comprehensive way
Installation
The preferred way to install this extension is through composer.
With Composer installed, you can then install the extension using the following commands:
$ php composer.phar require homedoctor-es/holded-php-sdk
or add
... "require": { "homedoctor-es/holded-php-sdk": "*" }
to the require section of your composer.json file.
Configuration
You can set the HOLDED_API_TOKEN as environment variables or add them later on Holded class instantiation.
The name of the environment var is HOLDED_API_KEY.
Usage
Endpoints calls must done through the Holded class.
If you haven't set the environment variable previously, remember to provide the key on instantiation.
$holded = new \HomedoctorEs\Holded\Holded($holdedApiKey); // or Holded::make($holdedApiKey) $holded->contact()->list();
Endpoints
At this moment, only can be managed 2 entities with this SDK: contacts and documents
Contacts
To check contacts entity requirements and fields, you can see https://developers.holded.com/reference#contacts
The contacts entity use these methods
$holded->contact()->list(); $holded->contact()->get($id); $holded->contact()->create($data); //$data = [] $holded->contact()->update($data); //$data = [] $holded->contact()->delete($id);
Documents
To check documents entity requirements and fields, you can see https://developers.holded.com/reference#documents
The contacts entity use these methods
$holded->document()->list(); $holded->document()->get($id); $holded->document()->create($data); //$data = [] $holded->document()->update($data); //$data = [] $holded->document()->delete($id); //$data = []
"docType" default value is invoice, if you want to instantiate another kind of document, you can pass docType param to document method
$document = $holded->document(Document::PURCHASE_ORDER);
Check Document class constants to see the kind of docType you can use
If you want to instantiate directly and invoice document you can do it using ->invoice() method
$invoice = $holded->invoice();
统计信息
- 总下载量: 3.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-11-17