https://github.com/srdorado/siigo-client-php
This library consumes the Siigo API
https://github.com/srdorado/siigo-client-php
coverage packaging php test
Last synced: 5 months ago
JSON representation
This library consumes the Siigo API
- Host: GitHub
- URL: https://github.com/srdorado/siigo-client-php
- Owner: srdorado
- License: mit
- Created: 2022-10-08T23:36:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-27T19:28:40.000Z (over 1 year ago)
- Last Synced: 2025-08-12T01:45:18.011Z (10 months ago)
- Topics: coverage, packaging, php, test
- Language: PHP
- Homepage: https://packagist.org/packages/srdorado/siigo-client-php
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Siigo client API
*By [srdorado](https://github.com/srdorado)*
[](https://packagist.org/packages/srdorado/siigo-client-php)

[](https://packagist.org/packages/srdorado/siigo-client-php)
[](https://packagist.org/packages/srdorado/siigo-client-php)
[](https://github.com/srdorado/siigo-client-php/blob/master/composer.json)
[](https://github.com/srdorado/siigo-client-php/actions?workflow=test)
[](https://codecov.io/gh/srdorado/siigo-client-php)
[](https://packagist.org/packages/srdorado/siigo-client-php)
This library consumes the
[Siigo API](https://siigoapi.docs.apiary.io/#) enabling:
* Create, update and consult Sales Invoices.
* Sending sales invoices to the Dian and customers.
* Create, consult, update and delete Clients (Third Parties) and Products/Services.
* Create and consult Accounting Receipts, Credit Notes and Cash Receipts.
* Consult Inventory of a product in Siigo Cloud.
## Installation
```php
composer require srdorado/siigo-client-php
```
## How to use it?
* Get token
```php
function getToken()
{
// Create client token
$clientFactory = new \Srdorado\SiigoClient\Factory\ClientFactory();
$clientTokenFactory = $clientFactory->create(\Srdorado\SiigoClient\Enum\ClientType::TOKEN);
$clientToken = $clientTokenFactory->create();
$clientToken->setBaseUrl('https://api.siigo.com/');
// Create entity token
$entity = new \Srdorado\SiigoClient\Model\Entity(\Srdorado\SiigoClient\Enum\ClientType::TOKEN);
$entity->setData(
[
'username' => '',
'access_key' => ''
]
);
// Request token
return $clientToken->getToken($entity);
}
```
* Create product
```php
function getCustomClient()
{
// generate token
$token = $this->getToken();
// Create client
$clientFactory = new \Srdorado\SiigoClient\Factory\ClientFactory();
$clientProductFactory = $clientFactory->create(\Srdorado\SiigoClient\Enum\ClientType::PRODUCT);
$clientProduct = $clientProductFactory->create();
$clientProduct->setBaseUrl('https://api.siigo.com/');
$clientProduct->setAccessKey($token);
return $clientProduct;
}
function create()
{
$clientProduct = $this->getCustomClient();
$entity = new \Srdorado\SiigoClient\Model\Entity(\Srdorado\SiigoClient\Enum\ClientType::PRODUCT);
$dataEntity = $this->getExampleCompleteProduct();
$entity->setData($dataEntity);
$productId = $clientProduct->create($entity);
$this->assertTrue(true);
}
```
## Versioning
Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility
breaking changes will be kept to a minimum but be aware that these can occur.
Lock your dependencies for production and test your code when upgrading.
## License
This bundle is under the MIT license. For the full copyright and license
information please view the LICENSE file that was distributed with this source code.
## Donations
[](https://www.paypal.com/paypalme/srdorado01)