Download the PHP package tudorr89/fgo-php-api-sdk without Composer
On this page you can find all versions of the php package tudorr89/fgo-php-api-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tudorr89/fgo-php-api-sdk
More information about tudorr89/fgo-php-api-sdk
Files in tudorr89/fgo-php-api-sdk
Package fgo-php-api-sdk
Short Description PHP client for the FGO Invoicing/Billing API v7.0 — create invoices, manage articles, query nomenclatures, and more. Ships with Laravel auto-discovery.
License MIT
Homepage https://github.com/tudorr89/fgo-php-api-sdk
Informations about the package fgo-php-api-sdk
FGO API PHP Client
A fully-typed PHP client for the FGO Invoicing/Billing API v7.0.
Create and manage invoices, query nomenclatures, list articles, and more — with clean DTOs and Guzzle under the hood.
Requirements
Installation
Quick Start
Laravel
The package ships with auto-discovered service provider and facade — no manual registration needed.
Configure
Add to .env:
Use it
Or via DI:
Multi-tenant / credentials from the database
When each tenant (or merchant, or user) has their own FGO credentials, point the
package at a resolver instead of reading from .env. Implement
FgoApi\Laravel\Contracts\CredentialsResolver:
Register it in config/fgo.php:
Then:
A closure is also accepted if you don't want a dedicated class:
Authentication
All requests are signed with an SHA-1 hash. The Hash helper provides the correct calculation for each endpoint category:
The Client handles hashing automatically — you never need to call these directly.
API Reference
Invoices
| Method | Endpoint | Description |
|---|---|---|
invoices()->create(...) |
POST /factura/emitere |
Create and emit a new invoice |
invoices()->print($num, $serie) |
POST /factura/print |
Generate PDF download link |
invoices()->getStatus($num, $serie) |
POST /factura/getstatus |
Get invoice value and paid amount |
invoices()->cancel($num, $serie) |
POST /factura/anulare |
Cancel (keeps in history) |
invoices()->delete($num, $serie) |
POST /factura/stergere |
Permanently delete |
invoices()->reverse($num, $serie) |
POST /factura/stornare |
Reverse / credit note |
invoices()->addPayment(...) |
POST /factura/incasare |
Record a payment (Premium+) |
invoices()->deletePayment($num, $serie) |
POST /factura/stergereincasare |
Delete a payment |
invoices()->addTrackingNumber(...) |
POST /factura/awb |
Attach courier AWB |
invoices()->listAssociated($num, $serie) |
POST /factura/listfacturiasociate |
List linked invoices (Enterprise) |
Nomenclatures
| Method | Returns |
|---|---|
nomenclatures()->countries() |
All countries |
nomenclatures()->counties() |
All counties |
nomenclatures()->vatRates() |
VAT rates |
nomenclatures()->banks() |
Banks |
nomenclatures()->paymentTypes() |
Payment types |
nomenclatures()->invoiceTypes() |
Invoice types |
nomenclatures()->clientTypes() |
Client types (PF/PJ) |
nomenclatures()->localities('Bucuresti') |
Localities by county code |
Articles
| Method | Description |
|---|---|
articles()->list($page, $perPage) |
Paginated article list (Enterprise) |
articles()->get($code) |
Single article by account code |
articles()->getList(array $codes) |
Multiple articles, max 30 — deprecated |
articles()->modifiedArticles($hoursBack, $hoursTo) |
Articles modified in time window (Enterprise) |
Warehouses
Environments
Exception Handling
All exceptions extend FgoApi\Exceptions\FgoApiException:
| Exception | Trigger |
|---|---|
FgoApiException |
Generic API error (non-success response) |
AuthenticationException |
HTTP 401 — invalid credentials |
RateLimitException |
HTTP 429 — rate limit hit |
NotFoundException |
HTTP 404 — resource not found |
HttpException |
Other HTTP errors (includes status code + body) |
ValidationException |
Validation errors |
Rate Limits
The API enforces per-endpoint rate limits. The client does not automatically retry — implement your own retry logic as needed:
| Endpoint | Limit |
|---|---|
| Invoice create / payment | 1 req/sec, 15s timeout |
| Articles | 1 req/5 sec |
| Standard endpoints | No explicit limit |
Development
License
MIT. See LICENSE.