PHPackages                             willymaciel/sankhya-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. willymaciel/sankhya-php

ActiveLibrary[API Development](/categories/api)

willymaciel/sankhya-php
=======================

API em PHP para integração com WebService da Sankhya

0.0.1(6y ago)121116[1 issues](https://github.com/WillyMaciel/sankhya-php/issues)MITPHPPHP &gt;=7.1

Since Feb 11Pushed 6y ago2 watchersCompare

[ Source](https://github.com/WillyMaciel/sankhya-php)[ Packagist](https://packagist.org/packages/willymaciel/sankhya-php)[ RSS](/packages/willymaciel-sankhya-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Sankhya PHP API
===============

[](#sankhya-php-api)

Este package utiliza o package "tightenco/collect" como dependência, para retornar resultados como Collection (o mesmo utilizado no framework Laravel).

Instalação via composer
-----------------------

[](#instalação-via-composer)

```
composer require willymaciel/sankhya-php
```

Autenticação
------------

[](#autenticação)

### Login

[](#login)

```
require_once __DIR__ . '/vendor/autoload.php';
use WillyMaciel\Sankhya\SwServiceInvoker;

$api = new SwServiceInvoker('http://urldosankhya.com.br:8080/');
$api->login('usuario_sankhya', 'senha');
```

### Logout

[](#logout)

```
$api->logout();
```

Services
--------

[](#services)

### DbExplorer

[](#dbexplorer)

Para utilizar o DbExplorer o usuário utilizado para Login deve ter permissão neste Modulo no SankhyaW.

OBS: o DbExplorer possui um limite de 5000 registros por query.

```
//Realiza uma query (Somente Select)
//Retorna os resultados em uma Collection
$result = $api->dbExplorer('SELECT * FROM TSIUSU');
dump($result);
```

### CacSp - Incluir Nota

[](#cacsp---incluir-nota)

Primeiro deve-se criar o Cabeçalho da nota, necessário para criar uma Nota, em seguida podemos incluir itens na nota. Exemplo de inclusão de nota:

```
use WillyMaciel\Sankhya\Models\Nota;
use WillyMaciel\Sankhya\Models\NotaCabecalho;
use WillyMaciel\Sankhya\Models\NotaItem;
use WillyMaciel\Sankhya\Services\CacSp;

//Cria Cabeçalho
$notaCabecalho = new NotaCabecalho();
$notaCabecalho->setTipMov('P');
$notaCabecalho->setDtNeg('11/05/2020');
$notaCabecalho->setCodTipVenda(234);
$notaCabecalho->setCodParc(2190);
$notaCabecalho->setCodTipOper(1033);
$notaCabecalho->setCodEmp(1);
$notaCabecalho->setCodVend(777);
$notaCabecalho->setCodNat(1010101);
$notaCabecalho->setCifFob('C');
$notaCabecalho->setCodCenCus(0);
$notaCabecalho->setCustomField('algum_custom_field', 'valor');
$notaCabecalho->setObservacao('Pedido criado pelo Package WillyMaciel\\Sankhya-php');

//Cria a nota enviando o cabeçalho no constructor
$nota = new Nota($notaCabecalho);
//utilize informarPreco = true se pretende informar o preço de cada item manualmente
// $nota->informarPreco(true);

//Cria itens e vincula a nota
$item = new NotaItem();
$item->setCodProd(10961);
$item->setCodVol('UN');
$item->setCodLocalOrig(0);
$item->setQtdNeg(1);
$item->setPercDesc(0);
$item->setVlrUnit(50);

$nota->addItem($item);

$item = new NotaItem();
$item->setCodProd(30068);
$item->setCodVol('UN');
$item->setCodLocalOrig(0);
$item->setQtdNeg(1);
$item->setPercDesc(0);
$item->setVlrUnit(60);

$nota->addItem($item);

//Chamada para incluir a nota no sankhya
dump($api->incluirNota($nota));

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2288d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2745524?v=4)[Willy Bernardes Maciel](/maintainers/WillyMaciel)[@WillyMaciel](https://github.com/WillyMaciel)

---

Top Contributors

[![WillyMaciel](https://avatars.githubusercontent.com/u/2745524?v=4)](https://github.com/WillyMaciel "WillyMaciel (17 commits)")

---

Tags

apisdksankhya

### Embed Badge

![Health badge](/badges/willymaciel-sankhya-php/health.svg)

```
[![Health](https://phpackages.com/badges/willymaciel-sankhya-php/health.svg)](https://phpackages.com/packages/willymaciel-sankhya-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
